From cc6f0a51efbd8d971a64e4161317b87bd86605b3 Mon Sep 17 00:00:00 2001 From: huacao Date: Thu, 9 Feb 2023 20:32:04 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E4=BF=AE=E5=A4=8D=E5=8F=AF=E8=A7=81?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=E5=81=B6=E5=8F=91=E6=8A=A5=E9=94=99=20#1059?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components_vue/bk-user-selector.umd.js | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/paas2/paas/static/assets/components_vue/bk-user-selector.umd.js b/paas2/paas/static/assets/components_vue/bk-user-selector.umd.js index ddeabfd22..7652a1a30 100644 --- a/paas2/paas/static/assets/components_vue/bk-user-selector.umd.js +++ b/paas2/paas/static/assets/components_vue/bk-user-selector.umd.js @@ -6969,13 +6969,13 @@ var es_set = __webpack_require__("6062"); -/** - * 对象数组根据指定的key去重 - * - * @param {Array} array 原数组 - * @param {String} key - * - * @return {Array} +/** + * 对象数组根据指定的key去重 + * + * @param {Array} array 原数组 + * @param {String} key + * + * @return {Array} */ function unique(array, key) { if (!Array.isArray(array) || !array || array.length < 1) { @@ -7020,14 +7020,21 @@ var es_array_join = __webpack_require__("a15b"); - +function createCallbackName() { + var callbackName = "USER_LIST_CALLBACK".concat(+new Date()); + // 判断是否唯一 + if (window[callbackName]) { + return createCallbackName(); + } + return callbackName +} function JSONP(api) { var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; return new Promise(function (resolve, reject) { var timer; - var callbackName = "USER_LIST_CALLBACK".concat(Date.now()); + var callbackName = createCallbackName(); window[callbackName] = function (response) { timer && clearTimeout(timer);