马宇豪
2023-05-08 df5b61dcf9d7c6a71ba919b0556ea9aa43aa3f76
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,