✏️ TakumiApi → takumiReq

This commit is contained in:
目棃
2025-03-09 21:48:39 +08:00
parent e6904e14b5
commit 804b735e95
4 changed files with 11 additions and 11 deletions

View File

@@ -132,7 +132,7 @@ import TGLogger from "@/utils/TGLogger.js";
import BBSApi from "@/web/request/bbsReq.js";
import PassportApi from "@/web/request/passportReq.js";
import passportReq from "@/web/request/passportReq.js";
import TakumiApi from "@/web/request/takumiReq.js";
import takumiReq from "@/web/request/takumiReq.js";
const { isLogin } = storeToRefs(useAppStore());
const { uid, briefInfo, cookie, account } = storeToRefs(useUserStore());
@@ -201,7 +201,7 @@ async function tryGetTokens(ck: TGApp.App.Account.Cookie): Promise<void> {
cookie.value = ck;
isLogin.value = true;
await showLoading.update("正在获取游戏账号");
const gameRes = await TakumiApi.bind.gameRoles(cookie.value);
const gameRes = await takumiReq.bind.gameRoles(cookie.value);
if (!Array.isArray(gameRes)) {
await showLoading.end();
showSnackbar.error(`[${gameRes.retcode}]${gameRes.message}`);
@@ -328,7 +328,7 @@ async function refreshUser(uid: string) {
}
await TSUserAccount.account.saveAccount(account);
await showLoading.update("正在获取账号信息");
const accountRes = await TakumiApi.bind.gameRoles(ck);
const accountRes = await takumiReq.bind.gameRoles(ck);
if (Array.isArray(accountRes)) {
await showLoading.update("获取账号信息成功");
await TGLogger.Info("[tc-userBadge][refreshUserInfo] 获取账号信息成功");
@@ -522,7 +522,7 @@ async function addByCookie(): Promise<void> {
updated: "",
});
await showLoading.update("正在获取游戏账号");
const gameRes = await TakumiApi.bind.gameRoles(ck);
const gameRes = await takumiReq.bind.gameRoles(ck);
if (!Array.isArray(gameRes)) {
await showLoading.end();
showSnackbar.error(`[${gameRes.retcode}]${gameRes.message}`);

View File

@@ -67,7 +67,7 @@ import { useUserStore } from "@/store/modules/user.js";
import TGLogger from "@/utils/TGLogger.js";
import { exportUigfData, readUigfData, verifyUigfData } from "@/utils/UIGF.js";
import Hk4eApi from "@/web/request/hk4eReq.js";
import TakumiApi from "@/web/request/takumiReq.js";
import takumiReq from "@/web/request/takumiReq.js";
const { account, cookie } = storeToRefs(useUserStore());
const authkey = ref<string>("");
@@ -139,7 +139,7 @@ async function confirmRefresh(force: boolean): Promise<void> {
}
}
await showLoading.start(`正在刷新祈愿数据`, `UID:${account.value.gameUid},正在获取 authkey`);
const authkeyRes = await TakumiApi.bind.authKey(cookie.value, account.value);
const authkeyRes = await takumiReq.bind.authKey(cookie.value, account.value);
if (typeof authkeyRes === "string") {
authkey.value = authkeyRes;
await TGLogger.Info(`[UserGacha][${account.value.gameUid}][confirmRefresh] 成功获取 authkey`);

View File

@@ -20,7 +20,7 @@ import TGBbs from "@/utils/TGBbs.js";
import BBSApi from "@/web/request/bbsReq.js";
import OtherApi from "@/web/request/otherReq.js";
import PassportApi from "@/web/request/passportReq.js";
import TakumiApi from "@/web/request/takumiReq.js";
import takumiReq from "@/web/request/takumiReq.js";
import { getDS4JS } from "@/web/utils/getRequestHeader.js";
// invoke 参数
@@ -509,7 +509,7 @@ class Client {
const userStore = useUserStore();
if (!userStore.cookie) return;
const cookie = { mid: userStore.cookie.mid, stoken: userStore.cookie.stoken };
const res = await TakumiApi.bind.authKey2(cookie, arg.payload);
const res = await takumiReq.bind.authKey2(cookie, arg.payload);
await this.callback(arg.callback, res.data);
}
@@ -525,7 +525,7 @@ class Client {
): Promise<void> {
const userStore = useUserStore();
if (!userStore.cookie) return;
const ActionTicket = await TakumiApi.auth.actionTicket(
const ActionTicket = await takumiReq.auth.actionTicket(
userStore.cookie,
userStore.account,
arg.payload.action_type,

View File

@@ -206,11 +206,11 @@ async function getObcHomePosition(): Promise<
return DfsObc(data);
}
const TakumiApi = {
const takumiReq = {
auth: { actionTicket: getActionTicketBySToken },
bind: { authKey: genAuthKey, authKey2: genAuthKey2, gameRoles: getUserGameRolesByCookie },
game: { stoken: getSTokenByGameToken },
obc: { gacha: getObcGachaPool, position: getObcHomePosition },
};
export default TakumiApi;
export default takumiReq;