diff --git a/src/pages/common/Config.vue b/src/pages/common/Config.vue
index 031edd9d..22d113de 100644
--- a/src/pages/common/Config.vue
+++ b/src/pages/common/Config.vue
@@ -50,7 +50,7 @@
扫码登录
- 刷新数据
+ 刷新数据
@@ -186,7 +186,13 @@ const buildTime = computed(() => appStore.buildTime);
// About OS
const osPlatform = ref("");
const osVersion = ref("");
-const dbInfo = ref>([]);
+const dbInfo = ref<
+ Array<{
+ key: string;
+ value: string;
+ updated: string;
+ }>
+>([]);
// loading
const loading = ref(true);
@@ -295,13 +301,13 @@ async function confirmRefreshUser(): Promise {
}
await TGSqlite.saveAppData("cookie", JSON.stringify(ck));
const infoRes = await TGRequest.User.byCookie.getUserInfo(ck.cookie_token, ck.account_id);
- if ("nickname" in infoRes) {
- userStore.setBriefInfo(infoRes);
- loadingTitle.value = "获取成功!正在获取用户游戏账号信息";
- } else {
+ if ("retcode" in infoRes) {
console.error(infoRes);
loadingTitle.value = "获取失败!正在获取用户游戏账号信息";
failCount++;
+ } else {
+ userStore.setBriefInfo(infoRes);
+ loadingTitle.value = "获取成功!正在获取用户游戏账号信息";
}
const accountRes = await TGRequest.User.byCookie.getAccounts(ck.cookie_token, ck.account_id);
if (Array.isArray(accountRes)) {
diff --git a/src/web/request/getUserInfo.ts b/src/web/request/getUserInfo.ts
index 84bb5ea2..9e6db9df 100644
--- a/src/web/request/getUserInfo.ts
+++ b/src/web/request/getUserInfo.ts
@@ -2,7 +2,7 @@
* @file web request getUserInfo.ts
* @description 获取用户信息请求
* @author BTMuli
- * @since Alpha v0.2.2
+ * @since Beta v0.3.0
*/
// tauri
@@ -14,7 +14,7 @@ import TGUtils from "../utils/TGUtils";
/**
* @description 根据 cookie 获取用户信息
- * @since Alpha v0.2.2
+ * @since Beta v0.3.0
* @param {string} cookie_token cookie token
* @param {string} account_id 用户 account_id
* @returns {Promise}
@@ -29,7 +29,7 @@ export async function getUserInfoByCookie(
};
const url = TGApi.GameData.byCookie.getUserInfo;
const params = { gids: "2" };
- const header = TGUtils.User.getSignHeader(cookie, "GET", {}, "common");
+ const header = TGUtils.User.getHeader(cookie, "GET", {}, "common", true);
return await http
.fetch(url, {
method: "GET",