bjchy-udg-sdk 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +6 -0
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -81,6 +81,12 @@ class UdgClient {
|
|
|
81
81
|
defaultDb: o.defaultDb || '',
|
|
82
82
|
timeout: o.timeout || 15000
|
|
83
83
|
}
|
|
84
|
+
// streetKey 模式:resolve 结果本地有缓存时同步补上 appid,
|
|
85
|
+
// 否则 AuthManager 的存储键缺 appid,刷新页面后读不回已缓存的 token(isLoggedIn 恒 false)
|
|
86
|
+
if (!this._ctx.appid && this._ctx.streetKey) {
|
|
87
|
+
const cached = storage.get('udg_resolve_' + this._ctx.streetKey + '@' + this._ctx.endpoint)
|
|
88
|
+
if (cached) this._ctx.appid = cached
|
|
89
|
+
}
|
|
84
90
|
this._ctx.auth = new AuthManager(this._ctx, rawPost(this._ctx))
|
|
85
91
|
if (o.token) {
|
|
86
92
|
// 外部 token 直入(与现有 JWT 体系互通)
|