| | |
| | | import { useLoginApi } from '/@/api/login'; |
| | | import { useUserInfo } from '/@/stores/userInfo'; |
| | | import type { FormInstance, FormRules } from 'element-plus' |
| | | import {workApplyApi} from "/@/api/specialWorkSystem/workApply"; |
| | | |
| | | import {verifyPhone,verifyIdCard} from "/@/utils/toolsValidate" |
| | | import { Base64 } from 'js-base64' |
| | | export default defineComponent({ |
| | |
| | | // 存储 token 到浏览器缓存 |
| | | let res = await useLoginApi().signIn(state.ruleForm); |
| | | if (res.data.code === 100) { |
| | | console.log(res.data.data,'user') |
| | | await userInfo.setUserInfos(res.data.data); |
| | | Cookies.set('token', res.data.data.tk); |
| | | Cookies.set('uid', res.data.data.uid); |
| | |
| | | // 登录成功,跳到转首页 |
| | | // 如果是复制粘贴的路径,非首页/登录页,那么登录成功后重定向到对应的路径中 |
| | | // if (route.json.query?.redirect) { |
| | | router.push('/home'); |
| | | router.push('/project'); |
| | | // 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) : '', |