mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-29 06:09:45 +08:00
🎨 记录所有账号但只显示原神
This commit is contained in:
@@ -441,7 +441,8 @@ async function showAccounts(): Promise<void> {
|
||||
showSnackbar.warn("未登录!");
|
||||
return;
|
||||
}
|
||||
gameAccounts.value = await TSUserAccount.game.getAccount(uid.value);
|
||||
const accountsGet = await TSUserAccount.game.getAccount(uid.value);
|
||||
gameAccounts.value = accountsGet.filter((a) => a.gameBiz === "hk4e_cn");
|
||||
if (gameAccounts.value.length === 0) {
|
||||
showSnackbar.warn("未找到账户的游戏数据,请尝试刷新!");
|
||||
return;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file store/modules/user.ts
|
||||
* @description 用户信息模块
|
||||
* @since Beta v0.6.8
|
||||
* @since Beta v0.7.2
|
||||
*/
|
||||
|
||||
import showSnackbar from "@comp/func/snackbar.js";
|
||||
@@ -52,7 +52,7 @@ export const useUserStore = defineStore(
|
||||
return false;
|
||||
}
|
||||
const gameAccounts = await TSUserAccount.game.getAccount(uid.value);
|
||||
const accountFind = gameAccounts.find((a) => a.gameUid === uidG);
|
||||
const accountFind = gameAccounts.find((a) => a.gameUid === uidG && a.gameBiz === "hk4e_cn");
|
||||
if (!accountFind) {
|
||||
showSnackbar.warn("未找到账户绑定的游戏账户");
|
||||
return false;
|
||||
|
||||
@@ -135,13 +135,11 @@ async function getUserGameRolesByCookie(
|
||||
cookie: TGApp.App.Account.Cookie,
|
||||
): Promise<Array<TGApp.BBS.Game.Account> | TGApp.BBS.Response.Base> {
|
||||
const ck = { account_id: cookie.account_id, cookie_token: cookie.cookie_token };
|
||||
const params = { game_biz: "hk4e_cn" };
|
||||
const resp = await TGHttp<TGApp.BBS.Game.AccountResp>(
|
||||
`${taBu}binding/api/getUserGameRolesByCookie`,
|
||||
{
|
||||
method: "GET",
|
||||
headers: getRequestHeader(ck, "GET", params),
|
||||
query: params,
|
||||
headers: getRequestHeader(ck, "GET", {}),
|
||||
},
|
||||
);
|
||||
if (resp.retcode !== 0) return <TGApp.BBS.Response.Base>resp;
|
||||
|
||||
Reference in New Issue
Block a user