🐛 修复检测数据更新异常

This commit is contained in:
BTMuli
2026-01-14 12:39:39 +08:00
parent f2c5051a23
commit aaf30d0df5
4 changed files with 459 additions and 457 deletions

View File

@@ -46,8 +46,10 @@ jobs:
- name: Test SSH connection
run: ssh -T git@github.com || true
- name: Load env.production
id: env
run: |
echo "VITE_SENTRY_RELEASE=$(grep VITE_SENTRY_RELEASE .env.production | cut -d '=' -f2)" >> $GITHUB_ENV
VITE_SENTRY_RELEASE=$(awk -F= '/^VITE_SENTRY_RELEASE=/ {print $2}' .env.production)
echo "VITE_SENTRY_RELEASE=$VITE_SENTRY_RELEASE" >> $GITHUB_ENV
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
@@ -107,4 +109,4 @@ jobs:
sentry-cli releases finalize "$SENTRY_RELEASE"
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_RELEASE: ${{ env.VITE_SENTRY_RELEASE }}
SENTRY_RELEASE: ${{ steps.env.outputs.VITE_SENTRY_RELEASE }}

View File

@@ -73,7 +73,7 @@
"@date-fns/tz": "^1.4.1",
"@mdi/font": "7.4.47",
"@sentry/vite-plugin": "^4.6.1",
"@sentry/vue": "^10.32.1",
"@sentry/vue": "^10.33.0",
"@skipperndt/plugin-machine-uid": "^0.1.3",
"@tauri-apps/api": "^2.9.1",
"@tauri-apps/plugin-cli": "^2.4.1",
@@ -115,14 +115,14 @@
"@eslint/eslintrc": "^3.3.3",
"@eslint/js": "^9.39.2",
"@microsoft/tsdoc": "^0.16.0",
"@sentry/core": "^10.32.1",
"@sentry/core": "^10.33.0",
"@tauri-apps/cli": "2.9.6",
"@types/fs-extra": "^11.0.4",
"@types/js-md5": "^0.8.0",
"@types/json-bigint": "^1.0.4",
"@types/node": "^25.0.6",
"@typescript-eslint/parser": "^8.52.0",
"@typescript/native-preview": "7.0.0-dev.20260109.1",
"@types/node": "^25.0.8",
"@typescript-eslint/parser": "^8.53.0",
"@typescript/native-preview": "7.0.0-dev.20260113.1",
"@vitejs/plugin-vue": "^6.0.3",
"app-root-path": "^3.1.0",
"concurrently": "^9.2.1",
@@ -139,7 +139,7 @@
"husky": "^9.1.7",
"jsonc-eslint-parser": "^2.4.2",
"lint-staged": "^16.2.7",
"oxlint": "^1.38.0",
"oxlint": "^1.39.0",
"postcss-preset-env": "^10.6.1",
"prettier": "3.7.4",
"stylelint": "^16.26.1",
@@ -153,7 +153,7 @@
"stylelint-scss": "^6.14.0",
"tsx": "^4.21.0",
"typescript": "^5.9.3",
"typescript-eslint": "^8.52.0",
"typescript-eslint": "^8.53.0",
"vite": "npm:rolldown-vite@^7.3.1",
"vite-plugin-vue-devtools": "^8.0.5",
"vite-plugin-vuetify": "^2.1.2",

860
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -184,7 +184,7 @@ import { storeToRefs } from "pinia";
import { onMounted, ref, shallowRef, watch } from "vue";
import { useRouter } from "vue-router";
import { AppCalendarData, AppCharacterData, AppWeaponData } from "@/data/index.js";
import { AppCalendarData } from "@/data/index.js";
const router = useRouter();
const hutaoStore = useHutaoStore();
@@ -574,13 +574,9 @@ async function refreshGachaPool(
id: item.id.toString(),
uigf_gacha_type: item.gacha_type === "400" ? "301" : item.gacha_type,
};
if (item.item_type === "角色") {
const find = AppCharacterData.find((char) => char.name === item.name);
if (find) tempItem.item_id = find.id.toString();
} else if (item.item_type === "武器") {
const find = AppWeaponData.find((weapon) => weapon.name === item.name);
if (find) tempItem.item_id = find.id.toString();
}
// TODO: 如果有名字重复的需要注意
const find = AppCalendarData.find((i) => i.name === item.name);
if (find) tempItem.item_id = find.id.toString();
if (tempItem.item_id === "") {
if (hakushiData.value.length === 0) {
await showLoading.update(`未查找到 ${tempItem.name} 的 ItemId正在获取 Hakushi 数据`);
@@ -742,16 +738,28 @@ async function checkData(): Promise<void> {
await showLoading.start("正在检测数据", `UID:${uidCur.value},共${gachaListCur.value.length}`);
for (const data of gachaListCur.value) {
if (data.itemId === "") {
const find = hakushiData.value.find((i) => i.name === data.name && i.type === data.type);
// TODO: 如果有名字重复的需要注意
const find = AppCalendarData.find((i) => i.name === data.name);
if (find) {
await showLoading.update(`${data.name} -> ${find.id}`);
await TSUserGacha.update.itemId(data, find.id);
await TSUserGacha.update.itemId(data, find.id.toString());
cnt++;
} else {
await showLoading.update(`[${data.id}]${data.type}-${data.name}未找到ID`);
await TGLogger.Warn(`[${data.id}]${data.type}-${data.name}未找到ID`);
fail++;
continue;
}
if (hakushiData.value.length === 0) {
await showLoading.update(`尝试获取Hakushi数据`);
await loadHakushi();
}
const find2 = hakushiData.value.find((i) => i.name === data.name && i.type === data.type);
if (find2) {
await showLoading.update(`${data.name} -> ${find2.id}`);
await TSUserGacha.update.itemId(data, find2.id);
cnt++;
continue;
}
await showLoading.update(`[${data.id}]${data.type}-${data.name}未找到ID`);
await TGLogger.Warn(`[${data.id}]${data.type}-${data.name}未找到ID`);
fail++;
}
}
await showLoading.end();