fix: modify

develop
时启龙 2024-09-01 15:45:39 +08:00
parent ebc386133f
commit f01f306449
3 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
export function appendParamsToUrl(url: string, pathname: string, params: Record<string, string>) {
export function appendParamsToUrl(url = '', pathname = '', params: Record<string, string> = {}) {
// 创建一个新的URL对象在末尾添加 pathname
const urlObject = new URL(pathname, url)

View File

@ -26,7 +26,7 @@ export default {
token: getToken(),
...(this.$route.query || {})
}
const url = appendParamsToUrl(this.url, this.$route.path + this.$route.meta?.pathname, params)
const url = appendParamsToUrl(this.url, this.$route.path + (this.$route.meta?.pathname || ''), params)
console.log('iframeUrl: ', url)
return url
}

View File

@ -26,7 +26,7 @@ export default {
token: getToken(),
...(this.$route.query || {})
}
const url = appendParamsToUrl(this.url, this.$route.path + this.$route.meta?.pathname, params)
const url = appendParamsToUrl(this.url, this.$route.path + (this.$route.meta?.pathname || ''), params)
console.log('iframeUrl: ', url)
return url
}