|
@@ -25,21 +25,19 @@ export default {
|
|
|
console.log("打印获取的token",token);
|
|
console.log("打印获取的token",token);
|
|
|
setToken(token);
|
|
setToken(token);
|
|
|
this.$store.commit('user/SET_TOKEN', token); // 同步更新 store 状态,否则请求拦截器中 store.getters.token 为空,不会携带 Authorization 头
|
|
this.$store.commit('user/SET_TOKEN', token); // 同步更新 store 状态,否则请求拦截器中 store.getters.token 为空,不会携带 Authorization 头
|
|
|
- alert(token);
|
|
|
|
|
this.$store.dispatch('user/getUserInfoByToken').then(user => {
|
|
this.$store.dispatch('user/getUserInfoByToken').then(user => {
|
|
|
-
|
|
|
|
|
|
|
|
|
|
sessionStorage.setItem('schoolType', 2) //1:单校 2:联校// 暂时写死单校 线上还是单校的
|
|
sessionStorage.setItem('schoolType', 2) //1:单校 2:联校// 暂时写死单校 线上还是单校的
|
|
|
|
|
|
|
|
- // let userInfos = this.$store.state.user.userInfo
|
|
|
|
|
- // if (userInfos.phone) {
|
|
|
|
|
- // const directUrl = '/jointStudentAnalysisReport/list'
|
|
|
|
|
|
|
+ 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' })
|
|
|
|
|
|
|
+ this.$router.push({ path: directUrl })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$router.push({ path: '/userInfo/personInfo' })
|
|
|
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ }
|
|
|
}) //获取用户登录信息
|
|
}) //获取用户登录信息
|
|
|
|
|
|
|
|
}
|
|
}
|