|
|
@@ -67,17 +67,18 @@ export default {
|
|
|
if (event.origin !== window.location.origin) {
|
|
|
return
|
|
|
}
|
|
|
- if(getToken() && schoolType){
|
|
|
- const currentPath = sessionStorage.getItem('student_currentPath');//获取当前进入的路由
|
|
|
- const directUrl = currentPath?currentPath:'/jointStudentAnalysisReport/list';
|
|
|
- this.$router.push({ path: directUrl })
|
|
|
- return
|
|
|
- }
|
|
|
if (event.data.type === 'STU_TOKEN') {
|
|
|
- const userInfo = event.data.userInfo
|
|
|
- // console.log('打印用户信息', userInfo)
|
|
|
+ const userInfo = event.data.userInfo;
|
|
|
+ const tokenValue = userInfo.tokenValue;
|
|
|
+ const oldToken = getToken();
|
|
|
+ if(oldToken && oldToken === tokenValue && schoolType){
|
|
|
+ const currentPath = sessionStorage.getItem('student_currentPath');//获取当前进入的路由
|
|
|
+ const directUrl = currentPath?currentPath:'/jointStudentAnalysisReport/list';
|
|
|
+ this.$router.push({ path: directUrl })
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$store.dispatch('user/CLEAR_LOCAL_STORAGE') //清空本地存储
|
|
|
- setToken(userInfo.tokenValue)
|
|
|
+ setToken(tokenValue)
|
|
|
sessionStorage.setItem('schoolType', schoolType || 2) //1:单校 2:联校// 暂时写死单校 线上还是单校的
|
|
|
this.$store.dispatch('user/SET_TOKEN', userInfo.tokenValue)
|
|
|
this.$store.dispatch('user/SET_SCHOOL_LOGO', userInfo.schoolLogoUrl) //设置学校logo
|