From 369cb0dc7771be2f5dc0472d2194d53c8f449706 Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Thu, 9 Jan 2025 09:21:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/mork.js | 12 ++++++++++++ src/pages/modules/login/login.vue | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) 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) }