登录出错问题

prod
wangwei 2 years ago
parent 053debea7c
commit ea3f3ed180

@ -349,5 +349,9 @@
text-align: right;
}
.el-table--mini .el-table__cell {
padding:0px!important;
}

@ -71,11 +71,15 @@ const user = {
const uuid = userInfo.uuid
return new Promise((resolve, reject) => {
login(username, password, code, uuid).then(res => {
setToken(res.data.token)
setAdminId(res.data.id)
commit('SET_TOKEN', res.data.token)
commit('SET_ADMINID', res.data.id)
resolve()
if(res.code == 20000){
setToken(res.data.token)
setAdminId(res.data.id)
commit('SET_TOKEN', res.data.token)
commit('SET_ADMINID', res.data.id)
resolve()
}else{
reject(res.message);
}
}).catch(error => {
reject(error)
})

@ -198,11 +198,12 @@ export default {
Cookies.remove("password");
// Cookies.remove('rememberMe');
}
this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({path: this.redirect || "/"}).catch(() => {
this.$store.dispatch("Login", this.loginForm).then((res) => {
this.$router.push({path: this.redirect || "/"}).catch((res) => {
});
}).catch(() => {
}).catch((res) => {
this.loading = false;
this.$message.error(res);
if (this.captchaEnabled) {
this.getCode();
}

Loading…
Cancel
Save