fix: bug修改
This commit is contained in:
+18
-4
@@ -25,11 +25,25 @@
|
||||
const token = ref('');
|
||||
|
||||
onLoad(async (e) => {
|
||||
if (!e.token) {
|
||||
const options = e
|
||||
const queryObj = Object.assign({}, options);
|
||||
|
||||
if (options.token) {
|
||||
// queryObj.open = queryObj.open || 0;
|
||||
|
||||
if(!queryObj.open) {
|
||||
queryObj.open = 0;
|
||||
const queryStr= Object.entries(queryObj).map(([k,v]) => `${k}=${v}`).join('&')
|
||||
window.location.href = `${window.location.href.replace(/\?.*$/g, '')}?${queryStr}`
|
||||
return
|
||||
}
|
||||
} else {
|
||||
const res = await getToken();
|
||||
window.location.href =
|
||||
window.location.href.replace(/\?.*$/g, '') + '?token=' + res.data.accessToken;
|
||||
return;
|
||||
queryObj.open = queryObj.open || 1;
|
||||
queryObj.token = res.data.accessToken;
|
||||
const queryStr= Object.entries(queryObj).map(([k,v]) => `${k}=${v}`).join('&')
|
||||
window.location.href = `${window.location.href.replace(/\?.*$/g, '')}?${queryStr}`
|
||||
return
|
||||
}
|
||||
|
||||
token.value = e.token;
|
||||
|
||||
Reference in New Issue
Block a user