fix: iframe 调整

develop
时启龙 2024-09-01 15:40:47 +08:00
parent d95dc1ebcc
commit e6fa0f0848
2 changed files with 9 additions and 6 deletions

View File

@ -68,8 +68,8 @@ export default {
token: getTrxToken()
}
const url = appendParamsToUrl(item.appAddress, '', params)
console.log('跳转应用时完整地址: ', url.toString())
window.open(url.toString(), '_blank')
console.log('跳转应用时完整地址: ', url)
window.open(url, '_blank')
}
return {

View File

@ -9,10 +9,13 @@ export function appendParamsToUrl(url: string, pathname: string, params: Record<
for (const key in params) {
searchParams.append(key, params[key])
}
// 设置URL的查询参数
urlObject.search = searchParams.toString()
let result = urlObject.toString()
if (result.endsWith('?')) {
result += searchParams.toString()
} else {
result += '?' + searchParams.toString()
}
// 返回处理后的URL字符串
return urlObject.toString()
return result
}