NEZ-2840 fix:当 endpoint 配置联邦时,Metric target 访问失败

This commit is contained in:
zhangyu
2023-05-25 15:37:18 +08:00
parent 21c0f25b25
commit 010a75c45c

View File

@@ -345,7 +345,14 @@ export default {
let str = '' let str = ''
if (!lodash.isEmpty(params)) { if (!lodash.isEmpty(params)) {
for (const key in params) { for (const key in params) {
str += key + '=' + params[key] + '&' const arr = params[key]
if (arr.length > 1) {
arr.forEach(item => {
str += key + '=' + item + '&'
})
} else {
str += key + '=' + params[key][0] + '&'
}
} }
} }
const linkTarget = `${protocol}://${host}:${port + metricsPath}${str ? '?' + str.slice(0, str.length - 1) : ''}` const linkTarget = `${protocol}://${host}:${port + metricsPath}${str ? '?' + str.slice(0, str.length - 1) : ''}`