Commit ada9144e by huyue

修改t

1 parent 22df88ad
...@@ -40,16 +40,16 @@ export default { ...@@ -40,16 +40,16 @@ export default {
// 检查是否已经有 t 参数 // 检查是否已经有 t 参数
if (this.url.includes('?t=')) { if (this.url.includes('?t=')) {
// 如果已经有 t 参数,替换它 // 如果已经有 t 参数,替换它
return this.url.replace(/(\?|&)t=[^&]+/, '$1t=' + this.SSOInfo.t); return this.url.replace(/(\?|&)t=[^&]+/, '$1t=' + this.scrmInfo.sessionId);
} else { } else {
// 如果没有 t 参数,添加它 // 如果没有 t 参数,添加它
return this.url.includes('?') return this.url.includes('?')
? this.url + '&t=' + this.SSOInfo.t ? this.url + '&t=' + this.scrmInfo.sessionId
: this.url + '?t=' + this.SSOInfo.t; : this.url + '?t=' + this.scrmInfo.sessionId;
} }
}, },
...mapState({ ...mapState({
SSOInfo: (state) => state.d2admin.user.SSOInfo, scrmInfo: (state) => state.d2admin.user.scrmInfo
}) })
}, },
mounted() { mounted() {
...@@ -63,9 +63,9 @@ export default { ...@@ -63,9 +63,9 @@ export default {
this.handleIframeLocationChange(event.data.url); this.handleIframeLocationChange(event.data.url);
} else if (event.data.type === 'logout') { } else if (event.data.type === 'logout') {
// 监听登录过期需要登出 // 监听登录过期需要登出
// this.$router.push('/login') this.$router.push('/login')
// this.logout() this.logout()
// this.$StoreReset.call(this.$store) // 重置 store this.$StoreReset.call(this.$store) // 重置 store
} }
}); });
}, },
...@@ -76,11 +76,11 @@ export default { ...@@ -76,11 +76,11 @@ export default {
const internalUrl = url; const internalUrl = url;
let newInternalUrl = internalUrl; let newInternalUrl = internalUrl;
if (internalUrl.includes('?t=')) { if (internalUrl.includes('?t=')) {
newInternalUrl = internalUrl.replace(/(\?|&)t=[^&]+/, '$1t=' + this.SSOInfo.t); newInternalUrl = internalUrl.replace(/(\?|&)t=[^&]+/, '$1t=' + this.scrmInfo.sessionId);
} else { } else {
newInternalUrl = internalUrl.includes('?') newInternalUrl = internalUrl.includes('?')
? internalUrl + '&t=' + this.SSOInfo.t ? internalUrl + '&t=' + this.scrmInfo.sessionId
: internalUrl + '?t=' + this.SSOInfo.t; : internalUrl + '?t=' + this.scrmInfo.sessionId;
} }
console.log('新的内部地址:', newInternalUrl); console.log('新的内部地址:', newInternalUrl);
this.url = newInternalUrl this.url = newInternalUrl
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!