From df5b61dcf9d7c6a71ba919b0556ea9aa43aa3f76 Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期一, 08 五月 2023 10:00:43 +0800 Subject: [PATCH] 修改展示 --- src/views/loginPage/component/accountLogin.vue | 24 ++++++++++++++++++++++-- 1 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/views/loginPage/component/accountLogin.vue b/src/views/loginPage/component/accountLogin.vue index 8f5c014..8ae28b4 100644 --- a/src/views/loginPage/component/accountLogin.vue +++ b/src/views/loginPage/component/accountLogin.vue @@ -87,6 +87,7 @@ import {verifyPhone,verifyIdCard} from "/@/utils/toolsValidate" import { Base64 } from 'js-base64' +import {useMenuApi} from "/@/api/systemManage/menu"; export default defineComponent({ name: 'accountLogin', setup() { @@ -113,7 +114,8 @@ password: '', rePassword: '' }, - identifyDialog: false + identifyDialog: false, + menu: [] }); const identifyRef = ref<FormInstance>() @@ -227,6 +229,21 @@ // signInSuccess(); // } }; + + const getMenu = async () => { + let res = await useMenuApi().getMenuAdmin(); + if (res.data.code === 100) { + state.menu = JSON.parse(JSON.stringify(res.data.data)) + router.push(state.menu[0].children[0].path); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + + }; + // 登录成功后的跳转 const signInSuccess = async () => { // 初始化登录成功时间问候语 @@ -234,7 +251,9 @@ // 登录成功,跳到转首页 // 如果是复制粘贴的路径,非首页/登录页,那么登录成功后重定向到对应的路径中 // if (route.json.query?.redirect) { - router.push('/project'); + getMenu() + // console.log(state.menu,'menu') + // router.push({ // path: <string>route.json.query?.redirect, // query: Object.keys(<string>route.json.query?.params).length > 0 ? JSON.parse(<string>route.json.query?.params) : '', @@ -293,6 +312,7 @@ return { identifyRef, identityRules, + getMenu, clearIdentity, onSignIn, identify, -- Gitblit v1.9.2