GetTestInfoActions.getTestInfo.listen(function(carrierid) { var that = this; RestAPI.request({ url: RestAPI.URL.GETUSERTESTINFO + "/" + carrierid + "/wl000", method: "GET", successCallback: function(data) { that.completed(data); }, errorCallback: function(res) { that.failed(res); } }); });
AuthActions.getUser.listen(function() { var that = this; RestAPI.request({ url: RestAPI.URL.GET_USERINFO, method: "GET", successCallback: function(data) { that.completed(data); }, errorCallback: function(res) { that.failed(res); } }); });
}; }, //校验手机和邮箱的唯一性 validateEmailMobile(rule, value, callback) { var userinfo = this.getUserinfo(); if (value === userinfo.mobile || value === userinfo.email) { callback(); } else { RestAPI.request({ url: RestAPI.URL.VALIDATE_ACCOUNT, method: "POST", type: "form", send: {emailormobile: value}, successCallback: function(data) { callback(); }, errorCallback: function(res) { if (res && res.body && res.body.flag) { callback(new Error(res.body.desc)); } } }); } }, //校验工号的唯一性 validateCode(rule, value, callback) { var userinfo = this.getUserinfo(); var carrierId = userinfo.carrierId; if (value === null || value === "" || value === userinfo.code) { callback(); }
repassword: undefined } }; }, resetPassword() { var that = this; RestAPI.request({//修改密码并且激活 url: RestAPI.URL.EMAILUPDATEPWD, method: "POST", type: "form", send: { "email": that.props.account, "newpwd": this.state.formData.password, "gettype": that.props.accountType }, successCallback: function(data){ if (data === 1) {//程序出错 } else {//修改密码成功 that.props.onNextStep("", ""); } }, errorCallback: function(res) { } }); }, handleClickNext(e) { e.preventDefault(); var that = this; // 点击下一步,首先进行表单校验