fix: iframe 调整
parent
4944aec150
commit
ebc386133f
|
@ -9,10 +9,13 @@ export function appendParamsToUrl(url: string, pathname: string, params: Record<
|
||||||
for (const key in params) {
|
for (const key in params) {
|
||||||
searchParams.append(key, params[key])
|
searchParams.append(key, params[key])
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置URL的查询参数
|
// 设置URL的查询参数
|
||||||
urlObject.search = searchParams.toString()
|
let result = urlObject.toString()
|
||||||
|
if (result.endsWith('?')) {
|
||||||
|
result += searchParams.toString()
|
||||||
|
} else {
|
||||||
|
result += '?' + searchParams.toString()
|
||||||
|
}
|
||||||
// 返回处理后的URL字符串
|
// 返回处理后的URL字符串
|
||||||
return urlObject.toString()
|
return result
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,9 @@ export default {
|
||||||
token: getToken(),
|
token: getToken(),
|
||||||
...(this.$route.query || {})
|
...(this.$route.query || {})
|
||||||
}
|
}
|
||||||
const url = appendParamsToUrl(this.url, this.$route.path, params)
|
const url = appendParamsToUrl(this.url, this.$route.path + this.$route.meta?.pathname, params)
|
||||||
console.log('iframeUrl: ', url.toString())
|
console.log('iframeUrl: ', url)
|
||||||
return url.toString()
|
return url
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -26,9 +26,9 @@ export default {
|
||||||
token: getToken(),
|
token: getToken(),
|
||||||
...(this.$route.query || {})
|
...(this.$route.query || {})
|
||||||
}
|
}
|
||||||
const url = appendParamsToUrl(this.url, this.$route.path, params)
|
const url = appendParamsToUrl(this.url, this.$route.path + this.$route.meta?.pathname, params)
|
||||||
console.log('iframeUrl: ', url.toString())
|
console.log('iframeUrl: ', url)
|
||||||
return url.toString()
|
return url
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
Loading…
Reference in New Issue