Commit ada9144e by huyue

修改t

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