diff --git a/src/pages/User/Abyss.vue b/src/pages/User/Abyss.vue index 139ef6c2..22d7faab 100644 --- a/src/pages/User/Abyss.vue +++ b/src/pages/User/Abyss.vue @@ -183,14 +183,8 @@ async function refreshAbyss(): Promise { await TGLogger.Info("[UserAbyss][getAbyssData] 更新深渊数据"); loadingTitle.value = `正在获取${user.value.gameUid}的深渊数据`; loading.value = true; - const cookie = { - account_id: userStore.cookie.value.account_id, - cookie_token: userStore.cookie.value.cookie_token, - ltoken: userStore.cookie.value.ltoken, - ltuid: userStore.cookie.value.ltuid, - }; loadingTitle.value = `正在获取${user.value.gameUid}的上期深渊数据`; - const resP = await TGRequest.User.byCookie.getAbyss(cookie, "2", user.value); + const resP = await TGRequest.User.byCookie.getAbyss(userStore.cookie.value, "2", user.value); if (!("retcode" in resP)) { await TGLogger.Info("[UserAbyss][getAbyssData] 成功获取上期深渊数据"); loadingTitle.value = `正在保存${user.value.gameUid}的上期深渊数据`; @@ -203,7 +197,7 @@ async function refreshAbyss(): Promise { return; } loadingTitle.value = `正在获取${user.value.gameUid}的上期深渊数据`; - const res = await TGRequest.User.byCookie.getAbyss(cookie, "1", user.value); + const res = await TGRequest.User.byCookie.getAbyss(userStore.cookie.value, "1", user.value); if (!("retcode" in res)) { loadingTitle.value = `正在保存${user.value.gameUid}的本期深渊数据`; await TSUserAbyss.saveAbyss(user.value.gameUid, res); diff --git a/src/plugins/Sqlite/modules/userAbyss.ts b/src/plugins/Sqlite/modules/userAbyss.ts index 9f456167..0a82c9e1 100644 --- a/src/plugins/Sqlite/modules/userAbyss.ts +++ b/src/plugins/Sqlite/modules/userAbyss.ts @@ -66,7 +66,7 @@ function getInsertSql(uid: string, data: TGApp.Game.Abyss.FullData): string { const normalSkillRank = transCharacterData(data.normal_skill_rank); const energySkillRank = transCharacterData(data.energy_skill_rank); const floors = transFloorData(data.floors); - const skippedFloor = data.is_just_skipped_floor ? data.skipped_floor : ""; + const skippedFloor = data.skipped_floor; const timeNow = timestampToDate(new Date().getTime()); return ` INSERT INTO SpiralAbyss (uid, id, startTime, endTime, totalBattleTimes, totalWinTimes, maxFloor, diff --git a/src/web/request/getAbyss.ts b/src/web/request/getAbyss.ts index 01ae83cb..72e27554 100644 --- a/src/web/request/getAbyss.ts +++ b/src/web/request/getAbyss.ts @@ -1,7 +1,7 @@ /** * @file web/request/getAbyss.ts * @description 获取深渊信息 - * @since Beta v0.5.0 + * @since Beta v0.6.1 */ import TGHttp from "../../utils/TGHttp.js"; @@ -10,21 +10,26 @@ import TGUtils from "../utils/TGUtils.js"; /** * @description 获取深渊信息 - * @since Beta v0.5.0 - * @param {Record} cookie cookie - * @param {string} schedule_type 1: 本期, 2: 上期 + * @since Beta v0.6.1 + * @param {TGApp.App.Account.Cookie} cookie cookie + * @param {string} schedule 1: 本期, 2: 上期 * @param {TGApp.Sqlite.Account.Game} account 游戏账号 * @returns {Promise} */ export async function getAbyss( - cookie: Record, - schedule_type: string, + cookie: TGApp.App.Account.Cookie, + schedule: string, account: TGApp.Sqlite.Account.Game, ): Promise { const url = TGApi.GameData.getAbyss; - const role_id = account.gameUid; - const params = { role_id, schedule_type, server: account.region }; - const header = TGUtils.User.getHeader(cookie, "GET", params, "common"); + const params = { role_id: account.gameUid, schedule_type: schedule, server: account.region }; + const ck = { + account_id: cookie.account_id, + cookie_token: cookie.cookie_token, + ltoken: cookie.ltoken, + ltuid: cookie.ltuid, + }; + const header = TGUtils.User.getHeader(ck, "GET", params, "common"); const resp = await TGHttp(url, { method: "GET", headers: header,