提交 e76d6a4c 编写于 作者: 雪洛's avatar 雪洛

fix: 修复createInstance传入配置对部分接口未生效的Bug

上级 35440af6
...@@ -26,7 +26,8 @@ class UniID { ...@@ -26,7 +26,8 @@ class UniID {
config config
} = {}) { } = {}) {
this._clientInfo = context ? parseContext(context) : clientInfo this._clientInfo = context ? parseContext(context) : clientInfo
this.config = config || this._getOriginConfig() this._config = config
this.config = this._getOriginConfig()
this.interceptorMap = new Map() this.interceptorMap = new Map()
if (uniIDConfig.hasFile('custom-token.js')) { if (uniIDConfig.hasFile('custom-token.js')) {
this.setInterceptor('customToken', require(uniIDConfig.resolve('custom-token.js'))) this.setInterceptor('customToken', require(uniIDConfig.resolve('custom-token.js')))
...@@ -59,6 +60,9 @@ class UniID { ...@@ -59,6 +60,9 @@ class UniID {
} }
_getOriginConfig () { _getOriginConfig () {
if (this._config) {
return this._config
}
if (uniIDConfig.hasFile('config.json')) { if (uniIDConfig.hasFile('config.json')) {
let configContent let configContent
try { try {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册