diff --git a/src/config/mork.js b/src/config/mork.js index 9d270e9..5c3740d 100644 --- a/src/config/mork.js +++ b/src/config/mork.js @@ -343,4 +343,16 @@ export const sysMenuBuild = () => { } ] return res +} +export const authlogin = () => { + let res = { + code: '1', + result: { + user: { + username: 'admin', + user: {isAdmin: true} + } + } + } + return res } \ No newline at end of file diff --git a/src/pages/modules/login/login.vue b/src/pages/modules/login/login.vue index 8ae522d..170b486 100644 --- a/src/pages/modules/login/login.vue +++ b/src/pages/modules/login/login.vue @@ -158,7 +158,11 @@ export default { this.$store.dispatch('userInfo', JSON.stringify(obj)) this.$store.dispatch('setLoginInfo', {username: this.username, password: this.password}) 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 { this.Dialog(res.desc) }