diff --git a/backend/api/dp.py b/backend/api/dp.py index 455dde29..2c510003 100644 --- a/backend/api/dp.py +++ b/backend/api/dp.py @@ -16,7 +16,7 @@ SessionDep = Annotated[Session, Depends(get_db)] RedisDep = Annotated[Redis, Depends(get_redis)] -def alterToken(redis:RedisDep,alter_token: str | None = Header(None)): +def alterToken(redis: RedisDep, alter_token: str | None = Header(None)): if alter_token is not None: try: decoded_bytes = base64.b64decode(alter_token) @@ -25,8 +25,8 @@ def alterToken(redis:RedisDep,alter_token: str | None = Header(None)): # 6小时过期 if (int(time.time() * 1000) - alter['time']) / (60 * 60 * 1000) > 6: raise ResponseException('登录过期或无效Token,请刷新后重试') - alterData = get_redis_info(redis, f'dcalc:adventure:{alter['alter']}', lambda : get_adv_info(alter['alter'])) - return AlterState(alterData["class"], alter_token, {}, alter['equVersion'], alter['time']) + alterData = get_redis_info(redis, f'dcalc:adventure:{alter["alter"]}', lambda: get_adv_info(alter['alter'])) + return AlterState(alterData['class'], alter_token, {}, alter.get('equVersion', '0'), alter['time']) except (base64.binascii.Error, json.JSONDecodeError): raise ResponseException('登录过期或无效Token,请刷新后重试') else: diff --git a/frontendNew/README.md b/frontendNew/README.md index f54076a8..cac12aea 100644 --- a/frontendNew/README.md +++ b/frontendNew/README.md @@ -2,6 +2,28 @@ This template should help get you started developing with Vue 3 in Vite. +## Migration Status (frontend -> frontendNew) + +- UI library baseline: shadcn-vue + Tailwind v4 +- Routing migrated: + - `/home` + - `/dcalc/dnfhelper` + - `/character/:alter/(equipment|skill|forge)` +- Migrated pages: + - `src/pages/Home/Index.vue` + - `src/pages/Dcalc/DnfHelper/*` + - `src/pages/Character/Index.vue` + - `src/pages/Character/EquipmentDictionary/Index.vue` + - `src/pages/Character/Skill/index.vue` + - `src/pages/Character/Forge/index.vue` + +## Next Migration Steps + +- Migrate `frontend/src/pages/Character/Equipment/components/*` into shadcn-vue filter + picker panels. +- Migrate `frontend/src/pages/Character/Result/*` with Card/Item-based result layout and baseline compare blocks. +- Migrate `frontend/src/pages/Character/Config/import*.vue` into dialog/sheet flows in `frontendNew`. +- Replace placeholder summary blocks in Forge with interactive editors for avatar, emblem, jade, oath. + ## Recommended IDE Setup [VS Code](https://code.visualstudio.com/) + [Vue (Official)](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). diff --git a/frontendNew/index.html b/frontendNew/index.html index 9e5fc8f0..5f8c16d7 100644 --- a/frontendNew/index.html +++ b/frontendNew/index.html @@ -1,10 +1,10 @@ - + - - - - Vite App + + + + DNF Tools
diff --git a/frontendNew/package.json b/frontendNew/package.json index 60f04adb..833cfa98 100644 --- a/frontendNew/package.json +++ b/frontendNew/package.json @@ -21,6 +21,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-vue-next": "^1.0.0", + "pako": "^2.1.0", "pinia": "^3.0.4", "reka-ui": "^2.9.6", "shadcn-vue": "^2.6.2", @@ -34,6 +35,7 @@ "devDependencies": { "@tsconfig/node24": "^24.0.4", "@types/node": "^24.12.2", + "@types/pako": "^2.0.4", "@vitejs/plugin-vue": "^6.0.6", "@vitejs/plugin-vue-jsx": "^5.1.5", "@vue/eslint-config-typescript": "^14.7.0", diff --git a/frontendNew/pnpm-lock.yaml b/frontendNew/pnpm-lock.yaml index fa663277..dcaa33c2 100644 --- a/frontendNew/pnpm-lock.yaml +++ b/frontendNew/pnpm-lock.yaml @@ -26,6 +26,9 @@ importers: lucide-vue-next: specifier: ^1.0.0 version: 1.0.0(vue@3.5.33(typescript@6.0.3)) + pako: + specifier: ^2.1.0 + version: 2.1.0 pinia: specifier: ^3.0.4 version: 3.0.4(typescript@6.0.3)(vue@3.5.33(typescript@6.0.3)) @@ -60,6 +63,9 @@ importers: '@types/node': specifier: ^24.12.2 version: 24.12.2 + '@types/pako': + specifier: ^2.0.4 + version: 2.0.4 '@vitejs/plugin-vue': specifier: ^6.0.6 version: 6.0.6(vite@8.0.10(@types/node@24.12.2)(jiti@2.6.1)(stylus@0.57.0)(yaml@2.8.4))(vue@3.5.33(typescript@6.0.3)) @@ -474,56 +480,48 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - libc: [glibc] '@oxfmt/binding-linux-arm64-musl@0.45.0': resolution: {integrity: sha512-XQKXZIKYJC3GQJ8FnD3iMntpw69Wd9kDDK/Xt79p6xnFYlGGxSNv2vIBvRTDg5CKByWFWWZLCRDOXoP/m6YN4g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - libc: [musl] '@oxfmt/binding-linux-ppc64-gnu@0.45.0': resolution: {integrity: sha512-+g5RiG+xOkdrCWkKodv407nTvMq4vYM18Uox2MhZBm/YoqFxxJpWKsloskFFG5NU13HGPw1wzYjjOVcyd9moCA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] - libc: [glibc] '@oxfmt/binding-linux-riscv64-gnu@0.45.0': resolution: {integrity: sha512-V7dXKoSyEbWAkkSF4JJNtF+NJZDmJoSarSoP30WCsB3X636Rehd3CvxBj49FIJxEBFWhvcUjGSHVeU8Erck1bQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] - libc: [glibc] '@oxfmt/binding-linux-riscv64-musl@0.45.0': resolution: {integrity: sha512-Vdelft1sAEYojVGgcODEFXSWYQYlIvoyIGWebKCuUibd1tvS1TjTx413xG2ZLuHpYj45CkN/ztMLMX6jrgqpgg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] - libc: [musl] '@oxfmt/binding-linux-s390x-gnu@0.45.0': resolution: {integrity: sha512-RR7xKgNpqwENnK0aYCGYg0JycY2n93J0reNjHyes+I9Gq52dH95x+CBlnlAQHCPfz6FGnKA9HirgUl14WO6o7w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] - libc: [glibc] '@oxfmt/binding-linux-x64-gnu@0.45.0': resolution: {integrity: sha512-U/QQ0+BQNSHxjuXR/utvXnQ50Vu5kUuqEomZvQ1/3mhgbBiMc2WU9q5kZ5WwLp3gnFIx9ibkveoRSe2EZubkqg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - libc: [glibc] '@oxfmt/binding-linux-x64-musl@0.45.0': resolution: {integrity: sha512-o5TLOUCF0RWQjsIS06yVC+kFgp092/yLe6qBGSUvtnmTVw9gxjpdQSXc3VN5Cnive4K11HNstEZF8ROKHfDFSw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - libc: [musl] '@oxfmt/binding-openharmony-arm64@0.45.0': resolution: {integrity: sha512-RnGcV3HgPuOjsGx/k9oyRNKmOp+NBLGzZTdPDYbc19r7NGeYPplnUU/BfU35bX2Y/O4ejvHxcfkvW2WoYL/gsg==} @@ -596,56 +594,48 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - libc: [glibc] '@oxlint/binding-linux-arm64-musl@1.60.0': resolution: {integrity: sha512-eDYDXZGhQAXyn6GwtwiX/qcLS0HlOLPJ/+iiIY8RYr+3P8oKBmgKxADLlniL6FtWfE7pPk7IGN9/xvDEvDvFeg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - libc: [musl] '@oxlint/binding-linux-ppc64-gnu@1.60.0': resolution: {integrity: sha512-nxehly5XYBHUWI9VJX1bqCf9j/B43DaK/aS/T1fcxCpX3PA4Rm9BB54nPD1CKayT8xg6REN1ao+01hSRNgy8OA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] - libc: [glibc] '@oxlint/binding-linux-riscv64-gnu@1.60.0': resolution: {integrity: sha512-j1qf/NaUfOWQutjeoooNG1Q0zsK0XGmSu1uDLq3cctquRF3j7t9Hxqf/76ehCc5GEUAanth2W4Fa+XT1RFg/nw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] - libc: [glibc] '@oxlint/binding-linux-riscv64-musl@1.60.0': resolution: {integrity: sha512-YELKPRefQ/q/h3RUmeRfPCUhh2wBvgV1RyZ/F9M9u8cDyXsQW2ojv1DeWQTt466yczDITjZnIOg/s05pk7Ve2A==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] - libc: [musl] '@oxlint/binding-linux-s390x-gnu@1.60.0': resolution: {integrity: sha512-JkO3C6Gki7Y6h/MiIkFKvHFOz98/YWvQ4WYbK9DLXACMP2rjULzkeGyAzorJE5S1dzLQGFgeqvN779kSFwoV1g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] - libc: [glibc] '@oxlint/binding-linux-x64-gnu@1.60.0': resolution: {integrity: sha512-XjKHdFVCpZZZSWBCKyyqCq65s2AKXykMXkjLoKYODrD+f5toLhlwsMESscu8FbgnJQ4Y/dpR/zdazsahmgBJIA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - libc: [glibc] '@oxlint/binding-linux-x64-musl@1.60.0': resolution: {integrity: sha512-js29ZWIuPhNWzY8NC7KoffEMEeWG105vbmm+8EOJsC+T/jHBiKIJEUF78+F/IrgEWMMP9N0kRND4Pp75+xAhKg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - libc: [musl] '@oxlint/binding-openharmony-arm64@1.60.0': resolution: {integrity: sha512-H+PUITKHk04stFpWj3x3Kg08Afp/bcXSBi0EhasR5a0Vw7StXHTzdl655PUI0fB4qdh2Wsu6Dsi+3ACxPoyQnA==} @@ -709,42 +699,36 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - libc: [glibc] '@rolldown/binding-linux-arm64-musl@1.0.0-rc.17': resolution: {integrity: sha512-b/CgbwAJpmrRLp02RPfhbudf5tZnN9nsPWK82znefso832etkem8H7FSZwxrOI9djcdTP7U6YfNhbRnh7djErg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - libc: [musl] '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.17': resolution: {integrity: sha512-4EII1iNGRUN5WwGbF/kOh/EIkoDN9HsupgLQoXfY+D1oyJm7/F4t5PYU5n8SWZgG0FEwakyM8pGgwcBYruGTlA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] - libc: [glibc] '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.17': resolution: {integrity: sha512-AH8oq3XqQo4IibpVXvPeLDI5pzkpYn0WiZAfT05kFzoJ6tQNzwRdDYQ45M8I/gslbodRZwW8uxLhbSBbkv96rA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] - libc: [glibc] '@rolldown/binding-linux-x64-gnu@1.0.0-rc.17': resolution: {integrity: sha512-cLnjV3xfo7KslbU41Z7z8BH/E1y5mzUYzAqih1d1MDaIGZRCMqTijqLv76/P7fyHuvUcfGsIpqCdddbxLLK9rA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - libc: [glibc] '@rolldown/binding-linux-x64-musl@1.0.0-rc.17': resolution: {integrity: sha512-0phclDw1spsL7dUB37sIARuis2tAgomCJXAHZlpt8PXZ4Ba0dRP1e+66lsRqrfhISeN9bEGNjQs+T/Fbd7oYGw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - libc: [musl] '@rolldown/binding-openharmony-arm64@1.0.0-rc.17': resolution: {integrity: sha512-0ag/hEgXOwgw4t8QyQvUCxvEg+V0KBcA6YuOx9g0r02MprutRF5dyljgm3EmR02O292UX7UeS6HzWHAl6KgyhA==} @@ -819,28 +803,24 @@ packages: engines: {node: '>= 20'} cpu: [arm64] os: [linux] - libc: [glibc] '@tailwindcss/oxide-linux-arm64-musl@4.2.4': resolution: {integrity: sha512-bBADEGAbo4ASnppIziaQJelekCxdMaxisrk+fB7Thit72IBnALp9K6ffA2G4ruj90G9XRS2VQ6q2bCKbfFV82g==} engines: {node: '>= 20'} cpu: [arm64] os: [linux] - libc: [musl] '@tailwindcss/oxide-linux-x64-gnu@4.2.4': resolution: {integrity: sha512-7Mx25E4WTfnht0TVRTyC00j3i0M+EeFe7wguMDTlX4mRxafznw0CA8WJkFjWYH5BlgELd1kSjuU2JiPnNZbJDA==} engines: {node: '>= 20'} cpu: [x64] os: [linux] - libc: [glibc] '@tailwindcss/oxide-linux-x64-musl@4.2.4': resolution: {integrity: sha512-2wwJRF7nyhOR0hhHoChc04xngV3iS+akccHTGtz965FwF0up4b2lOdo6kI1EbDaEXKgvcrFBYcYQQ/rrnWFVfA==} engines: {node: '>= 20'} cpu: [x64] os: [linux] - libc: [musl] '@tailwindcss/oxide-wasm32-wasi@4.2.4': resolution: {integrity: sha512-FQsqApeor8Fo6gUEklzmaa9994orJZZDBAlQpK2Mq+DslRKFJeD6AjHpBQ0kZFQohVr8o85PPh8eOy86VlSCmw==} @@ -904,6 +884,9 @@ packages: '@types/node@24.12.2': resolution: {integrity: sha512-A1sre26ke7HDIuY/M23nd9gfB+nrmhtYyMINbjI1zHJxYteKR6qSMX56FsmjMcDb3SMcjJg5BiRRgOCC/yBD0g==} + '@types/pako@2.0.4': + resolution: {integrity: sha512-VWDCbrLeVXJM9fihYodcLiIv0ku+AlOa/TQ1SvYOaBuyrSKgEcro95LJyIsJ4vSo6BXIxOKxiJAat04CmST9Fw==} + '@types/web-bluetooth@0.0.21': resolution: {integrity: sha512-oIQLCGWtcFZy2JW77j9k8nHzAOpqMHLQejDA48XXMWH6tjCQHz5RCFz1bzsmROyL6PUm+LLnUiI4BCn221inxA==} @@ -2051,28 +2034,24 @@ packages: engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] - libc: [glibc] lightningcss-linux-arm64-musl@1.32.0: resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] - libc: [musl] lightningcss-linux-x64-gnu@1.32.0: resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] - libc: [glibc] lightningcss-linux-x64-musl@1.32.0: resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] - libc: [musl] lightningcss-win32-arm64-msvc@1.32.0: resolution: {integrity: sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==} @@ -2336,6 +2315,9 @@ packages: package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} + pako@2.1.0: + resolution: {integrity: sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==} + parseurl@1.3.3: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} engines: {node: '>= 0.8'} @@ -3702,6 +3684,8 @@ snapshots: dependencies: undici-types: 7.16.0 + '@types/pako@2.0.4': {} + '@types/web-bluetooth@0.0.21': {} '@typescript-eslint/eslint-plugin@8.59.1(@typescript-eslint/parser@8.59.1(eslint@10.3.0(jiti@2.6.1))(typescript@6.0.3))(eslint@10.3.0(jiti@2.6.1))(typescript@6.0.3)': @@ -5188,6 +5172,8 @@ snapshots: package-json-from-dist@1.0.1: {} + pako@2.1.0: {} + parseurl@1.3.3: {} path-browserify@1.0.1: {} diff --git a/frontendNew/public/favicon.ico b/frontendNew/public/favicon.ico old mode 100644 new mode 100755 index df36fcfb..b4863d47 Binary files a/frontendNew/public/favicon.ico and b/frontendNew/public/favicon.ico differ diff --git a/frontendNew/src/App.vue b/frontendNew/src/App.vue new file mode 100644 index 00000000..98240aef --- /dev/null +++ b/frontendNew/src/App.vue @@ -0,0 +1,3 @@ + diff --git a/frontendNew/src/api/common.ts b/frontendNew/src/api/common.ts index c37d22af..dc7ee5ba 100644 --- a/frontendNew/src/api/common.ts +++ b/frontendNew/src/api/common.ts @@ -1,7 +1,7 @@ import type { AxiosInstance, AxiosResponse } from "axios"; import axios from "axios"; import { h } from "vue"; -// import { gzip, ungzip } from 'pako' +import { ungzip } from "pako"; import { useInfoStore } from "@/stores"; // import { useDialog } from '@/components/hooks/dialog' // import { useAppStore, useConfigStore } from '@/store' diff --git a/frontendNew/src/api/info/index.ts b/frontendNew/src/api/info/index.ts index 1798c4d0..297c3ff3 100644 --- a/frontendNew/src/api/info/index.ts +++ b/frontendNew/src/api/info/index.ts @@ -33,6 +33,7 @@ export default defineRequest((request) => { }, async getHelperList(id: string) { const res = await request.get(`/dnfhelper/${id}/list`); + await new Promise((resolve) => setTimeout(resolve, 10000)); return res.data; }, }; diff --git a/frontendNew/src/components/AppNavBar.vue b/frontendNew/src/components/AppNavBar.vue new file mode 100644 index 00000000..8a9ae951 --- /dev/null +++ b/frontendNew/src/components/AppNavBar.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/frontendNew/src/components/AppSidebar.vue b/frontendNew/src/components/AppSidebar.vue index c857c6a1..318e42a4 100644 --- a/frontendNew/src/components/AppSidebar.vue +++ b/frontendNew/src/components/AppSidebar.vue @@ -5,7 +5,6 @@ import type { SidebarProps } from "@/components/ui/sidebar"; import { BookOpen, Bot, - Command, // Frame, LifeBuoy, // Map, @@ -58,78 +57,19 @@ const data = { navMain: [ { title: "计算器", - url: "#", + url: "/dcalc/dnfhelper", icon: Bot, - isActive: true, - onClick: () => { - console.log("Playground clicked"); - }, }, { - title: "名望数据", - url: "#", - icon: SquareTerminal, - // items: [ - // { - // title: "Genesis", - // url: "#", - // }, - // { - // title: "Explorer", - // url: "#", - // }, - // { - // title: "Quantum", - // url: "#", - // }, - // ], - }, - { - title: "职业数据", - url: "#", + title: "技能数据", + url: "/dcalc/character/swordman_male/skill", icon: BookOpen, - // items: [ - // { - // title: "Introduction", - // url: "#", - // }, - // { - // title: "Get Started", - // url: "#", - // }, - // { - // title: "Tutorials", - // url: "#", - // }, - // { - // title: "Changelog", - // url: "#", - // }, - // ], }, - // { - // title: "Settings", - // url: "#", - // icon: Settings2, - // items: [ - // { - // title: "General", - // url: "#", - // }, - // { - // title: "Team", - // url: "#", - // }, - // { - // title: "Billing", - // url: "#", - // }, - // { - // title: "Limits", - // url: "#", - // }, - // ], - // }, + { + title: "装备词典", + url: "/dcalc/character/swordman_male/equipment", + icon: SquareTerminal, + }, ], navSecondary: [ { @@ -171,11 +111,7 @@ const data = {
-
- -
+ DNF Tools
DNF Tools DNF工具集 diff --git a/frontendNew/src/components/DcalcBreadcrumb.vue b/frontendNew/src/components/DcalcBreadcrumb.vue new file mode 100644 index 00000000..4af08e89 --- /dev/null +++ b/frontendNew/src/components/DcalcBreadcrumb.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/frontendNew/src/components/NavMain.vue b/frontendNew/src/components/NavMain.vue index fa584002..97caf587 100644 --- a/frontendNew/src/components/NavMain.vue +++ b/frontendNew/src/components/NavMain.vue @@ -1,6 +1,7 @@