@ctil/gql 1.0.13 → 1.0.15

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.cjs CHANGED
@@ -4380,6 +4380,7 @@ var CCRequest = class {
4380
4380
  console.error("Failed to persist login info to file:", err);
4381
4381
  }
4382
4382
  }
4383
+ this.config.loginInfo = loginInfo;
4383
4384
  }
4384
4385
  /** 加载登录信息(仅负责加载,不负责刷新) */
4385
4386
  /** 加载登录信息 */
@@ -4409,7 +4410,6 @@ var CCRequest = class {
4409
4410
  return info;
4410
4411
  }
4411
4412
  getLoginInfo() {
4412
- if (this.config.loginInfo) return this.config.loginInfo;
4413
4413
  return this.loadLoginInfo();
4414
4414
  }
4415
4415
  removeLoginInfo() {
@@ -4456,6 +4456,7 @@ var CCRequest = class {
4456
4456
  this.removeLoginInfo();
4457
4457
  throw new Error("Login expired. Please login again.");
4458
4458
  }
4459
+ console.log("refreshExpired", refreshExpired);
4459
4460
  if (accessExpired && !refreshExpired) {
4460
4461
  try {
4461
4462
  const refreshResult = await auth.refreshToken({
@@ -4465,9 +4466,10 @@ var CCRequest = class {
4465
4466
  });
4466
4467
  const newInfo = refreshResult.refreshToken ?? refreshResult;
4467
4468
  this.setLoginInfo(newInfo, this._remember);
4468
- } catch {
4469
+ } catch (err) {
4470
+ console.log("err", err);
4469
4471
  this.removeLoginInfo();
4470
- throw new Error("Failed to refresh token. Please login again.");
4472
+ throw new Error("Failed to refresh token. Please login again." + err?.message);
4471
4473
  }
4472
4474
  }
4473
4475
  }