fix: 处理 iframe 参数兼容性

develop
时启龙 2024-09-04 18:50:22 +08:00
parent 4acb5de818
commit 75235c6195
2 changed files with 8 additions and 2 deletions

View File

@ -11,8 +11,14 @@ export function appendParamsToUrl(url = '', pathname = '', params: Record<string
} }
// 设置URL的查询参数 // 设置URL的查询参数
let result = urlObject.toString() let result = urlObject.toString()
if (result.endsWith('?')) { if (result.endsWith('?') || result.endsWith('&')) {
result += searchParams.toString() result += searchParams.toString()
} else if (result.indexOf('?') > -1) {
if (result.endsWith('&')) {
result += searchParams.toString()
} else {
result += '&' + searchParams.toString()
}
} else { } else {
result += '?' + searchParams.toString() result += '?' + searchParams.toString()
} }

View File

@ -16,7 +16,7 @@ export const tokenKey = 'CMC_TOKEN'
export const cacheViewMax = 15 export const cacheViewMax = 15
export const baseUrl = '/oms-web' export const baseUrl = '/oms-web'
// 默认跳转地址 // 默认跳转地址
export const homePath = '/dashbaord' export const homePath = '/monitor'
export const isConsole = false export const isConsole = false
export const loginKey = 'cmcLoginData' export const loginKey = 'cmcLoginData'
export function resetLicense() { export function resetLicense() {