From e76d6a4c822d2ccf85eb43f5d4c5963353a840bb Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Sat, 13 Jan 2024 16:52:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DcreateInstance?= =?UTF-8?q?=E4=BC=A0=E5=85=A5=E9=85=8D=E7=BD=AE=E5=AF=B9=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=9C=AA=E7=94=9F=E6=95=88=E7=9A=84Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 9447ec5..461b3fa 100644 --- a/src/index.js +++ b/src/index.js @@ -26,7 +26,8 @@ class UniID { config } = {}) { this._clientInfo = context ? parseContext(context) : clientInfo - this.config = config || this._getOriginConfig() + this._config = config + this.config = this._getOriginConfig() this.interceptorMap = new Map() if (uniIDConfig.hasFile('custom-token.js')) { this.setInterceptor('customToken', require(uniIDConfig.resolve('custom-token.js'))) @@ -59,6 +60,9 @@ class UniID { } _getOriginConfig () { + if (this._config) { + return this._config + } if (uniIDConfig.hasFile('config.json')) { let configContent try { -- GitLab