登录跳转

This commit is contained in:
2025-01-09 09:21:27 +08:00
parent 3fbb6609e3
commit 369cb0dc77
2 changed files with 17 additions and 1 deletions

View File

@@ -344,3 +344,15 @@ export const sysMenuBuild = () => {
] ]
return res return res
} }
export const authlogin = () => {
let res = {
code: '1',
result: {
user: {
username: 'admin',
user: {isAdmin: true}
}
}
}
return res
}

View File

@@ -158,7 +158,11 @@ export default {
this.$store.dispatch('userInfo', JSON.stringify(obj)) this.$store.dispatch('userInfo', JSON.stringify(obj))
this.$store.dispatch('setLoginInfo', {username: this.username, password: this.password}) this.$store.dispatch('setLoginInfo', {username: this.username, password: this.password})
this.hide() this.hide()
this.$router.push('/mini/home') if (res.result.user.user.isAdmin) {
this.$router.push('/mini/home')
} else {
this.$router.push('/index/home')
}
} else { } else {
this.Dialog(res.desc) this.Dialog(res.desc)
} }