diff --git a/healthlink-his-ui/src/utils/his.js b/healthlink-his-ui/src/utils/his.js index 8767839d4..35b1a00a3 100755 --- a/healthlink-his-ui/src/utils/his.js +++ b/healthlink-his-ui/src/utils/his.js @@ -243,11 +243,20 @@ export function tansParams(params) { var part = encodeURIComponent(propName) + '='; if (value !== null && value !== '' && typeof value !== 'undefined') { if (typeof value === 'object') { - for (const key of Object.keys(value)) { - if (value[key] !== null && value[key] !== '' && typeof value[key] !== 'undefined') { - let params = propName + '[' + key + ']'; - var subPart = encodeURIComponent(params) + '='; - result += subPart + encodeURIComponent(value[key]) + '&'; + if (Array.isArray(value)) { + // 数组:序列化为重复同名参数,兼容 Spring @RequestParam List 绑定 + for (const item of value) { + if (item !== null && item !== '' && typeof item !== 'undefined') { + result += part + encodeURIComponent(item) + '&'; + } + } + } else { + for (const key of Object.keys(value)) { + if (value[key] !== null && value[key] !== '' && typeof value[key] !== 'undefined') { + let params = propName + '[' + key + ']'; + var subPart = encodeURIComponent(params) + '='; + result += subPart + encodeURIComponent(value[key]) + '&'; + } } } } else {