| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <template>
- </template>
- <script>
- // 工作台过来的登录
- import user from '@/http/api/user'
- import { setToken,getToken } from '@/utils/auth'
- export default {
- data() {
- return {}
- },
- mounted() {
- this.GetUserInfo()
- },
- methods: {
- //获取用户信息
- GetUserInfo() {
-
- const token=localStorage.getItem('token');//获取token
- console.log("打印获取的token",token);
- setToken(token);
- alert(token);
- this.$store.dispatch('user/getUserInfoByToken').then(user => {
-
- sessionStorage.setItem('schoolType', 2) //1:单校 2:联校// 暂时写死单校 线上还是单校的
- // let userInfos = this.$store.state.user.userInfo
- // if (userInfos.phone) {
- // const directUrl = '/jointStudentAnalysisReport/list'
- // this.$router.push({ path: directUrl })
- // } else {
- // this.$router.push({ path: '/userInfo/personInfo' })
-
- // }
- }) //获取用户登录信息
-
- }
- }
- }
- </script>
- <style lang="scss">
- @use '@/styles/login.scss';
- </style>
|