|
@@ -1,7 +1,7 @@
|
|
|
<template></template>
|
|
<template></template>
|
|
|
<script>
|
|
<script>
|
|
|
import user from '@/http/api/user'
|
|
import user from '@/http/api/user'
|
|
|
-import { setToken } from '@/utils/auth'
|
|
|
|
|
|
|
+import { setToken,getToken } from '@/utils/auth'
|
|
|
// import { getToken} from '@/utils/auth';
|
|
// import { getToken} from '@/utils/auth';
|
|
|
import { encrypt } from '@/utils/jsencrypt'
|
|
import { encrypt } from '@/utils/jsencrypt'
|
|
|
import base from '@/http/common/base'
|
|
import base from '@/http/common/base'
|
|
@@ -62,17 +62,20 @@ export default {
|
|
|
console.log('打印父窗口传来的数据', event.data)
|
|
console.log('打印父窗口传来的数据', event.data)
|
|
|
console.log('打印父窗口的源', event.origin)
|
|
console.log('打印父窗口的源', event.origin)
|
|
|
console.log('打印当前窗口的源', window.location.origin)
|
|
console.log('打印当前窗口的源', window.location.origin)
|
|
|
|
|
+ const schoolType = sessionStorage.getItem('schoolType');
|
|
|
//安全检查 验证消息来源
|
|
//安全检查 验证消息来源
|
|
|
if (event.origin !== window.location.origin) {
|
|
if (event.origin !== window.location.origin) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ if(getToken() && schoolType){
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
if (event.data.type === 'STU_TOKEN') {
|
|
if (event.data.type === 'STU_TOKEN') {
|
|
|
const userInfo = event.data.userInfo
|
|
const userInfo = event.data.userInfo
|
|
|
console.log('打印用户信息', userInfo)
|
|
console.log('打印用户信息', userInfo)
|
|
|
this.$store.dispatch('user/CLEAR_LOCAL_STORAGE') //清空本地存储
|
|
this.$store.dispatch('user/CLEAR_LOCAL_STORAGE') //清空本地存储
|
|
|
setToken(userInfo.tokenValue)
|
|
setToken(userInfo.tokenValue)
|
|
|
- sessionStorage.setItem('schoolType', 1) //1:单校 2:联校// 暂时写死单校 线上还是单校的
|
|
|
|
|
|
|
+ sessionStorage.setItem('schoolType', schoolType || 1) //1:单校 2:联校// 暂时写死单校 线上还是单校的
|
|
|
this.$store.dispatch('user/SET_TOKEN', userInfo.tokenValue)
|
|
this.$store.dispatch('user/SET_TOKEN', userInfo.tokenValue)
|
|
|
this.$store.dispatch('user/SET_SCHOOL_LOGO', userInfo.schoolLogoUrl) //设置学校logo
|
|
this.$store.dispatch('user/SET_SCHOOL_LOGO', userInfo.schoolLogoUrl) //设置学校logo
|
|
|
this.$store.dispatch('user/SET_SCHOOL_WEB_SITE_ID', userInfo.cloudMonitorSiteId || '') //设置学校网站id
|
|
this.$store.dispatch('user/SET_SCHOOL_WEB_SITE_ID', userInfo.cloudMonitorSiteId || '') //设置学校网站id
|