| | |
| | | setup() { |
| | | const { t } = useI18n(); |
| | | const userInfo = useUserInfo() |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const storesThemeConfig = useThemeConfig(); |
| | | const { themeConfig } = storeToRefs(storesThemeConfig); |
| | | const route = useRoute(); |
| | | const router = useRouter(); |
| | | const state = reactive({ |
| | |
| | | // 存储 token 到浏览器缓存 |
| | | let res = await useLoginApi().signIn(state.ruleForm) |
| | | if(res.data.code === '200'){ |
| | | Session.set('ifMenu',false) |
| | | Session.set('projectId','') |
| | | userInfo.setUserInfos(res.data.data) |
| | | Session.set('token', res.data.data.accessToken); |
| | | Session.set('sign',res.data.data.id) |
| | | await initFrontEndControlRoutes(); |
| | | Session.set('projectId',''); |
| | | Session.set('uid',res.data.data.id); |
| | | await initBackEndControlRoutes(); |
| | | signInSuccess(); |
| | | }else{ |
| | | state.loading.signIn = false |