mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-28 05:59:46 +08:00
🩹 修复 ESLint 代码规范错误
This commit is contained in:
@@ -5,15 +5,15 @@
|
||||
v-for="navItem in nav"
|
||||
:key="navItem.id"
|
||||
:label="navItem.name"
|
||||
:mini
|
||||
:mini="true"
|
||||
class="tgn-nav"
|
||||
@click="toNav(navItem)"
|
||||
>
|
||||
<template #icon>
|
||||
<TMiImg :size="28" :ori="true" :src="navItem.icon" alt="navIcon" />
|
||||
<TMiImg :ori="true" :size="28" :src="navItem.icon" alt="navIcon" />
|
||||
</template>
|
||||
</TGameNavItem>
|
||||
<TGameNavItem v-if="hasNav" :mini class="tgn-nav" label="兑换码">
|
||||
<TGameNavItem v-if="hasNav" :mini="true" class="tgn-nav" label="兑换码">
|
||||
<template #icon>
|
||||
<v-icon v-if="!loadCode" color="var(--tgc-od-orange)" size="28" @click="tryGetCode">
|
||||
mdi-code-tags-check
|
||||
@@ -74,7 +74,7 @@ watch(
|
||||
async function loadNav(): Promise<void> {
|
||||
try {
|
||||
nav.value = await ApiHubReq.home(props.gid);
|
||||
console.debug(`[TGameNav][loadNav] 组件数据:`, nav.value);
|
||||
console.warn(`[TGameNav][loadNav] 组件数据:`, nav.value);
|
||||
if (loadCode.value) loadCode.value = false;
|
||||
} catch (e) {
|
||||
await TGLogger.Error(`[TGameNav][loadNav] 加载组件数据失败:${e}`);
|
||||
|
||||
@@ -45,13 +45,12 @@ const progressColor = computed<string>(() => {
|
||||
return "#61afef";
|
||||
});
|
||||
const progressWidth = computed<string>(() => {
|
||||
let final = 10;
|
||||
if (props.data.rank === "5") {
|
||||
if (props.data.gachaType === "2000") final = 80;
|
||||
else final = 90;
|
||||
} else if (props.data.rank === "4") final = 10;
|
||||
else return "0%";
|
||||
return ((props.count / final) * 100).toFixed(2) + "%";
|
||||
if (props.data.gachaType === "2000") return ((props.count / 80) * 100).toFixed(2) + "%";
|
||||
return ((props.count / 90) * 100).toFixed(2) + "%";
|
||||
}
|
||||
if (props.data.rank === "4") return ((props.count / 10) * 100).toFixed(2) + "%";
|
||||
return "0%";
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -48,13 +48,12 @@ const progressColor = computed<string>(() => {
|
||||
return "#61afef";
|
||||
});
|
||||
const progressWidth = computed<string>(() => {
|
||||
let final = 10;
|
||||
if (props.data.rank === "5") {
|
||||
if (props.data.gachaType === "302") final = 80;
|
||||
else final = 90;
|
||||
} else if (props.data.rank === "4") final = 10;
|
||||
else return "0%";
|
||||
return ((props.count / final) * 100).toFixed(2) + "%";
|
||||
if (props.data.gachaType === "302") return ((props.count / 80) * 100).toFixed(2) + "%";
|
||||
return ((props.count / 90) * 100).toFixed(2) + "%";
|
||||
}
|
||||
if (props.data.rank === "4") return ((props.count / 10) * 100).toFixed(2) + "%";
|
||||
return "0%";
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -365,28 +365,24 @@ async function uploadAbyss(): Promise<void> {
|
||||
await TGLogger.Warn("[Abyss][uploadAbyss] 非最新深渊数据");
|
||||
return;
|
||||
}
|
||||
let upAccount = account.value;
|
||||
let upCk = cookie.value;
|
||||
const gcFind = await TSUserAccount.game.getAccountByGid(uidCur.value!.toString());
|
||||
console.log(uidCur.value, gcFind);
|
||||
if (!gcFind) {
|
||||
showSnackbar.warn(`未找到 ${uidCur.value} 对应 UID,无法刷新角色数据进行上传`);
|
||||
return;
|
||||
}
|
||||
upAccount = gcFind;
|
||||
const acFind = await TSUserAccount.account.getAccount(gcFind.uid);
|
||||
if (!acFind) {
|
||||
showSnackbar.warn(`未找到 ${uidCur.value} 对应 CK,无法刷新角色数据进行上传`);
|
||||
return;
|
||||
}
|
||||
upCk = acFind.cookie;
|
||||
try {
|
||||
await showLoading.start(`正在上传 ${upAccount.gameUid} 的深渊数据`, `期数:${abyssData.id}`);
|
||||
await showLoading.start(`正在上传 ${gcFind.gameUid} 的深渊数据`, `期数:${abyssData.id}`);
|
||||
const transAbyss = hutao.Abyss.utils.transData(abyssData);
|
||||
if (userName.value) transAbyss.ReservedUserName = userName.value;
|
||||
const check = await refreshAvatars(upCk!, upAccount);
|
||||
const check = await refreshAvatars(acFind.cookie!, gcFind);
|
||||
if (!check) return;
|
||||
const roles = await TSUserAvatar.getAvatars(Number(upAccount.gameUid));
|
||||
const roles = await TSUserAvatar.getAvatars(Number(gcFind.gameUid));
|
||||
if (!roles) {
|
||||
await showLoading.end();
|
||||
showSnackbar.warn("未找到角色数据");
|
||||
|
||||
@@ -302,29 +302,25 @@ async function refreshCombat(): Promise<void> {
|
||||
}
|
||||
|
||||
async function loadCharMaster(): Promise<void> {
|
||||
let cmAccount = account.value;
|
||||
let cmCk = cookie.value;
|
||||
const gcFind = await TSUserAccount.game.getAccountByGid(uidCur.value!.toString());
|
||||
console.log(uidCur.value, gcFind);
|
||||
if (!gcFind) {
|
||||
showSnackbar.warn(`未找到 ${uidCur.value} 对应 UID,无法获取对应游迹数据`);
|
||||
return;
|
||||
}
|
||||
cmAccount = gcFind;
|
||||
const acFind = await TSUserAccount.account.getAccount(gcFind.uid);
|
||||
if (!acFind) {
|
||||
showSnackbar.warn(`未找到 ${uidCur.value} 对应 CK,无法获取对应游迹数据`);
|
||||
return;
|
||||
}
|
||||
cmCk = acFind.cookie;
|
||||
await TGLogger.Info("[Combat][loadCharMaster] 获取绘想游迹数据");
|
||||
await showLoading.start(`正在获取${cmAccount.gameUid}的绘想游迹数据`);
|
||||
const res = await recordReq.combat.char(cmCk!, cmAccount);
|
||||
await showLoading.start(`正在获取${gcFind.gameUid}的绘想游迹数据`);
|
||||
const res = await recordReq.combat.char(acFind.cookie!, gcFind);
|
||||
console.log(res);
|
||||
if ("retcode" in res) {
|
||||
await showLoading.end();
|
||||
showSnackbar.error(`[${res.retcode}]${res.message}`);
|
||||
await TGLogger.Error(`[Combat][loadCharMaster] 获取${cmAccount.gameUid}的剧诗数据失败`);
|
||||
await TGLogger.Error(`[Combat][loadCharMaster] 获取${gcFind.gameUid}的剧诗数据失败`);
|
||||
await TGLogger.Error(`[Combat][loadCharMaster] ${res.retcode} ${res.message}`);
|
||||
return;
|
||||
}
|
||||
@@ -340,29 +336,25 @@ async function loadCharMaster(): Promise<void> {
|
||||
}
|
||||
|
||||
async function loadTarot(): Promise<void> {
|
||||
let trAccount = account.value;
|
||||
let trCk = cookie.value;
|
||||
const gcFind = await TSUserAccount.game.getAccountByGid(uidCur.value!.toString());
|
||||
console.log(uidCur.value, gcFind);
|
||||
if (!gcFind) {
|
||||
showSnackbar.warn(`未找到 ${uidCur.value} 对应 UID,无法获取对应圣牌数据`);
|
||||
return;
|
||||
}
|
||||
trAccount = gcFind;
|
||||
const acFind = await TSUserAccount.account.getAccount(gcFind.uid);
|
||||
if (!acFind) {
|
||||
showSnackbar.warn(`未找到 ${uidCur.value} 对应 CK,无法获取对应圣牌数据`);
|
||||
return;
|
||||
}
|
||||
trCk = acFind.cookie;
|
||||
await TGLogger.Info("[Combat][loadTarot] 获取月谕圣牌数据");
|
||||
await showLoading.start(`正在获取${trAccount.gameUid}的月谕圣牌数据`);
|
||||
const res = await recordReq.combat.base(trCk!, trAccount);
|
||||
await showLoading.start(`正在获取${gcFind.gameUid}的月谕圣牌数据`);
|
||||
const res = await recordReq.combat.base(acFind.cookie!, gcFind);
|
||||
console.log(res);
|
||||
if ("retcode" in res) {
|
||||
await showLoading.end();
|
||||
showSnackbar.error(`[${res.retcode}]${res.message}`);
|
||||
await TGLogger.Error(`[Combat][loadTarot] 获取${trAccount.gameUid}的月谕圣牌数据失败`);
|
||||
await TGLogger.Error(`[Combat][loadTarot] 获取${gcFind.gameUid}的月谕圣牌数据失败`);
|
||||
await TGLogger.Error(`[Combat][loadTarot] ${res.retcode} ${res.message}`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -331,9 +331,9 @@ function searchMaterial(): void {
|
||||
}
|
||||
|
||||
function handleUpdate(info: MaterialInfo): void {
|
||||
let find = materialList.value.find((i) => i.info.id === info.info.id);
|
||||
const find = materialList.value.find((i) => i.info.id === info.info.id);
|
||||
if (find !== undefined) {
|
||||
find = info;
|
||||
Object.assign(find, info);
|
||||
curMaterial.value = info;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,15 +59,14 @@ export async function tryReadGameVer(gameDir: string): Promise<false | string> {
|
||||
* @since Beta v0.9.1
|
||||
*/
|
||||
export async function isRunInAdmin(): Promise<boolean> {
|
||||
let isAdmin = false;
|
||||
try {
|
||||
isAdmin = await invoke<boolean>("is_in_admin");
|
||||
const isAdmin = await invoke<boolean>("is_in_admin");
|
||||
return isAdmin;
|
||||
} catch (err) {
|
||||
showSnackbar.error(`检测管理员权限失败:${err}`);
|
||||
await TGLogger.Error(`[TGGame][isRunInAdmin]检测管理员权限失败:${err}`);
|
||||
return false;
|
||||
}
|
||||
return isAdmin;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user