🐛 上传深渊记录时更新角色列表,以修复511001异常

This commit is contained in:
BTMuli
2026-01-16 19:21:08 +08:00
parent 5715030114
commit 00381a092e
6 changed files with 964 additions and 902 deletions

View File

@@ -72,15 +72,15 @@
"dependencies": {
"@date-fns/tz": "^1.4.1",
"@mdi/font": "7.4.47",
"@sentry/vite-plugin": "^4.6.1",
"@sentry/vue": "^10.33.0",
"@sentry/vite-plugin": "^4.6.2",
"@sentry/vue": "^10.34.0",
"@skipperndt/plugin-machine-uid": "^0.1.3",
"@tauri-apps/api": "^2.9.1",
"@tauri-apps/plugin-cli": "^2.4.1",
"@tauri-apps/plugin-deep-link": "^2.4.6",
"@tauri-apps/plugin-dialog": "^2.5.0",
"@tauri-apps/plugin-dialog": "^2.6.0",
"@tauri-apps/plugin-fs": "^2.4.5",
"@tauri-apps/plugin-http": "^2.5.5",
"@tauri-apps/plugin-http": "^2.5.6",
"@tauri-apps/plugin-log": "^2.8.0",
"@tauri-apps/plugin-notification": "^2.3.3",
"@tauri-apps/plugin-opener": "^2.5.3",
@@ -115,14 +115,14 @@
"@eslint/eslintrc": "^3.3.3",
"@eslint/js": "^9.39.2",
"@microsoft/tsdoc": "^0.16.0",
"@sentry/core": "^10.33.0",
"@sentry/core": "^10.34.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.8",
"@types/node": "^25.0.9",
"@typescript-eslint/parser": "^8.53.0",
"@typescript/native-preview": "7.0.0-dev.20260113.1",
"@typescript/native-preview": "7.0.0-dev.20260116.1",
"@vitejs/plugin-vue": "^6.0.3",
"app-root-path": "^3.1.0",
"concurrently": "^9.2.1",
@@ -130,9 +130,9 @@
"eslint": "^9.39.2",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsonc": "^2.21.0",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-prettier": "^5.5.5",
"eslint-plugin-tsdoc": "^0.5.0",
"eslint-plugin-vue": "^10.6.2",
"eslint-plugin-vue": "^10.7.0",
"eslint-plugin-yml": "^1.19.1",
"fs-extra": "^11.3.3",
"globals": "^17.0.0",
@@ -140,17 +140,17 @@
"jsonc-eslint-parser": "^2.4.2",
"lint-staged": "^16.2.7",
"oxlint": "^1.39.0",
"postcss-preset-env": "^10.6.1",
"prettier": "3.7.4",
"stylelint": "^16.26.1",
"postcss-preset-env": "^11.1.1",
"prettier": "3.8.0",
"stylelint": "^17.0.0",
"stylelint-config-idiomatic-order": "^10.0.0",
"stylelint-config-standard-scss": "^16.0.0",
"stylelint-config-standard-scss": "^17.0.0",
"stylelint-config-standard-vue": "^1.0.0",
"stylelint-declaration-block-no-ignored-properties": "^2.8.0",
"stylelint-high-performance-animation": "^1.11.0",
"stylelint-order": "^7.0.1",
"stylelint-prettier": "^5.0.3",
"stylelint-scss": "^6.14.0",
"stylelint-scss": "^7.0.0",
"tsx": "^4.21.0",
"typescript": "^5.9.3",
"typescript-eslint": "^8.53.0",

1679
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

107
src-tauri/Cargo.lock generated
View File

@@ -949,9 +949,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]]
name = "chrono"
version = "0.4.42"
version = "0.4.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2"
checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118"
dependencies = [
"iana-time-zone",
"js-sys",
@@ -2760,8 +2760,8 @@ dependencies = [
"rayon",
"rgb",
"tiff",
"zune-core 0.5.0",
"zune-jpeg 0.5.8",
"zune-core 0.5.1",
"zune-jpeg 0.5.9",
]
[[package]]
@@ -2942,9 +2942,9 @@ dependencies = [
[[package]]
name = "js-sys"
version = "0.3.83"
version = "0.3.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8"
checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3"
dependencies = [
"once_cell",
"wasm-bindgen",
@@ -4539,7 +4539,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
dependencies = [
"rand_chacha 0.9.0",
"rand_core 0.9.4",
"rand_core 0.9.5",
]
[[package]]
@@ -4569,7 +4569,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
dependencies = [
"ppv-lite86",
"rand_core 0.9.4",
"rand_core 0.9.5",
]
[[package]]
@@ -4592,9 +4592,9 @@ dependencies = [
[[package]]
name = "rand_core"
version = "0.9.4"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f1b3bc831f92381018fd9c6350b917c7b21f1eed35a65a51900e0e55a3d7afa"
checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"
dependencies = [
"getrandom 0.3.4",
]
@@ -4941,9 +4941,9 @@ dependencies = [
[[package]]
name = "rust_decimal"
version = "1.39.0"
version = "1.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35affe401787a9bd846712274d97654355d21b2a2c092a3139aabe31e9022282"
checksum = "61f703d19852dbf87cbc513643fa81428361eb6940f1ac14fd58155d295a3eb0"
dependencies = [
"arrayvec",
"borsh",
@@ -4957,9 +4957,9 @@ dependencies = [
[[package]]
name = "rustc-demangle"
version = "0.1.26"
version = "0.1.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace"
checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d"
[[package]]
name = "rustc-hash"
@@ -5005,9 +5005,9 @@ dependencies = [
[[package]]
name = "rustls-pki-types"
version = "1.13.2"
version = "1.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21e6f2ab2928ca4291b86736a8bd920a277a399bba1589409d72154ff87c1282"
checksum = "4910321ebe4151be888e35fe062169554e74aad01beafed60410131420ceffbc"
dependencies = [
"web-time",
"zeroize",
@@ -6226,7 +6226,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-cli"
version = "2.4.1"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#f3d75f7abb536ba70d1746801096af6d9be7f8b1"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#05c5da072b6e3254c19ee69024f80f4dfe1b779b"
dependencies = [
"clap",
"log",
@@ -6240,7 +6240,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-deep-link"
version = "2.4.6"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#f3d75f7abb536ba70d1746801096af6d9be7f8b1"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#05c5da072b6e3254c19ee69024f80f4dfe1b779b"
dependencies = [
"dunce",
"plist",
@@ -6259,8 +6259,8 @@ dependencies = [
[[package]]
name = "tauri-plugin-dialog"
version = "2.5.0"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#f3d75f7abb536ba70d1746801096af6d9be7f8b1"
version = "2.6.0"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#05c5da072b6e3254c19ee69024f80f4dfe1b779b"
dependencies = [
"log",
"raw-window-handle",
@@ -6277,7 +6277,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-fs"
version = "2.4.5"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#f3d75f7abb536ba70d1746801096af6d9be7f8b1"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#05c5da072b6e3254c19ee69024f80f4dfe1b779b"
dependencies = [
"anyhow",
"dunce",
@@ -6297,8 +6297,8 @@ dependencies = [
[[package]]
name = "tauri-plugin-http"
version = "2.5.5"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#f3d75f7abb536ba70d1746801096af6d9be7f8b1"
version = "2.5.6"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#05c5da072b6e3254c19ee69024f80f4dfe1b779b"
dependencies = [
"bytes",
"cookie_store 0.21.1",
@@ -6321,7 +6321,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-log"
version = "2.8.0"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#f3d75f7abb536ba70d1746801096af6d9be7f8b1"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#05c5da072b6e3254c19ee69024f80f4dfe1b779b"
dependencies = [
"android_logger",
"byte-unit",
@@ -6357,7 +6357,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-notification"
version = "2.3.3"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#f3d75f7abb536ba70d1746801096af6d9be7f8b1"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#05c5da072b6e3254c19ee69024f80f4dfe1b779b"
dependencies = [
"log",
"notify-rust",
@@ -6375,7 +6375,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-opener"
version = "2.5.3"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#f3d75f7abb536ba70d1746801096af6d9be7f8b1"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#05c5da072b6e3254c19ee69024f80f4dfe1b779b"
dependencies = [
"dunce",
"glob",
@@ -6396,7 +6396,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-os"
version = "2.3.2"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#f3d75f7abb536ba70d1746801096af6d9be7f8b1"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#05c5da072b6e3254c19ee69024f80f4dfe1b779b"
dependencies = [
"gethostname",
"log",
@@ -6413,7 +6413,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-process"
version = "2.3.1"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#f3d75f7abb536ba70d1746801096af6d9be7f8b1"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#05c5da072b6e3254c19ee69024f80f4dfe1b779b"
dependencies = [
"tauri",
"tauri-plugin",
@@ -6422,7 +6422,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-single-instance"
version = "2.3.7"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#f3d75f7abb536ba70d1746801096af6d9be7f8b1"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#05c5da072b6e3254c19ee69024f80f4dfe1b779b"
dependencies = [
"serde",
"serde_json",
@@ -6436,7 +6436,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-sql"
version = "2.3.1"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#f3d75f7abb536ba70d1746801096af6d9be7f8b1"
source = "git+ssh://git@github.com/tauri-apps/plugins-workspace.git?branch=v2#05c5da072b6e3254c19ee69024f80f4dfe1b779b"
dependencies = [
"futures-core",
"indexmap 2.13.0",
@@ -7309,9 +7309,9 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
[[package]]
name = "wasip2"
version = "1.0.1+wasi-0.2.4"
version = "1.0.2+wasi-0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7"
checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
dependencies = [
"wit-bindgen",
]
@@ -7324,9 +7324,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b"
[[package]]
name = "wasm-bindgen"
version = "0.2.106"
version = "0.2.108"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd"
checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566"
dependencies = [
"cfg-if",
"once_cell",
@@ -7337,11 +7337,12 @@ dependencies = [
[[package]]
name = "wasm-bindgen-futures"
version = "0.4.56"
version = "0.4.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c"
checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f"
dependencies = [
"cfg-if",
"futures-util",
"js-sys",
"once_cell",
"wasm-bindgen",
@@ -7350,9 +7351,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.106"
version = "0.2.108"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3"
checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -7360,9 +7361,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.106"
version = "0.2.108"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40"
checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55"
dependencies = [
"bumpalo",
"proc-macro2",
@@ -7373,9 +7374,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.106"
version = "0.2.108"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4"
checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12"
dependencies = [
"unicode-ident",
]
@@ -7395,9 +7396,9 @@ dependencies = [
[[package]]
name = "web-sys"
version = "0.3.83"
version = "0.3.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac"
checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598"
dependencies = [
"js-sys",
"wasm-bindgen",
@@ -8085,9 +8086,9 @@ dependencies = [
[[package]]
name = "wit-bindgen"
version = "0.46.0"
version = "0.51.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59"
checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
[[package]]
name = "writeable"
@@ -8342,9 +8343,9 @@ dependencies = [
[[package]]
name = "zmij"
version = "1.0.13"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac93432f5b761b22864c774aac244fa5c0fd877678a4c37ebf6cf42208f9c9ec"
checksum = "bd8f3f50b848df28f887acb68e41201b5aea6bc8a8dacc00fb40635ff9a72fea"
[[package]]
name = "zune-core"
@@ -8354,9 +8355,9 @@ checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a"
[[package]]
name = "zune-core"
version = "0.5.0"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "111f7d9820f05fd715df3144e254d6fc02ee4088b0644c0ffd0efc9e6d9d2773"
checksum = "cb8a0807f7c01457d0379ba880ba6322660448ddebc890ce29bb64da71fb40f9"
[[package]]
name = "zune-inflate"
@@ -8378,11 +8379,11 @@ dependencies = [
[[package]]
name = "zune-jpeg"
version = "0.5.8"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e35aee689668bf9bd6f6f3a6c60bb29ba1244b3b43adfd50edd554a371da37d5"
checksum = "87c86acb70a85b2c16f071f171847d1945e8f44812630463cd14ec83900ad01c"
dependencies = [
"zune-core 0.5.0",
"zune-core 0.5.1",
]
[[package]]

View File

@@ -20,7 +20,7 @@ crate-type = ["staticlib", "cdylib", "rlib"]
tauri-build = { version = "2.5.3", features = [] }
[dependencies]
chrono = "0.4.42"
chrono = "0.4.43"
image = "0.25.9"
log = "0.4.29"
prost = "=0.14.1"

View File

@@ -146,7 +146,7 @@ const router = useRouter();
const hutaoStore = useHutaoStore();
const { isLogin } = storeToRefs(useAppStore());
const { account, cookie } = storeToRefs(useUserStore());
const { account, cookie, propMap } = storeToRefs(useUserStore());
const { userName } = storeToRefs(hutaoStore);
const userTab = ref<number>(0);
const version = ref<string>();
@@ -342,6 +342,10 @@ async function uploadAbyss(): Promise<void> {
const check = await showDialog.check("确定上传?", "未设置胡桃云账号");
if (!check) return;
}
if (!cookie.value) {
showSnackbar.warn("请登录米社账号");
return;
}
await TGLogger.Info("[UserAbyss][uploadAbyss] 上传深渊数据");
const maxId = Math.max(...localAbyss.value.map((i) => i.id));
const abyssData = localAbyss.value.find((item) => item.id === maxId);
@@ -368,7 +372,8 @@ async function uploadAbyss(): Promise<void> {
await showLoading.start(`正在上传${account.value.gameUid}的深渊数据`, `期数:${abyssData.id}`);
const transAbyss = hutao.Abyss.utils.transData(abyssData);
if (userName.value) transAbyss.ReservedUserName = userName.value;
await showLoading.update("正在获取角色数据");
const check = await refreshAvatars(cookie.value, account.value);
if (!check) return;
const roles = await TSUserAvatar.getAvatars(Number(account.value.gameUid));
if (!roles) {
await showLoading.end();
@@ -378,6 +383,7 @@ async function uploadAbyss(): Promise<void> {
await showLoading.update("正在转换角色数据");
transAbyss.Avatars = hutao.Abyss.utils.transAvatars(roles);
await showLoading.update("正在上传深渊数据");
console.log("uploadAbyss", transAbyss);
const res = await hutao.Abyss.upload(transAbyss);
if (res.retcode !== 0) {
showSnackbar.error(`[${res.retcode}]${res.message}`);
@@ -397,6 +403,44 @@ async function uploadAbyss(): Promise<void> {
}
await showLoading.end();
}
async function refreshAvatars(
ck: TGApp.App.Account.Cookie,
ac: TGApp.Sqlite.Account.Game,
): Promise<boolean> {
await showLoading.update("正在更新角色数据");
const idxRes = await recordReq.index(ck, ac, 1);
if ("retcode" in idxRes) {
await showLoading.update("角色更新失败");
showSnackbar.error(`[${idxRes.retcode}] ${idxRes.message}`);
await TGLogger.Error(JSON.stringify(idxRes));
await showLoading.end();
return false;
}
await showLoading.update("正在更新角色列表");
const listRes = await recordReq.character.list(ck, account.value);
if ("retcode" in listRes) {
await showLoading.update("角色列表更新失败");
showSnackbar.error(`[${listRes.message}] ${listRes.message}`);
await TGLogger.Error(JSON.stringify(listRes));
await showLoading.end();
return false;
}
const idList = listRes.map((i) => i.id.toString());
await showLoading.update(`正在获取 ${idList.length} 个角色详情`);
const detailRes = await recordReq.character.detail(ck, ac, idList);
if ("retcode" in detailRes) {
await showLoading.update("角色详情获取失败");
showSnackbar.error(`[${detailRes.retcode}] ${detailRes.message}`);
await TGLogger.Error(JSON.stringify(detailRes));
await showLoading.end();
return false;
}
propMap.value = detailRes.property_map;
await showLoading.update("正在保存角色数据");
await TSUserAvatar.saveAvatars(ac.gameUid, detailRes.list);
return true;
}
</script>
<style lang="css" scoped>
.uat-left {

View File

@@ -418,7 +418,7 @@ async function refresh(): Promise<void> {
const indexRes = await recordReq.index(cookie.value, account.value, 1);
if ("retcode" in indexRes) {
showSnackbar.error(`[${indexRes.retcode}] ${indexRes.message}`);
await TGLogger.Error(JSON.stringify(indexRes.message));
await TGLogger.Error(JSON.stringify(indexRes));
await showLoading.end();
loadData.value = false;
return;