Commit be95e227 by Jianli Ou

登录判断字段更改

parent 5381f1c9
......@@ -115,24 +115,21 @@ export default {
this.$api.user.login({
...this.userForm
}).then(res => {
console.log(res)
console.log(res, !res.success)
if (!res.success) {
this.userLoginError = res.returnMsg || '用户名或密码不正确!'
this.showUserLoginError = true;
} else {
localStorage.setItem('loginInfo', JSON.stringify(res.data))
if (res.levels === null) {
if (res.data.levels === null) {
localStorage.setItem('gs-user', JSON.stringify({type: 'unVerify'}))
this.$router.push({path: '/MyManage/UnVerify/index'})
} else if (res.levels === 4) {
} else if (res.data.levels === 4) {
localStorage.setItem('gs-user', JSON.stringify({type: 'verify'}))
this.$router.push({path: '/MyManage/SystemMember/index'})
} else if (res.levels === 0) {
} else if (res.data.levels === 0) {
localStorage.setItem('gs-user', JSON.stringify({type: 'admin'}))
this.$router.push({path: '/MyManage/admin/check'})
} else {
this.userLoginError = '用户名或密码不正确!'
this.showUserLoginError = true;
}
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment