From 01b648a3e748bbb1e5cbbaf0985dbed3dc6daded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A5=BF=E7=93=9C=C2=B0?= Date: Tue, 5 May 2026 18:59:06 +0800 Subject: [PATCH] dev Co-authored-by: Copilot --- backend/api/routes/info.py | 9 +- backend/core/open/helper.py | 11 +- backend/openapi | 2 +- frontendNew/.eslintrc-auto-import.json | 312 ++++++++++++++++++ frontendNew/.oxlintrc.json | 1 + frontendNew/auto-imports.d.ts | 78 +++++ frontendNew/eslint.config.ts | 29 +- frontendNew/package.json | 2 + frontendNew/pnpm-lock.yaml | 178 ++++++++++ frontendNew/src/api/calc/index.ts | 12 + frontendNew/src/api/calc/type.ts | 56 ++++ frontendNew/src/api/common.ts | 119 +++++++ frontendNew/src/api/index.ts | 4 + frontendNew/src/api/info/index.ts | 39 +++ frontendNew/src/api/info/type.ts | 227 +++++++++++++ frontendNew/src/api/types.ts | 6 + frontendNew/src/components/OTPForm.vue | 37 +-- frontendNew/src/components/ui/card/Card.vue | 29 ++ .../src/components/ui/card/CardAction.vue | 17 + .../src/components/ui/card/CardContent.vue | 17 + .../components/ui/card/CardDescription.vue | 17 + .../src/components/ui/card/CardFooter.vue | 17 + .../src/components/ui/card/CardHeader.vue | 17 + .../src/components/ui/card/CardTitle.vue | 17 + frontendNew/src/components/ui/card/index.ts | 7 + .../components/ui/input-group/InputGroup.vue | 21 ++ .../ui/input-group/InputGroupAddon.vue | 36 ++ .../ui/input-group/InputGroupButton.vue | 22 ++ .../ui/input-group/InputGroupInput.vue | 19 ++ .../ui/input-group/InputGroupText.vue | 19 ++ .../ui/input-group/InputGroupTextarea.vue | 19 ++ .../src/components/ui/input-group/index.ts | 55 +++ frontendNew/src/components/ui/kbd/Kbd.vue | 17 + .../src/components/ui/kbd/KbdGroup.vue | 17 + frontendNew/src/components/ui/kbd/index.ts | 2 + .../src/components/ui/textarea/Textarea.vue | 28 ++ .../src/components/ui/textarea/index.ts | 1 + frontendNew/src/main.ts | 22 +- .../src/pages/Dcalc/DnfHelper/bind.vue | 76 +++++ .../src/pages/Dcalc/DnfHelper/index.vue | 18 + .../src/pages/Dcalc/DnfHelper/list.vue | 41 +++ frontendNew/src/{App.vue => pages/index.vue} | 9 +- frontendNew/src/router/index.ts | 15 +- frontendNew/src/stores/config.ts | 293 ++++++++++++++++ frontendNew/src/stores/counter.ts | 12 - frontendNew/src/stores/dnfhelper.ts | 31 ++ frontendNew/src/stores/index.ts | 6 + frontendNew/src/stores/info.ts | 194 +++++++++++ frontendNew/src/types/auto-imports.d.ts | 306 +++++++++++++++++ frontendNew/tsconfig.app.json | 5 +- frontendNew/tsconfig.node.json | 3 +- frontendNew/vite.config.ts | 33 +- 52 files changed, 2491 insertions(+), 89 deletions(-) create mode 100644 frontendNew/.eslintrc-auto-import.json create mode 100644 frontendNew/auto-imports.d.ts create mode 100644 frontendNew/src/api/calc/index.ts create mode 100644 frontendNew/src/api/calc/type.ts create mode 100644 frontendNew/src/api/common.ts create mode 100644 frontendNew/src/api/index.ts create mode 100644 frontendNew/src/api/info/index.ts create mode 100644 frontendNew/src/api/info/type.ts create mode 100644 frontendNew/src/api/types.ts create mode 100644 frontendNew/src/components/ui/card/Card.vue create mode 100644 frontendNew/src/components/ui/card/CardAction.vue create mode 100644 frontendNew/src/components/ui/card/CardContent.vue create mode 100644 frontendNew/src/components/ui/card/CardDescription.vue create mode 100644 frontendNew/src/components/ui/card/CardFooter.vue create mode 100644 frontendNew/src/components/ui/card/CardHeader.vue create mode 100644 frontendNew/src/components/ui/card/CardTitle.vue create mode 100644 frontendNew/src/components/ui/card/index.ts create mode 100644 frontendNew/src/components/ui/input-group/InputGroup.vue create mode 100644 frontendNew/src/components/ui/input-group/InputGroupAddon.vue create mode 100644 frontendNew/src/components/ui/input-group/InputGroupButton.vue create mode 100644 frontendNew/src/components/ui/input-group/InputGroupInput.vue create mode 100644 frontendNew/src/components/ui/input-group/InputGroupText.vue create mode 100644 frontendNew/src/components/ui/input-group/InputGroupTextarea.vue create mode 100644 frontendNew/src/components/ui/input-group/index.ts create mode 100644 frontendNew/src/components/ui/kbd/Kbd.vue create mode 100644 frontendNew/src/components/ui/kbd/KbdGroup.vue create mode 100644 frontendNew/src/components/ui/kbd/index.ts create mode 100644 frontendNew/src/components/ui/textarea/Textarea.vue create mode 100644 frontendNew/src/components/ui/textarea/index.ts create mode 100644 frontendNew/src/pages/Dcalc/DnfHelper/bind.vue create mode 100644 frontendNew/src/pages/Dcalc/DnfHelper/index.vue create mode 100644 frontendNew/src/pages/Dcalc/DnfHelper/list.vue rename frontendNew/src/{App.vue => pages/index.vue} (57%) create mode 100644 frontendNew/src/stores/config.ts delete mode 100644 frontendNew/src/stores/counter.ts create mode 100644 frontendNew/src/stores/dnfhelper.ts create mode 100644 frontendNew/src/stores/index.ts create mode 100644 frontendNew/src/stores/info.ts create mode 100644 frontendNew/src/types/auto-imports.d.ts diff --git a/backend/api/routes/info.py b/backend/api/routes/info.py index 5e546875..006088b8 100644 --- a/backend/api/routes/info.py +++ b/backend/api/routes/info.py @@ -10,7 +10,7 @@ from api.dp import RedisDep, AltersDep from core.basic.equipment import get_equipment from core.character.adventure import get_adv_list from core.basic.character import createCharacter -from core.open.helper import get_user_info_by_id +from core.open.helper import get_user_info_by_id, get_user_list_by_id from core.open.skillTree import get_skill_tree_info from api.core.exception import ResponseException @@ -115,6 +115,13 @@ async def get_skill_info(state: AltersDep, skillId: str, level: int, redis: Redi return response(data=skill_info) +@router.get('/dnfhelper/{uid}/list') +async def get_dnfhelper_list(uid: str, redis: RedisDep): + result = await get_user_list_by_id(uid) + return response(data=result) + # return response(code=500, message='Failed to fetch DNFHelper list', data=None) + + @router.get('/dnfhelper/{uid}/') async def get_info_by_dnfhelper(uid: str, state: AltersDep, redis: RedisDep): try: diff --git a/backend/core/open/helper.py b/backend/core/open/helper.py index d4f5c211..a67f4284 100644 --- a/backend/core/open/helper.py +++ b/backend/core/open/helper.py @@ -1,4 +1,4 @@ -from openapi.dnfhelper.public import get_main_user_info_by_id +from openapi.dnfhelper.public import get_main_user_info_by_id, get_user_list from core.basic.equipment import get_equipment from api.dp import AltersDep from api.core.exception import ResponseException @@ -77,6 +77,15 @@ job_mapping = { } +async def get_user_list_by_id(user_id: str): + # 通过OCR助手获取用户列表 + helper_list = await get_user_list(user_id) + if helper_list is None: + raise ResponseException('当前用户ID不存在或无公开角色,请确认后重试') + else: + return helper_list + + async def get_user_info_by_id(user_id: str, alter: AltersDep): if alter is None: raise ResponseException('登录过期或无效Token,请刷新后重试') diff --git a/backend/openapi b/backend/openapi index 4a72406b..2ec8a104 160000 --- a/backend/openapi +++ b/backend/openapi @@ -1 +1 @@ -Subproject commit 4a72406baacf9c36a8f80d3f6ebb56078a820f00 +Subproject commit 2ec8a1040d7ae12ea59e1a8a6d3aa2932337ff26 diff --git a/frontendNew/.eslintrc-auto-import.json b/frontendNew/.eslintrc-auto-import.json new file mode 100644 index 00000000..9b6fad5a --- /dev/null +++ b/frontendNew/.eslintrc-auto-import.json @@ -0,0 +1,312 @@ +{ + "globals": { + "Component": true, + "ComponentPublicInstance": true, + "ComputedRef": true, + "DirectiveBinding": true, + "EffectScope": true, + "ExtractDefaultPropTypes": true, + "ExtractPropTypes": true, + "ExtractPublicPropTypes": true, + "InjectionKey": true, + "MaybeRef": true, + "MaybeRefOrGetter": true, + "PropType": true, + "Ref": true, + "ShallowRef": true, + "Slot": true, + "Slots": true, + "VNode": true, + "WritableComputedRef": true, + "asyncComputed": true, + "autoResetRef": true, + "computed": true, + "computedAsync": true, + "computedEager": true, + "computedInject": true, + "computedWithControl": true, + "controlledComputed": true, + "controlledRef": true, + "createApp": true, + "createDisposableDirective": true, + "createEventHook": true, + "createGlobalState": true, + "createInjectionState": true, + "createReactiveFn": true, + "createRef": true, + "createReusableTemplate": true, + "createSharedComposable": true, + "createTemplatePromise": true, + "createUnrefFn": true, + "customRef": true, + "debouncedRef": true, + "debouncedWatch": true, + "defineAsyncComponent": true, + "defineComponent": true, + "eagerComputed": true, + "effectScope": true, + "extendRef": true, + "getCurrentInstance": true, + "getCurrentScope": true, + "getCurrentWatcher": true, + "h": true, + "ignorableWatch": true, + "inject": true, + "injectLocal": true, + "isDefined": true, + "isProxy": true, + "isReactive": true, + "isReadonly": true, + "isRef": true, + "isShallow": true, + "makeDestructurable": true, + "markRaw": true, + "nextTick": true, + "onActivated": true, + "onBeforeMount": true, + "onBeforeRouteLeave": true, + "onBeforeRouteUpdate": true, + "onBeforeUnmount": true, + "onBeforeUpdate": true, + "onClickOutside": true, + "onDeactivated": true, + "onElementRemoval": true, + "onErrorCaptured": true, + "onKeyStroke": true, + "onLongPress": true, + "onMounted": true, + "onRenderTracked": true, + "onRenderTriggered": true, + "onScopeDispose": true, + "onServerPrefetch": true, + "onStartTyping": true, + "onUnmounted": true, + "onUpdated": true, + "onWatcherCleanup": true, + "pausableWatch": true, + "provide": true, + "provideLocal": true, + "reactify": true, + "reactifyObject": true, + "reactive": true, + "reactiveComputed": true, + "reactiveOmit": true, + "reactivePick": true, + "readonly": true, + "ref": true, + "refAutoReset": true, + "refDebounced": true, + "refDefault": true, + "refManualReset": true, + "refThrottled": true, + "refWithControl": true, + "resolveComponent": true, + "shallowReactive": true, + "shallowReadonly": true, + "shallowRef": true, + "syncRef": true, + "syncRefs": true, + "templateRef": true, + "throttledRef": true, + "throttledWatch": true, + "toRaw": true, + "toReactive": true, + "toRef": true, + "toRefs": true, + "toValue": true, + "triggerRef": true, + "tryOnBeforeMount": true, + "tryOnBeforeUnmount": true, + "tryOnMounted": true, + "tryOnScopeDispose": true, + "tryOnUnmounted": true, + "unref": true, + "unrefElement": true, + "until": true, + "useActiveElement": true, + "useAnimate": true, + "useArrayDifference": true, + "useArrayEvery": true, + "useArrayFilter": true, + "useArrayFind": true, + "useArrayFindIndex": true, + "useArrayFindLast": true, + "useArrayIncludes": true, + "useArrayJoin": true, + "useArrayMap": true, + "useArrayReduce": true, + "useArraySome": true, + "useArrayUnique": true, + "useAsyncQueue": true, + "useAsyncState": true, + "useAttrs": true, + "useBase64": true, + "useBattery": true, + "useBluetooth": true, + "useBreakpoints": true, + "useBroadcastChannel": true, + "useBrowserLocation": true, + "useCached": true, + "useClipboard": true, + "useClipboardItems": true, + "useCloned": true, + "useColorMode": true, + "useConfirmDialog": true, + "useCountdown": true, + "useCounter": true, + "useCssModule": true, + "useCssSupports": true, + "useCssVar": true, + "useCssVars": true, + "useCurrentElement": true, + "useCycleList": true, + "useDark": true, + "useDateFormat": true, + "useDebounce": true, + "useDebounceFn": true, + "useDebouncedRefHistory": true, + "useDeviceMotion": true, + "useDeviceOrientation": true, + "useDevicePixelRatio": true, + "useDevicesList": true, + "useDisplayMedia": true, + "useDocumentVisibility": true, + "useDraggable": true, + "useDropZone": true, + "useElementBounding": true, + "useElementByPoint": true, + "useElementHover": true, + "useElementSize": true, + "useElementVisibility": true, + "useEventBus": true, + "useEventListener": true, + "useEventSource": true, + "useEyeDropper": true, + "useFavicon": true, + "useFetch": true, + "useFileDialog": true, + "useFileSystemAccess": true, + "useFocus": true, + "useFocusWithin": true, + "useFps": true, + "useFullscreen": true, + "useGamepad": true, + "useGeolocation": true, + "useId": true, + "useIdle": true, + "useImage": true, + "useInfiniteScroll": true, + "useIntersectionObserver": true, + "useInterval": true, + "useIntervalFn": true, + "useKeyModifier": true, + "useLastChanged": true, + "useLink": true, + "useLocalStorage": true, + "useMagicKeys": true, + "useManualRefHistory": true, + "useMediaControls": true, + "useMediaQuery": true, + "useMemoize": true, + "useMemory": true, + "useModel": true, + "useMounted": true, + "useMouse": true, + "useMouseInElement": true, + "useMousePressed": true, + "useMutationObserver": true, + "useNavigatorLanguage": true, + "useNetwork": true, + "useNow": true, + "useObjectUrl": true, + "useOffsetPagination": true, + "useOnline": true, + "usePageLeave": true, + "useParallax": true, + "useParentElement": true, + "usePerformanceObserver": true, + "usePermission": true, + "usePointer": true, + "usePointerLock": true, + "usePointerSwipe": true, + "usePreferredColorScheme": true, + "usePreferredContrast": true, + "usePreferredDark": true, + "usePreferredLanguages": true, + "usePreferredReducedMotion": true, + "usePreferredReducedTransparency": true, + "usePrevious": true, + "useRafFn": true, + "useRefHistory": true, + "useResizeObserver": true, + "useRoute": true, + "useRouter": true, + "useSSRWidth": true, + "useScreenOrientation": true, + "useScreenSafeArea": true, + "useScriptTag": true, + "useScroll": true, + "useScrollLock": true, + "useSessionStorage": true, + "useShare": true, + "useSlots": true, + "useSorted": true, + "useSpeechRecognition": true, + "useSpeechSynthesis": true, + "useStepper": true, + "useStorage": true, + "useStorageAsync": true, + "useStyleTag": true, + "useSupported": true, + "useSwipe": true, + "useTemplateRef": true, + "useTemplateRefsList": true, + "useTextDirection": true, + "useTextSelection": true, + "useTextareaAutosize": true, + "useThrottle": true, + "useThrottleFn": true, + "useThrottledRefHistory": true, + "useTimeAgo": true, + "useTimeAgoIntl": true, + "useTimeout": true, + "useTimeoutFn": true, + "useTimeoutPoll": true, + "useTimestamp": true, + "useTitle": true, + "useToNumber": true, + "useToString": true, + "useToggle": true, + "useTransition": true, + "useUrlSearchParams": true, + "useUserMedia": true, + "useVModel": true, + "useVModels": true, + "useVibrate": true, + "useVirtualList": true, + "useWakeLock": true, + "useWebNotification": true, + "useWebSocket": true, + "useWebWorker": true, + "useWebWorkerFn": true, + "useWindowFocus": true, + "useWindowScroll": true, + "useWindowSize": true, + "watch": true, + "watchArray": true, + "watchAtMost": true, + "watchDebounced": true, + "watchDeep": true, + "watchEffect": true, + "watchIgnorable": true, + "watchImmediate": true, + "watchOnce": true, + "watchPausable": true, + "watchPostEffect": true, + "watchSyncEffect": true, + "watchThrottled": true, + "watchTriggerable": true, + "watchWithFilter": true, + "whenever": true + } +} diff --git a/frontendNew/.oxlintrc.json b/frontendNew/.oxlintrc.json index d5648b96..6324e27b 100644 --- a/frontendNew/.oxlintrc.json +++ b/frontendNew/.oxlintrc.json @@ -7,4 +7,5 @@ "categories": { "correctness": "error" } + } diff --git a/frontendNew/auto-imports.d.ts b/frontendNew/auto-imports.d.ts new file mode 100644 index 00000000..72370df8 --- /dev/null +++ b/frontendNew/auto-imports.d.ts @@ -0,0 +1,78 @@ +/* eslint-disable */ +/* prettier-ignore */ +// @ts-nocheck +// noinspection JSUnusedGlobalSymbols +// Generated by unplugin-auto-import +// biome-ignore lint: disable +export {} +declare global { + const EffectScope: typeof import('vue').EffectScope + const computed: typeof import('vue').computed + const createApp: typeof import('vue').createApp + const customRef: typeof import('vue').customRef + const defineAsyncComponent: typeof import('vue').defineAsyncComponent + const defineComponent: typeof import('vue').defineComponent + const effectScope: typeof import('vue').effectScope + const getCurrentInstance: typeof import('vue').getCurrentInstance + const getCurrentScope: typeof import('vue').getCurrentScope + const getCurrentWatcher: typeof import('vue').getCurrentWatcher + const h: typeof import('vue').h + const inject: typeof import('vue').inject + const isProxy: typeof import('vue').isProxy + const isReactive: typeof import('vue').isReactive + const isReadonly: typeof import('vue').isReadonly + const isRef: typeof import('vue').isRef + const isShallow: typeof import('vue').isShallow + const markRaw: typeof import('vue').markRaw + const nextTick: typeof import('vue').nextTick + const onActivated: typeof import('vue').onActivated + const onBeforeMount: typeof import('vue').onBeforeMount + const onBeforeRouteLeave: typeof import('vue-router').onBeforeRouteLeave + const onBeforeRouteUpdate: typeof import('vue-router').onBeforeRouteUpdate + const onBeforeUnmount: typeof import('vue').onBeforeUnmount + const onBeforeUpdate: typeof import('vue').onBeforeUpdate + const onDeactivated: typeof import('vue').onDeactivated + const onErrorCaptured: typeof import('vue').onErrorCaptured + const onMounted: typeof import('vue').onMounted + const onRenderTracked: typeof import('vue').onRenderTracked + const onRenderTriggered: typeof import('vue').onRenderTriggered + const onScopeDispose: typeof import('vue').onScopeDispose + const onServerPrefetch: typeof import('vue').onServerPrefetch + const onUnmounted: typeof import('vue').onUnmounted + const onUpdated: typeof import('vue').onUpdated + const onWatcherCleanup: typeof import('vue').onWatcherCleanup + const provide: typeof import('vue').provide + const reactive: typeof import('vue').reactive + const readonly: typeof import('vue').readonly + const ref: typeof import('vue').ref + const resolveComponent: typeof import('vue').resolveComponent + const shallowReactive: typeof import('vue').shallowReactive + const shallowReadonly: typeof import('vue').shallowReadonly + const shallowRef: typeof import('vue').shallowRef + const toRaw: typeof import('vue').toRaw + const toRef: typeof import('vue').toRef + const toRefs: typeof import('vue').toRefs + const toValue: typeof import('vue').toValue + const triggerRef: typeof import('vue').triggerRef + const unref: typeof import('vue').unref + const useAttrs: typeof import('vue').useAttrs + const useCssModule: typeof import('vue').useCssModule + const useCssVars: typeof import('vue').useCssVars + const useId: typeof import('vue').useId + const useLink: typeof import('vue-router').useLink + const useModel: typeof import('vue').useModel + const useRoute: typeof import('vue-router').useRoute + const useRouter: typeof import('vue-router').useRouter + const useSlots: typeof import('vue').useSlots + const useTemplateRef: typeof import('vue').useTemplateRef + const watch: typeof import('vue').watch + const watchEffect: typeof import('vue').watchEffect + const watchPostEffect: typeof import('vue').watchPostEffect + const watchSyncEffect: typeof import('vue').watchSyncEffect +} +// for type re-export +declare global { + // @ts-ignore + export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, ShallowRef, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' + import('vue') +} diff --git a/frontendNew/eslint.config.ts b/frontendNew/eslint.config.ts index 89fdc89a..9cf6db94 100644 --- a/frontendNew/eslint.config.ts +++ b/frontendNew/eslint.config.ts @@ -1,8 +1,8 @@ -import { globalIgnores } from 'eslint/config' -import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript' -import pluginVue from 'eslint-plugin-vue' -import pluginOxlint from 'eslint-plugin-oxlint' -import skipFormatting from 'eslint-config-prettier/flat' +import { globalIgnores } from "eslint/config"; +import { defineConfigWithVueTs, vueTsConfigs } from "@vue/eslint-config-typescript"; +import pluginVue from "eslint-plugin-vue"; +import pluginOxlint from "eslint-plugin-oxlint"; +import skipFormatting from "eslint-config-prettier/flat"; // To allow more languages other than `ts` in `.vue` files, uncomment the following lines: // import { configureVueProject } from '@vue/eslint-config-typescript' @@ -11,16 +11,23 @@ import skipFormatting from 'eslint-config-prettier/flat' export default defineConfigWithVueTs( { - name: 'app/files-to-lint', - files: ['**/*.{vue,ts,mts,tsx}'], + name: "app/files-to-lint", + files: ["**/*.{vue,ts,mts,tsx}"], }, - globalIgnores(['**/dist/**', '**/dist-ssr/**', '**/coverage/**']), + globalIgnores(["**/dist/**", "**/dist-ssr/**", "**/coverage/**"]), - ...pluginVue.configs['flat/essential'], + ...pluginVue.configs["flat/essential"], vueTsConfigs.recommended, - ...pluginOxlint.buildFromOxlintConfigFile('.oxlintrc.json'), + ...pluginOxlint.buildFromOxlintConfigFile(".oxlintrc.json"), skipFormatting, -) + + { + name: "app/rules", + rules: { + "vue/multi-word-component-names": "off", + }, + }, +); diff --git a/frontendNew/package.json b/frontendNew/package.json index b07d30b4..60f04adb 100644 --- a/frontendNew/package.json +++ b/frontendNew/package.json @@ -17,6 +17,7 @@ "dependencies": { "@tailwindcss/vite": "^4.2.4", "@vueuse/core": "^14.3.0", + "axios": "^1.16.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-vue-next": "^1.0.0", @@ -46,6 +47,7 @@ "oxfmt": "^0.45.0", "oxlint": "~1.60.0", "typescript": "~6.0.0", + "unplugin-auto-import": "^21.0.0", "vite": "^8.0.8", "vite-plugin-vue-devtools": "^8.1.1", "vue-tsc": "^3.2.6" diff --git a/frontendNew/pnpm-lock.yaml b/frontendNew/pnpm-lock.yaml index cf9095cf..91bd5516 100644 --- a/frontendNew/pnpm-lock.yaml +++ b/frontendNew/pnpm-lock.yaml @@ -14,6 +14,9 @@ importers: '@vueuse/core': specifier: ^14.3.0 version: 14.3.0(vue@3.5.33(typescript@6.0.3)) + axios: + specifier: ^1.16.0 + version: 1.16.0 class-variance-authority: specifier: ^0.7.1 version: 0.7.1 @@ -96,6 +99,9 @@ importers: typescript: specifier: ~6.0.0 version: 6.0.3 + unplugin-auto-import: + specifier: ^21.0.0 + version: 21.0.0(@vueuse/core@14.3.0(vue@3.5.33(typescript@6.0.3))) vite: specifier: ^8.0.8 version: 8.0.10(@types/node@24.12.2)(jiti@2.6.1)(stylus@0.57.0)(yaml@2.8.4) @@ -1176,11 +1182,17 @@ packages: resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} engines: {node: '>=8'} + asynckit@0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + atob@2.1.2: resolution: {integrity: sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==} engines: {node: '>= 4.5.0'} hasBin: true + axios@1.16.0: + resolution: {integrity: sha512-6hp5CwvTPlN2A31g5dxnwAX0orzM7pmCRDLnZSX772mv8WDqICwFjowHuPs04Mc8deIld1+ejhtaMn5vp6b+1w==} + balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -1286,6 +1298,10 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + commander@11.1.0: resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} engines: {node: '>=16'} @@ -1407,6 +1423,10 @@ packages: defu@6.1.7: resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==} + delayed-stream@1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + depd@2.0.0: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} @@ -1487,6 +1507,10 @@ packages: resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} engines: {node: '>= 0.4'} + es-set-tostringtag@2.1.0: + resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} + engines: {node: '>= 0.4'} + escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} @@ -1498,6 +1522,10 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} + escape-string-regexp@5.0.0: + resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} + engines: {node: '>=12'} + eslint-config-prettier@10.1.8: resolution: {integrity: sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==} hasBin: true @@ -1564,6 +1592,9 @@ packages: estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} @@ -1651,10 +1682,23 @@ packages: flatted@3.4.2: resolution: {integrity: sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==} + follow-redirects@1.16.0: + resolution: {integrity: sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + foreground-child@3.3.1: resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} engines: {node: '>=14'} + form-data@4.0.5: + resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==} + engines: {node: '>= 6'} + forwarded@0.2.0: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} @@ -1750,6 +1794,10 @@ packages: resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} engines: {node: '>= 0.4'} + has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + hasown@2.0.3: resolution: {integrity: sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg==} engines: {node: '>= 0.4'} @@ -1890,6 +1938,9 @@ packages: js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + js-tokens@9.0.1: + resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} + jsesc@3.1.0: resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} engines: {node: '>=6'} @@ -2080,10 +2131,18 @@ packages: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} + mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + mime-db@1.54.0: resolution: {integrity: sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==} engines: {node: '>= 0.6'} + mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + mime-types@3.0.2: resolution: {integrity: sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==} engines: {node: '>=18'} @@ -2362,6 +2421,10 @@ packages: resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} engines: {node: '>= 0.10'} + proxy-from-env@2.1.0: + resolution: {integrity: sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==} + engines: {node: '>=10'} + punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -2573,6 +2636,9 @@ packages: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} + strip-literal@3.1.0: + resolution: {integrity: sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==} + stylus@0.57.0: resolution: {integrity: sha512-yOI6G8WYfr0q8v8rRvE91wbxFU+rJPo760Va4MF6K0I6BZjO4r+xSynkvyPBP9tV1CIEUeRsiidjIs2rzb1CnQ==} hasBin: true @@ -2684,6 +2750,10 @@ packages: resolution: {integrity: sha512-xXnp4kTyor2Zq+J1FfPI6Eq3ew5h6Vl0F/8d9XU5zZQf1tX9s2Su1/3PiMmUANFULpmksxkClamIZcaUqryHsQ==} engines: {node: '>=20.18.1'} + unimport@5.7.0: + resolution: {integrity: sha512-njnL6sp8lEA8QQbZrt+52p/g4X0rw3bnGGmUcJnt1jeG8+iiqO779aGz0PirCtydAIVcuTBRlJ52F0u46z309Q==} + engines: {node: '>=18.12.0'} + universalify@2.0.1: resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} engines: {node: '>= 10.0.0'} @@ -2692,10 +2762,26 @@ packages: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} + unplugin-auto-import@21.0.0: + resolution: {integrity: sha512-vWuC8SwqJmxZFYwPojhOhOXDb5xFhNNcEVb9K/RFkyk/3VnfaOjzitWN7v+8DEKpMjSsY2AEGXNgt6I0yQrhRQ==} + engines: {node: '>=20.19.0'} + peerDependencies: + '@nuxt/kit': ^4.0.0 + '@vueuse/core': '*' + peerDependenciesMeta: + '@nuxt/kit': + optional: true + '@vueuse/core': + optional: true + unplugin-utils@0.3.1: resolution: {integrity: sha512-5lWVjgi6vuHhJ526bI4nlCOmkCIF3nnfXkCMDeMJrtdvxTs6ZFCM8oNufGTsDbKv/tJ/xj8RpvXjRuPBZJuJog==} engines: {node: '>=20.19.0'} + unplugin@2.3.11: + resolution: {integrity: sha512-5uKD0nqiYVzlmCRs01Fhs2BdkEgBS3SAVP6ndrBsuK42iC2+JHyxM05Rm9G8+5mkmRtzMZGY8Ct5+mliZxU/Ww==} + engines: {node: '>=18.12.0'} + unplugin@3.0.0: resolution: {integrity: sha512-0Mqk3AT2TZCXWKdcoaufeXNukv2mTrEZExeXlHIOZXdqYoHHr4n51pymnwV8x2BOVxwXbK2HLlI7usrqMpycdg==} engines: {node: ^20.19.0 || >=22.12.0} @@ -4006,8 +4092,18 @@ snapshots: astral-regex@2.0.0: {} + asynckit@0.4.0: {} + atob@2.1.2: {} + axios@1.16.0: + dependencies: + follow-redirects: 1.16.0 + form-data: 4.0.5 + proxy-from-env: 2.1.0 + transitivePeerDependencies: + - debug + balanced-match@1.0.2: {} balanced-match@4.0.4: {} @@ -4118,6 +4214,10 @@ snapshots: color-name@1.1.4: {} + combined-stream@1.0.8: + dependencies: + delayed-stream: 1.0.0 + commander@11.1.0: {} commander@14.0.3: {} @@ -4202,6 +4302,8 @@ snapshots: defu@6.1.7: {} + delayed-stream@1.0.0: {} + depd@2.0.0: {} destr@2.0.5: {} @@ -4270,12 +4372,21 @@ snapshots: dependencies: es-errors: 1.3.0 + es-set-tostringtag@2.1.0: + dependencies: + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + has-tostringtag: 1.0.2 + hasown: 2.0.3 + escalade@3.2.0: {} escape-html@1.0.3: {} escape-string-regexp@4.0.0: {} + escape-string-regexp@5.0.0: {} + eslint-config-prettier@10.1.8(eslint@10.3.0(jiti@2.6.1)): dependencies: eslint: 10.3.0(jiti@2.6.1) @@ -4364,6 +4475,10 @@ snapshots: estree-walker@2.0.2: {} + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.8 + esutils@2.0.3: {} etag@1.8.1: {} @@ -4483,11 +4598,21 @@ snapshots: flatted@3.4.2: {} + follow-redirects@1.16.0: {} + foreground-child@3.3.1: dependencies: cross-spawn: 7.0.6 signal-exit: 4.1.0 + form-data@4.0.5: + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + es-set-tostringtag: 2.1.0 + hasown: 2.0.3 + mime-types: 2.1.35 + forwarded@0.2.0: {} fresh@2.0.0: {} @@ -4577,6 +4702,10 @@ snapshots: has-symbols@1.1.0: {} + has-tostringtag@1.0.2: + dependencies: + has-symbols: 1.1.0 + hasown@2.0.3: dependencies: function-bind: 1.1.2 @@ -4675,6 +4804,8 @@ snapshots: js-tokens@4.0.0: {} + js-tokens@9.0.1: {} + jsesc@3.1.0: {} json-buffer@3.0.1: {} @@ -4823,8 +4954,14 @@ snapshots: braces: 3.0.3 picomatch: 2.3.2 + mime-db@1.52.0: {} + mime-db@1.54.0: {} + mime-types@2.1.35: + dependencies: + mime-db: 1.52.0 + mime-types@3.0.2: dependencies: mime-db: 1.54.0 @@ -5121,6 +5258,8 @@ snapshots: forwarded: 0.2.0 ipaddr.js: 1.9.1 + proxy-from-env@2.1.0: {} + punycode@2.3.1: {} qs@6.15.1: @@ -5409,6 +5548,10 @@ snapshots: strip-final-newline@2.0.0: {} + strip-literal@3.1.0: + dependencies: + js-tokens: 9.0.1 + stylus@0.57.0: dependencies: css: 3.0.0 @@ -5513,15 +5656,50 @@ snapshots: undici@7.25.0: {} + unimport@5.7.0: + dependencies: + acorn: 8.16.0 + escape-string-regexp: 5.0.0 + estree-walker: 3.0.3 + local-pkg: 1.1.2 + magic-string: 0.30.21 + mlly: 1.8.2 + pathe: 2.0.3 + picomatch: 4.0.4 + pkg-types: 2.3.1 + scule: 1.3.0 + strip-literal: 3.1.0 + tinyglobby: 0.2.16 + unplugin: 2.3.11 + unplugin-utils: 0.3.1 + universalify@2.0.1: {} unpipe@1.0.0: {} + unplugin-auto-import@21.0.0(@vueuse/core@14.3.0(vue@3.5.33(typescript@6.0.3))): + dependencies: + local-pkg: 1.1.2 + magic-string: 0.30.21 + picomatch: 4.0.4 + unimport: 5.7.0 + unplugin: 2.3.11 + unplugin-utils: 0.3.1 + optionalDependencies: + '@vueuse/core': 14.3.0(vue@3.5.33(typescript@6.0.3)) + unplugin-utils@0.3.1: dependencies: pathe: 2.0.3 picomatch: 4.0.4 + unplugin@2.3.11: + dependencies: + '@jridgewell/remapping': 2.3.5 + acorn: 8.16.0 + picomatch: 4.0.4 + webpack-virtual-modules: 0.6.2 + unplugin@3.0.0: dependencies: '@jridgewell/remapping': 2.3.5 diff --git a/frontendNew/src/api/calc/index.ts b/frontendNew/src/api/calc/index.ts new file mode 100644 index 00000000..622a3663 --- /dev/null +++ b/frontendNew/src/api/calc/index.ts @@ -0,0 +1,12 @@ +import type { IConfig } from '@/stores' +import { defineRequest } from '../common' +import type { IResult } from './type' +export default defineRequest((request) => { + return { + async calc(config: IConfig) { + const res = await request.post('/calc', config) + return res.data + }, + } +}) +// Compare this snippet from frontend/src/api/common/index.ts: diff --git a/frontendNew/src/api/calc/type.ts b/frontendNew/src/api/calc/type.ts new file mode 100644 index 00000000..6a8a673b --- /dev/null +++ b/frontendNew/src/api/calc/type.ts @@ -0,0 +1,56 @@ +export interface IResult { + uuid: string + skills: IResultSkill[] + info: IResultUserInfo[] + suits: { + suit?: IResultSuit + oath?: IResultSuit + correction?: number + } + buffer: boolean +} + +export interface IResultSkill { + name: string + icon: string + lv: number + data: number + ratio: number + cd: number + damage: number + mode: string + buff: number[] + learnLv: number + type: string +} + +export interface IResultUserInfo { + id: number + name: string + value: string | number +} + +export interface IResultSuit { + id: string + count: number + imageUrl: string + level: number + name: string + point: number + rarity: string + value: string + suitId: string + skills: { + id: string + skillId: string + name: string + imageUrl: string + enable: boolean + }[] +} + +export interface IResultSkillCount { + count: number + mode: string + name: string +} diff --git a/frontendNew/src/api/common.ts b/frontendNew/src/api/common.ts new file mode 100644 index 00000000..c37d22af --- /dev/null +++ b/frontendNew/src/api/common.ts @@ -0,0 +1,119 @@ +import type { AxiosInstance, AxiosResponse } from "axios"; +import axios from "axios"; +import { h } from "vue"; +// import { gzip, ungzip } from 'pako' +import { useInfoStore } from "@/stores"; +// import { useDialog } from '@/components/hooks/dialog' +// import { useAppStore, useConfigStore } from '@/store' +// import { useDialog } from '@/components/hooks/dialog' + +export interface HttpResponse extends AxiosResponse { + code?: number; + message: string; + data: T; + state?: number; +} + +let instance: AxiosInstance | null = null; + +let baseURL = "/api"; + +// 避免远程开发的时候冲突 +if (import.meta.env.MODE == "development") { + baseURL = "http://127.0.0.1:47173/api"; +} + +if (import.meta.env.MODE == "web" || import.meta.env.MODE == "show") { + baseURL = "https://api.dnftools.com/"; +} + +if (import.meta.env.MODE == "test") { + baseURL = "https://testapi.dnftools.com/"; +} + +// 解压 +function unzip(key: string) { + // 将二进制字符串转换为字符数组 + + const charData = key.split("").map((x) => { + return x?.charCodeAt(0); + }); + + // 将数字数组转换成字节数组 + const binData = new Uint8Array(charData); + + // 解压 + const data = ungzip(binData); + + const decoder = new TextDecoder(); + const str = decoder.decode(data); + + // unescape(str) --->解压后解码,防止中午乱码 + return str; +} + +export function defineRequest(fn: (ax: AxiosInstance) => T) { + if (!instance) { + instance = axios.create({ + baseURL, + }); + + instance.interceptors.request.use( + (request) => { + // const configStore = useConfigStore() + // const token = configStore.token + // const uid = useAppStore().uid + + const token = useInfoStore().alter_token; + + if (token) { + request.headers["Alter-Token"] = token; + } + + return request; + }, + (error) => { + // do something + return Promise.reject(error); + }, + ); + + instance.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8"; + // instance.defaults.headers["Accept-Encoding"] = "gzip" + // instance.defaults.headers["Content-Encoding"] = "gzip" + // add response interceptors + instance.interceptors.response.use( + async (response: AxiosResponse) => { + if (response.data.code === 500) { + // const { alert } = useDialog() + // await alert({ + // content: () => { + // return h( + // 'div', + // { + // class: 'justify-center text-#d4d6b6 text-center', + // style: 'white-space:pre-wrap;width:250px;margin:10px', + // }, + // `出现错误,可加群反馈:183439472\n${response.data.message}`, + // ) + // }, + // }) + console.error(response.data.message); + } + // 解密数据 + if (typeof response.data.data == "string") { + try { + const data = unzip(atob(response.data.data as string)); + response.data.data = JSON.parse(data); + } catch (e) {} + } + return response.data; + }, + async (error: Error) => { + return Promise.reject(error); + }, + ); + } + + return fn(Object.create(instance)); +} diff --git a/frontendNew/src/api/index.ts b/frontendNew/src/api/index.ts new file mode 100644 index 00000000..c97be7d7 --- /dev/null +++ b/frontendNew/src/api/index.ts @@ -0,0 +1,4 @@ +import info from './info' +import calc from './calc' + +export default { ...info, ...calc } diff --git a/frontendNew/src/api/info/index.ts b/frontendNew/src/api/info/index.ts new file mode 100644 index 00000000..1798c4d0 --- /dev/null +++ b/frontendNew/src/api/info/index.ts @@ -0,0 +1,39 @@ +import { defineRequest } from "../common"; +import type { IAdventureInfo, ICharacterInfo, IHelperInfo, ISkillInfo } from "./type"; + +export default defineRequest((request) => { + return { + async adventures() { + const res = await request.get("/adventure"); + return res.data; + }, + async createToken(alter: string, equVersion?: string) { + const res = await request.get(`/token/get/${alter}`, { params: { equVersion } }); + return res.data; + }, + async characterInfo() { + const res = await request.get("/character"); + return res.data; + }, + async skillDetail(skillId: string, level: number) { + const res = await request.get(`/skill/${skillId}/${level}`); + return res.data; + }, + async getConfigFromHelper(uid: string) { + const res = await request.get(`/dnfhelper/${uid}/`); + return res.data; + }, + async getSkillFromCode(code: string) { + const res = await request.post(`/skillTree/`, { code }); + return res.data; + }, + async getOathInfo(suitId: string, skillId: string, rarity: string, lv: number) { + const res = await request.get(`/info/oath/${suitId}/${skillId}`, { params: { rarity, lv } }); + return res.data; + }, + async getHelperList(id: string) { + const res = await request.get(`/dnfhelper/${id}/list`); + return res.data; + }, + }; +}); diff --git a/frontendNew/src/api/info/type.ts b/frontendNew/src/api/info/type.ts new file mode 100644 index 00000000..75361853 --- /dev/null +++ b/frontendNew/src/api/info/type.ts @@ -0,0 +1,227 @@ +export interface IAdventureInfo { + title: string; + name: string; + children: IAlterInfo[]; +} +export interface IAlterOption { + name: string; + title: string; + value?: string; +} + +export interface IAlterInfo { + name: string; + url?: string; + title: string; + default_value: string; + options?: IAlterOption[]; + open?: boolean; + comment?: string; + value?: string; +} + +export interface ICharacterInfo { + role: string; + alter: string; + name: string; + buffer: boolean; + equVersion: string; + equips: IEquipment[]; + properties: string[]; + stones: IEquipment[]; + enchants: IEnchantingInfo[]; + emblems: IEmblemInfo[]; + oaths: IEquipment[]; + weapons: string[]; + subweapons: string[]; + skills: ISkill[]; + suits: ISuit[]; + avatar: Record; + jades: IJade[]; + sundry: Record; + options: { id: number; name: string; options: string[] }[]; + oaths_skills: Record< + string, + { + suitInfo: { + name: string; + rarity: string; + SkillAttack: number; + Buffer: number; + Attack: number; + }[]; + skills: { skillId: string; name: string; icon: string }[]; + } + >; +} + +export interface ISundry { + id: number; + options: { + name: string; + value: number; + }[]; +} + +export interface IEquipment { + id: string; + imageUrl: string; + itemType: string; + itemDetailType: string; + name: string; + categorize: string; + suit: string[]; + rarity: string; + max_adaptation: number; + STR: number[]; + INT: number[]; + Vitality: number[]; + Spirit: number[]; + AtkP: number[]; + AtkM: number[]; + AtkI: number[]; + SkillAttack: number[]; + Attack: number[]; + Buffer: number[]; + detail: string; + bufferDetail: string; + position: string[]; + wearUrl: string[]; + oathPos: string; + displayUrl?: string; +} + +export interface ISkill { + icon: string; + name: string; + id: number; + learnLv: number; + position: number; + line: number; + type: string; + maxLearnLv: number; + maxLv: number; + bind: boolean; + hasVP: boolean; + hasUP: boolean; + vps: { + name: string; + desc: string; + }[]; + uuid: string; + upType: "damage" | "heal"; +} + +export interface ISuit { + id: number; + name: string; + imageUrl: string; + suitId: number; + suitName: string; + point: number; + rarity: string; + level: number; + SkillAttack: number; + Buffer: number; + value: string; + bufferValue: string; +} + +export interface IEnchantingInfo { + id: string | number; + fame: number | undefined; + position: string[]; + detail: string; + categorize: string[]; + rarity?: string; + type?: string; +} + +export interface IEmblemInfo { + fame: number; + id: string; + rarity: string; + type: string; + value: string; +} + +export interface IAvatarInfo { + id: number; + options: string[]; + part: string; + rarity: string; + suit?: string; + name: string; +} + +export interface IJade { + name: string; + id: number; + max: number; + min: number; + pre: number; + unit: string; +} + +export interface ISkillInfo { + name: string; + type: string; + desc: string; + descDetail: string; + consumeItem: ConsumeItem; + descSpecial: string[]; + maxLevel: number; + requiredLevel: number; + requiredLevelRange: number; + preRequiredSkill: any; + jobId: string; + jobName: string; + jobGrowLevel: any[]; + evolution: Evolution[]; + enhancement: Enhancement[]; + attribute: Attribute; +} + +export interface ConsumeItem { + itemId: string; + itemName: string; + value: number; +} + +export interface Evolution { + type: number; + name: string; + desc: string; + descDetail: string; + skills?: string[]; +} + +export interface Enhancement { + type: number; + status: Status[]; +} + +export interface Status { + name: string; + value: string; +} + +export interface Attribute { + optionDesc: string; + level: number; + consumeMp: number; + coolTime: number; + castingTime?: number; + optionValue: Record<`value${string}`, string>; + detail: string; +} + +export interface IHelperInfo { + id: string; + avatar: string; + roleList: { + roleId: string; + roleName: string; + avatarLink: string; + }[]; +} diff --git a/frontendNew/src/api/types.ts b/frontendNew/src/api/types.ts new file mode 100644 index 00000000..9284c439 --- /dev/null +++ b/frontendNew/src/api/types.ts @@ -0,0 +1,6 @@ +export interface IDataType { + code?: number + message: string + data: T + state?: number +} diff --git a/frontendNew/src/components/OTPForm.vue b/frontendNew/src/components/OTPForm.vue index f35c8dfd..193316ba 100644 --- a/frontendNew/src/components/OTPForm.vue +++ b/frontendNew/src/components/OTPForm.vue @@ -11,12 +11,7 @@ import { FieldLabel, FieldSeparator, } from "@/components/ui/field"; -import { - InputOTP, - InputOTPGroup, - InputOTPSeparator, - InputOTPSlot, -} from "@/components/ui/input-otp"; +import { Input } from "@/components/ui/input"; const props = defineProps<{ class?: HTMLAttributes["class"]; @@ -35,35 +30,11 @@ const props = defineProps<{ DNF计算器 - 请输入助手的社区ID + - 助手ID - - - - - - - - - - - - - - - - - - - + 助手ID + diff --git a/frontendNew/src/components/ui/card/Card.vue b/frontendNew/src/components/ui/card/Card.vue new file mode 100644 index 00000000..a7b9f5ce --- /dev/null +++ b/frontendNew/src/components/ui/card/Card.vue @@ -0,0 +1,29 @@ + + + diff --git a/frontendNew/src/components/ui/card/CardAction.vue b/frontendNew/src/components/ui/card/CardAction.vue new file mode 100644 index 00000000..c2beb206 --- /dev/null +++ b/frontendNew/src/components/ui/card/CardAction.vue @@ -0,0 +1,17 @@ + + + diff --git a/frontendNew/src/components/ui/card/CardContent.vue b/frontendNew/src/components/ui/card/CardContent.vue new file mode 100644 index 00000000..6270bc46 --- /dev/null +++ b/frontendNew/src/components/ui/card/CardContent.vue @@ -0,0 +1,17 @@ + + + diff --git a/frontendNew/src/components/ui/card/CardDescription.vue b/frontendNew/src/components/ui/card/CardDescription.vue new file mode 100644 index 00000000..722b2033 --- /dev/null +++ b/frontendNew/src/components/ui/card/CardDescription.vue @@ -0,0 +1,17 @@ + + + diff --git a/frontendNew/src/components/ui/card/CardFooter.vue b/frontendNew/src/components/ui/card/CardFooter.vue new file mode 100644 index 00000000..ca3936b4 --- /dev/null +++ b/frontendNew/src/components/ui/card/CardFooter.vue @@ -0,0 +1,17 @@ + + + diff --git a/frontendNew/src/components/ui/card/CardHeader.vue b/frontendNew/src/components/ui/card/CardHeader.vue new file mode 100644 index 00000000..27d56f7e --- /dev/null +++ b/frontendNew/src/components/ui/card/CardHeader.vue @@ -0,0 +1,17 @@ + + + diff --git a/frontendNew/src/components/ui/card/CardTitle.vue b/frontendNew/src/components/ui/card/CardTitle.vue new file mode 100644 index 00000000..1f53990e --- /dev/null +++ b/frontendNew/src/components/ui/card/CardTitle.vue @@ -0,0 +1,17 @@ + + + diff --git a/frontendNew/src/components/ui/card/index.ts b/frontendNew/src/components/ui/card/index.ts new file mode 100644 index 00000000..73d985f2 --- /dev/null +++ b/frontendNew/src/components/ui/card/index.ts @@ -0,0 +1,7 @@ +export { default as Card } from './Card.vue' +export { default as CardAction } from './CardAction.vue' +export { default as CardContent } from './CardContent.vue' +export { default as CardDescription } from './CardDescription.vue' +export { default as CardFooter } from './CardFooter.vue' +export { default as CardHeader } from './CardHeader.vue' +export { default as CardTitle } from './CardTitle.vue' diff --git a/frontendNew/src/components/ui/input-group/InputGroup.vue b/frontendNew/src/components/ui/input-group/InputGroup.vue new file mode 100644 index 00000000..48f632b9 --- /dev/null +++ b/frontendNew/src/components/ui/input-group/InputGroup.vue @@ -0,0 +1,21 @@ + + + diff --git a/frontendNew/src/components/ui/input-group/InputGroupAddon.vue b/frontendNew/src/components/ui/input-group/InputGroupAddon.vue new file mode 100644 index 00000000..d0cf699a --- /dev/null +++ b/frontendNew/src/components/ui/input-group/InputGroupAddon.vue @@ -0,0 +1,36 @@ + + + diff --git a/frontendNew/src/components/ui/input-group/InputGroupButton.vue b/frontendNew/src/components/ui/input-group/InputGroupButton.vue new file mode 100644 index 00000000..8b454106 --- /dev/null +++ b/frontendNew/src/components/ui/input-group/InputGroupButton.vue @@ -0,0 +1,22 @@ + + + diff --git a/frontendNew/src/components/ui/input-group/InputGroupInput.vue b/frontendNew/src/components/ui/input-group/InputGroupInput.vue new file mode 100644 index 00000000..08b49cc1 --- /dev/null +++ b/frontendNew/src/components/ui/input-group/InputGroupInput.vue @@ -0,0 +1,19 @@ + + + diff --git a/frontendNew/src/components/ui/input-group/InputGroupText.vue b/frontendNew/src/components/ui/input-group/InputGroupText.vue new file mode 100644 index 00000000..81db58a1 --- /dev/null +++ b/frontendNew/src/components/ui/input-group/InputGroupText.vue @@ -0,0 +1,19 @@ + + + diff --git a/frontendNew/src/components/ui/input-group/InputGroupTextarea.vue b/frontendNew/src/components/ui/input-group/InputGroupTextarea.vue new file mode 100644 index 00000000..a4dcb48d --- /dev/null +++ b/frontendNew/src/components/ui/input-group/InputGroupTextarea.vue @@ -0,0 +1,19 @@ + + +