@cpzxrobot/sdk 1.0.29 → 1.0.31
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/dist/index.js +4 -5
- package/index.ts +4 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -214,18 +214,17 @@ class Cpzxrobot {
|
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
216
216
|
else if (this.mode === "miniapp_in_web") {
|
|
217
|
-
//if
|
|
218
|
-
const
|
|
219
|
-
const token = url.searchParams.get("token");
|
|
217
|
+
//if localstorage has token, use it
|
|
218
|
+
const token = localStorage.getItem("token");
|
|
220
219
|
if (token) {
|
|
221
|
-
this.token =
|
|
220
|
+
this.token = token;
|
|
222
221
|
this.initAxios(baseURL);
|
|
223
222
|
this.resolveReady(this.axios);
|
|
224
223
|
return;
|
|
225
224
|
}
|
|
226
225
|
else {
|
|
227
226
|
//jump to miniapp login page
|
|
228
|
-
window.location.href = "
|
|
227
|
+
window.location.href = "/login.html";
|
|
229
228
|
}
|
|
230
229
|
}
|
|
231
230
|
else {
|
package/index.ts
CHANGED
|
@@ -249,17 +249,16 @@ export class Cpzxrobot {
|
|
|
249
249
|
});
|
|
250
250
|
return;
|
|
251
251
|
} else if (this.mode === "miniapp_in_web") {
|
|
252
|
-
//if
|
|
253
|
-
const
|
|
254
|
-
const token = url.searchParams.get("token");
|
|
252
|
+
//if localstorage has token, use it
|
|
253
|
+
const token = localStorage.getItem("token");
|
|
255
254
|
if (token) {
|
|
256
|
-
this.token =
|
|
255
|
+
this.token = token;
|
|
257
256
|
this.initAxios(baseURL);
|
|
258
257
|
this.resolveReady(this.axios);
|
|
259
258
|
return;
|
|
260
259
|
} else {
|
|
261
260
|
//jump to miniapp login page
|
|
262
|
-
window.location.href = "
|
|
261
|
+
window.location.href = "/login.html";
|
|
263
262
|
}
|
|
264
263
|
} else {
|
|
265
264
|
this.initAxios(baseURL);
|