mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
🎨 调整skippedFloor数据获取逻辑
This commit is contained in:
@@ -183,14 +183,8 @@ async function refreshAbyss(): Promise<void> {
|
||||
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<void> {
|
||||
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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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<string, string>} 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<TGApp.Game.Abyss.FullData|TGApp.BBS.Response.Base>}
|
||||
*/
|
||||
export async function getAbyss(
|
||||
cookie: Record<string, string>,
|
||||
schedule_type: string,
|
||||
cookie: TGApp.App.Account.Cookie,
|
||||
schedule: string,
|
||||
account: TGApp.Sqlite.Account.Game,
|
||||
): Promise<TGApp.Game.Abyss.FullData | TGApp.BBS.Response.Base> {
|
||||
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<TGApp.Game.Abyss.Response | TGApp.BBS.Response.Base>(url, {
|
||||
method: "GET",
|
||||
headers: header,
|
||||
|
||||
Reference in New Issue
Block a user