@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 +5 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1611,6 +1611,7 @@ var CCRequest = class {
|
|
|
1611
1611
|
console.error("Failed to persist login info to file:", err);
|
|
1612
1612
|
}
|
|
1613
1613
|
}
|
|
1614
|
+
this.config.loginInfo = loginInfo;
|
|
1614
1615
|
}
|
|
1615
1616
|
/** 加载登录信息(仅负责加载,不负责刷新) */
|
|
1616
1617
|
/** 加载登录信息 */
|
|
@@ -1640,7 +1641,6 @@ var CCRequest = class {
|
|
|
1640
1641
|
return info;
|
|
1641
1642
|
}
|
|
1642
1643
|
getLoginInfo() {
|
|
1643
|
-
if (this.config.loginInfo) return this.config.loginInfo;
|
|
1644
1644
|
return this.loadLoginInfo();
|
|
1645
1645
|
}
|
|
1646
1646
|
removeLoginInfo() {
|
|
@@ -1687,6 +1687,7 @@ var CCRequest = class {
|
|
|
1687
1687
|
this.removeLoginInfo();
|
|
1688
1688
|
throw new Error("Login expired. Please login again.");
|
|
1689
1689
|
}
|
|
1690
|
+
console.log("refreshExpired", refreshExpired);
|
|
1690
1691
|
if (accessExpired && !refreshExpired) {
|
|
1691
1692
|
try {
|
|
1692
1693
|
const refreshResult = await auth.refreshToken({
|
|
@@ -1696,9 +1697,10 @@ var CCRequest = class {
|
|
|
1696
1697
|
});
|
|
1697
1698
|
const newInfo = refreshResult.refreshToken ?? refreshResult;
|
|
1698
1699
|
this.setLoginInfo(newInfo, this._remember);
|
|
1699
|
-
} catch {
|
|
1700
|
+
} catch (err) {
|
|
1701
|
+
console.log("err", err);
|
|
1700
1702
|
this.removeLoginInfo();
|
|
1701
|
-
throw new Error("Failed to refresh token. Please login again.");
|
|
1703
|
+
throw new Error("Failed to refresh token. Please login again." + err?.message);
|
|
1702
1704
|
}
|
|
1703
1705
|
}
|
|
1704
1706
|
}
|