| | |
| | | |
| | | import {verifyPhone,verifyIdCard} from "/@/utils/toolsValidate" |
| | | import { Base64 } from 'js-base64' |
| | | import {useMenuApi} from "/@/api/systemManage/menu"; |
| | | export default defineComponent({ |
| | | name: 'accountLogin', |
| | | setup() { |
| | |
| | | password: '', |
| | | rePassword: '' |
| | | }, |
| | | identifyDialog: false |
| | | identifyDialog: false, |
| | | menu: [] |
| | | }); |
| | | const identifyRef = ref<FormInstance>() |
| | | |
| | |
| | | // 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 () => { |
| | | // 初始化登录成功时间问候语 |
| | |
| | | // 登录成功,跳到转首页 |
| | | // 如果是复制粘贴的路径,非首页/登录页,那么登录成功后重定向到对应的路径中 |
| | | // 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) : '', |
| | |
| | | return { |
| | | identifyRef, |
| | | identityRules, |
| | | getMenu, |
| | | clearIdentity, |
| | | onSignIn, |
| | | identify, |