@cpzxrobot/sdk 1.2.9 → 1.2.10
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 +6 -1
- package/index.ts +5 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -385,7 +385,12 @@ class Cpzxrobot {
|
|
|
385
385
|
window.location.href = "/login.html?error=" + res.data.Error;
|
|
386
386
|
return;
|
|
387
387
|
}
|
|
388
|
-
|
|
388
|
+
if (res.data.token) {
|
|
389
|
+
this.token = "Bearer " + res.data.token;
|
|
390
|
+
}
|
|
391
|
+
else if (access_token.startsWith("Bearer ")) {
|
|
392
|
+
this.token = access_token;
|
|
393
|
+
}
|
|
389
394
|
localStorage.setItem("token", this.token);
|
|
390
395
|
this.resolveReady(this.axios);
|
|
391
396
|
});
|
package/index.ts
CHANGED
|
@@ -432,7 +432,11 @@ export class Cpzxrobot {
|
|
|
432
432
|
window.location.href = "/login.html?error=" + res.data.Error;
|
|
433
433
|
return;
|
|
434
434
|
}
|
|
435
|
-
|
|
435
|
+
if (res.data.token){
|
|
436
|
+
this.token = "Bearer " + res.data.token;
|
|
437
|
+
}else if (access_token.startsWith("Bearer ")){
|
|
438
|
+
this.token = access_token;
|
|
439
|
+
}
|
|
436
440
|
localStorage.setItem("token", this.token);
|
|
437
441
|
this.resolveReady(this.axios);
|
|
438
442
|
});
|