@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 CHANGED
@@ -385,7 +385,12 @@ class Cpzxrobot {
385
385
  window.location.href = "/login.html?error=" + res.data.Error;
386
386
  return;
387
387
  }
388
- this.token = "Bearer " + res.data.token;
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
- this.token = "Bearer " + res.data.token;
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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.2.9",
3
+ "version": "1.2.10",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {