diff --git a/src/index.js b/src/index.js index 9447ec5fffe7b9e70c93d5b64eebff73b93e744a..461b3fa15c40eb23c1b4c6a217fcdf14804dbfed 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 {