diff --git a/jshERP-web/src/store/modules/user.js b/jshERP-web/src/store/modules/user.js index f68ca62e..5538e05b 100644 --- a/jshERP-web/src/store/modules/user.js +++ b/jshERP-web/src/store/modules/user.js @@ -65,8 +65,8 @@ const user = { Login({ commit }, userInfo) { return new Promise((resolve, reject) => { login(userInfo).then(response => { - if(response.code ==200){ - if(response.data.msgTip == 'user can login'){ + if(response.code === 200){ + if(response.data.msgTip === 'user can login'){ const result = response.data Vue.ls.set(USER_ID, result.user.id, 7 * 24 * 60 * 60 * 1000); Vue.ls.set(USER_LOGIN_NAME, result.user.loginName, 7 * 24 * 60 * 60 * 1000); @@ -77,7 +77,7 @@ const user = { } commit('SET_INFO', userInfo) resolve(response) - } else if(response.code == 500010 || response.code == 500011){ + } else if(response.code === 500010 || response.code === 500011){ resolve(response) } else{ reject(response) diff --git a/jshERP-web/src/views/user/Login.vue b/jshERP-web/src/views/user/Login.vue index 99eba15a..1056ff50 100644 --- a/jshERP-web/src/views/user/Login.vue +++ b/jshERP-web/src/views/user/Login.vue @@ -275,32 +275,32 @@ description: ((err.response || {}).data || {}).message || err.message || err.data.message || "请求出现错误,请稍后再试", duration: 4, }); - this.loginBtn = false; //验证码刷新 this.form.setFieldsValue({'inputCode':''}) this.handleChangeCheckCode() + this.loginBtn = false; }, generateCode(value){ this.verifiedCode = value.toLowerCase() }, departConfirm(res, loginName){ - if(res.code==200){ + if(res.code === 200){ let err = {}; - if(res.data.msgTip == 'user can login'){ + if(res.data.msgTip === 'user can login'){ this.loginSuccess(res) - } else if(res.data.msgTip == 'user is not exist'){ + } else if(res.data.msgTip === 'user is not exist'){ err.message = '用户不存在'; this.requestFailed(err) this.Logout(); - } else if(res.data.msgTip == 'user password error'){ + } else if(res.data.msgTip === 'user password error'){ err.message = '用户密码不正确'; this.requestFailed(err) this.Logout(); - } else if(res.data.msgTip == 'user is black'){ + } else if(res.data.msgTip === 'user is black'){ err.message = '用户被禁用'; this.requestFailed(err) this.Logout(); - } else if(res.data.msgTip == 'tenant is black'){ + } else if(res.data.msgTip === 'tenant is black'){ if(loginName === 'jsh') { err.message = 'jsh用户已停用,请注册租户进行体验!'; } else { @@ -308,11 +308,11 @@ } this.requestFailed(err) this.Logout(); - } else if(res.data.msgTip == 'tenant is expire'){ + } else if(res.data.msgTip === 'tenant is expire'){ err.message = '试用期已结束,请联系客服续费'; this.requestFailed(err) this.Logout(); - } else if(res.data.msgTip == 'access service error'){ + } else if(res.data.msgTip === 'access service error'){ err.message = '查询服务异常'; this.requestFailed(err) this.Logout(); diff --git a/jshERP-web/src/views/user/Register.vue b/jshERP-web/src/views/user/Register.vue index dcf1fd86..d4528bf3 100644 --- a/jshERP-web/src/views/user/Register.vue +++ b/jshERP-web/src/views/user/Register.vue @@ -245,10 +245,10 @@ description: res.data.message || "注册失败", duration: 2 }); - that.registerBtn = false //验证码刷新 this.form.setFieldsValue({'inputCode':''}) this.handleChangeCheckCode() + that.registerBtn = false } }).catch((err) => { that.requestFailed(err);