From fe2a79773ffe4e48b1b0c7c7911c19ebbdeda6f9 Mon Sep 17 00:00:00 2001 From: zhaoyun Date: Fri, 24 Apr 2026 15:00:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DBug#440=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=AE=A1=E7=90=86=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=8A=A5=E9=94=99hasOwnProperty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vue 3 reactive proxy对象不支持直接调用hasOwnProperty方法 使用Object.prototype.hasOwnProperty.call替代,解决'hasOwnProperty is not a function'报错 --- openhis-ui-vue3/src/utils/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openhis-ui-vue3/src/utils/request.js b/openhis-ui-vue3/src/utils/request.js index 4fc4f340..9bead717 100644 --- a/openhis-ui-vue3/src/utils/request.js +++ b/openhis-ui-vue3/src/utils/request.js @@ -26,7 +26,7 @@ const convertIdsToString = (obj) => { } else { const newObj = {} for (const key in obj) { - if (obj.hasOwnProperty(key)) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { const value = obj[key] // 如果key以Id结尾或者是id,且值是数字,转为字符串 if ((key === 'id' || key.endsWith('Id') || key.endsWith('ID')) && typeof value === 'number') {