init
@@ -0,0 +1,9 @@
|
||||
[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue,css,scss,sass,less,styl}]
|
||||
charset = utf-8
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
end_of_line = lf
|
||||
max_line_length = 100
|
||||
@@ -0,0 +1,305 @@
|
||||
{
|
||||
"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,
|
||||
"VNode": true,
|
||||
"WritableComputedRef": true,
|
||||
"asyncComputed": true,
|
||||
"autoResetRef": true,
|
||||
"computed": true,
|
||||
"computedAsync": true,
|
||||
"computedEager": true,
|
||||
"computedInject": true,
|
||||
"computedWithControl": true,
|
||||
"controlledComputed": true,
|
||||
"controlledRef": true,
|
||||
"createApp": 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,
|
||||
"h": true,
|
||||
"ignorableWatch": true,
|
||||
"inject": true,
|
||||
"injectLocal": true,
|
||||
"isDefined": true,
|
||||
"isProxy": true,
|
||||
"isReactive": true,
|
||||
"isReadonly": true,
|
||||
"isRef": 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,
|
||||
"refThrottled": true,
|
||||
"refWithControl": true,
|
||||
"resolveComponent": true,
|
||||
"resolveRef": true,
|
||||
"resolveUnref": 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,
|
||||
"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,
|
||||
"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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
* text=auto eol=lf
|
||||
@@ -0,0 +1,30 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.DS_Store
|
||||
dist
|
||||
dist-ssr
|
||||
coverage
|
||||
*.local
|
||||
|
||||
/cypress/videos/
|
||||
/cypress/screenshots/
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
*.tsbuildinfo
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/prettierrc",
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"printWidth": 100
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
# frontend
|
||||
|
||||
This template should help get you started developing with Vue 3 in Vite.
|
||||
|
||||
## Recommended IDE Setup
|
||||
|
||||
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
|
||||
|
||||
## Type Support for `.vue` Imports in TS
|
||||
|
||||
TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.
|
||||
|
||||
## Customize configuration
|
||||
|
||||
See [Vite Configuration Reference](https://vite.dev/config/).
|
||||
|
||||
## Project Setup
|
||||
|
||||
```sh
|
||||
pnpm install
|
||||
```
|
||||
|
||||
### Compile and Hot-Reload for Development
|
||||
|
||||
```sh
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
### Type-Check, Compile and Minify for Production
|
||||
|
||||
```sh
|
||||
pnpm build
|
||||
```
|
||||
|
||||
### Lint with [ESLint](https://eslint.org/)
|
||||
|
||||
```sh
|
||||
pnpm lint
|
||||
```
|
||||
@@ -0,0 +1 @@
|
||||
/// <reference types="vite/client" />
|
||||
@@ -0,0 +1,25 @@
|
||||
import pluginVue from 'eslint-plugin-vue'
|
||||
import { defineConfigWithVueTs, vueTsConfigs } from '@vue/eslint-config-typescript'
|
||||
import oxlint from 'eslint-plugin-oxlint'
|
||||
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
|
||||
|
||||
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
|
||||
// import { configureVueProject } from '@vue/eslint-config-typescript'
|
||||
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
|
||||
// More info at https://github.com/vuejs/eslint-config-typescript/#advanced-setup
|
||||
|
||||
export default defineConfigWithVueTs(
|
||||
{
|
||||
name: 'app/files-to-lint',
|
||||
files: ['**/*.{ts,mts,tsx,vue}'],
|
||||
},
|
||||
|
||||
{
|
||||
name: 'app/files-to-ignore',
|
||||
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'],
|
||||
},
|
||||
pluginVue.configs['flat/essential'],
|
||||
vueTsConfigs.recommended,
|
||||
...oxlint.configs['flat/recommended'],
|
||||
skipFormatting,
|
||||
)
|
||||
@@ -0,0 +1,42 @@
|
||||
<!doctype html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="./favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta http-equiv="Expires" content="0" />
|
||||
<meta http-equiv="Pragma" content="no-cache" />
|
||||
<meta http-equiv="Cache-control" content="no-cache" />
|
||||
<meta http-equiv="Cache" content="no-cache" />
|
||||
<meta name="baidu-site-verification" content="codeva-hGziQg28WN" />
|
||||
<title>DNF计算器</title>
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-J0NPDEYQJS"></script>
|
||||
<script>
|
||||
if (!window.pywebview) {
|
||||
// 百度统计
|
||||
// eslint-disable-next-line vars-on-top, no-var
|
||||
var _hmt = _hmt || []
|
||||
;(function () {
|
||||
const hm = document.createElement('script')
|
||||
hm.src = 'https://hm.baidu.com/hm.js?472775d2edd6fb31b00828eef60ba388'
|
||||
const s = document.querySelectorAll('script')[0]
|
||||
s.parentNode.insertBefore(hm, s)
|
||||
})()
|
||||
// Google 分析
|
||||
window.dataLayer = window.dataLayer || []
|
||||
function gtag(...args) {
|
||||
window.dataLayer.push(args)
|
||||
}
|
||||
gtag('js', new Date())
|
||||
gtag('config', 'G-J0NPDEYQJS')
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- <script>
|
||||
window.flag
|
||||
= navigator.userAgent.match(/(phone|pad|pod|iphone|ipod|ios|ipad|android|mobile|blackberry|iemobile|mqqbrowser|juc|fennec|wosbrowser|browserng|webos|symbian|windows phone)/i)
|
||||
</script> -->
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "run-p type-check \"build-only {@}\" --",
|
||||
"preview": "vite preview",
|
||||
"build-only": "vite build",
|
||||
"type-check": "vue-tsc --build",
|
||||
"lint:oxlint": "oxlint . --fix -D correctness --ignore-path .gitignore",
|
||||
"lint:eslint": "eslint . --fix",
|
||||
"lint": "run-s lint:*",
|
||||
"format": "prettier --write src/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@iconify/vue": "^4.3.0",
|
||||
"@radix-ui/colors": "^3.0.0",
|
||||
"@vueuse/core": "^12.8.2",
|
||||
"axios": "^1.8.2",
|
||||
"pako": "^2.1.0",
|
||||
"pinia": "^3.0.1",
|
||||
"reka-ui": "^2.0.2",
|
||||
"sass": "^1.85.1",
|
||||
"unplugin-vue-components": "^28.4.1",
|
||||
"vue": "^3.5.13",
|
||||
"vue-router": "^4.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/node22": "^22.0.0",
|
||||
"@types/node": "^22.13.10",
|
||||
"@types/pako": "^2.0.3",
|
||||
"@vitejs/plugin-vue": "^5.2.1",
|
||||
"@vitejs/plugin-vue-jsx": "^4.1.1",
|
||||
"@vue/eslint-config-prettier": "^10.2.0",
|
||||
"@vue/eslint-config-typescript": "^14.5.0",
|
||||
"@vue/tsconfig": "^0.7.0",
|
||||
"eslint": "^9.21.0",
|
||||
"eslint-plugin-oxlint": "^0.15.13",
|
||||
"eslint-plugin-vue": "~10.0.0",
|
||||
"jiti": "^2.4.2",
|
||||
"npm-run-all2": "^7.0.2",
|
||||
"oxlint": "^0.15.13",
|
||||
"prettier": "3.5.3",
|
||||
"typescript": "~5.8.0",
|
||||
"unocss": "66.1.0-beta.3",
|
||||
"unplugin-auto-import": "^19.1.1",
|
||||
"vite": "^6.2.1",
|
||||
"vite-plugin-vue-devtools": "^7.7.2",
|
||||
"vue-tsc": "^2.2.8"
|
||||
},
|
||||
"format": "prettier --write src/"
|
||||
}
|
||||
|
After Width: | Height: | Size: 264 KiB |
@@ -0,0 +1,119 @@
|
||||
import type { AxiosInstance, AxiosResponse } from 'axios'
|
||||
import axios from 'axios'
|
||||
import { h } from 'vue'
|
||||
import { gzip, ungzip } from 'pako'
|
||||
// import { useAppStore, useConfigStore } from '@/store'
|
||||
// import { useDialog } from '@/components/hooks/dialog'
|
||||
|
||||
export interface HttpResponse<T = unknown> extends AxiosResponse {
|
||||
code?: number
|
||||
message: string
|
||||
data: T
|
||||
state?: number
|
||||
}
|
||||
|
||||
let instance: AxiosInstance | null = null
|
||||
|
||||
let baseURL = '/api'
|
||||
|
||||
// 避免远程开发的时候冲突
|
||||
if (process.env.NODE_ENV == 'development') {
|
||||
baseURL = 'http://127.0.0.1:17173/api'
|
||||
}
|
||||
|
||||
if (import.meta.env.MODE == 'web' || import.meta.env.MODE == 'show') {
|
||||
baseURL = 'https://api.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<T>(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 = 'test'
|
||||
|
||||
if (token) {
|
||||
request.headers['Access-Token'] = token
|
||||
}
|
||||
|
||||
// 在网页端,会添加token
|
||||
const accessToken = localStorage.getItem('dcalc/access_token')
|
||||
|
||||
if (accessToken) {
|
||||
request.headers.Authorization = `Bearer ${accessToken}`
|
||||
}
|
||||
|
||||
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<HttpResponse>) => {
|
||||
if (response.data.code === 500) {
|
||||
// const { alert } = useDialog()
|
||||
// await alert({
|
||||
// content: () => {
|
||||
// return h(
|
||||
// 'div',
|
||||
// {
|
||||
// class: 'justify-center text-hex-d4d6b6 text-center',
|
||||
// style: 'white-space:pre-wrap;width:250px;margin:10px',
|
||||
// },
|
||||
// `出现错误,可加群反馈:183439472\n${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))
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import info from './info'
|
||||
|
||||
export default { ...info }
|
||||
@@ -0,0 +1,10 @@
|
||||
import { defineRequest } from '../common'
|
||||
import type { IAdventureInfo } from './type'
|
||||
|
||||
export default defineRequest((request) => {
|
||||
return {
|
||||
adventures() {
|
||||
return request.get<IAdventureInfo[]>('/adventure').then((res) => res.data)
|
||||
},
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,34 @@
|
||||
export interface IAdventureInfo {
|
||||
title: string
|
||||
name: string
|
||||
children: IAlterInfo[]
|
||||
}
|
||||
|
||||
export interface ITools {
|
||||
name: string
|
||||
tooltips: string
|
||||
link: string
|
||||
end?: Date
|
||||
target: '_blank' | '_self'
|
||||
}
|
||||
|
||||
export interface IMonster {
|
||||
id: number
|
||||
name: string
|
||||
}
|
||||
|
||||
export interface IAlterOption {
|
||||
name: string
|
||||
title: string
|
||||
class?: string
|
||||
}
|
||||
|
||||
export interface IAlterInfo {
|
||||
name: string
|
||||
url?: string
|
||||
title: string
|
||||
default_value: string
|
||||
options?: IAlterOption[]
|
||||
open?: boolean
|
||||
comment?: string
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export interface IDataType<T = any> {
|
||||
code?: number
|
||||
message: string
|
||||
data: T
|
||||
state?: number
|
||||
}
|
||||
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 928 B |
|
After Width: | Height: | Size: 264 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 322 B |
|
After Width: | Height: | Size: 355 B |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 711 B |
|
After Width: | Height: | Size: 617 B |
|
After Width: | Height: | Size: 637 B |
|
After Width: | Height: | Size: 595 B |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 982 B |
|
After Width: | Height: | Size: 977 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 994 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 976 B |
|
After Width: | Height: | Size: 1001 B |
|
After Width: | Height: | Size: 1019 B |
|
After Width: | Height: | Size: 973 B |
|
After Width: | Height: | Size: 1019 B |
|
After Width: | Height: | Size: 954 B |
|
After Width: | Height: | Size: 937 B |
|
After Width: | Height: | Size: 939 B |
|
After Width: | Height: | Size: 926 B |
|
After Width: | Height: | Size: 976 B |
|
After Width: | Height: | Size: 962 B |
|
After Width: | Height: | Size: 962 B |
|
After Width: | Height: | Size: 978 B |
|
After Width: | Height: | Size: 1015 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 324 B |
|
After Width: | Height: | Size: 763 B |
|
After Width: | Height: | Size: 767 B |
|
After Width: | Height: | Size: 335 B |
|
After Width: | Height: | Size: 336 B |
|
After Width: | Height: | Size: 336 B |
|
After Width: | Height: | Size: 323 B |
|
After Width: | Height: | Size: 326 B |
|
After Width: | Height: | Size: 325 B |
|
After Width: | Height: | Size: 325 B |
|
After Width: | Height: | Size: 312 B |
|
After Width: | Height: | Size: 410 B |
|
After Width: | Height: | Size: 411 B |
|
After Width: | Height: | Size: 412 B |
|
After Width: | Height: | Size: 386 B |
|
After Width: | Height: | Size: 391 B |
|
After Width: | Height: | Size: 369 B |
|
After Width: | Height: | Size: 590 B |
|
After Width: | Height: | Size: 395 B |
|
After Width: | Height: | Size: 536 B |
|
After Width: | Height: | Size: 737 B |
|
After Width: | Height: | Size: 433 B |
|
After Width: | Height: | Size: 475 B |
|
After Width: | Height: | Size: 471 B |
|
After Width: | Height: | Size: 373 B |
|
After Width: | Height: | Size: 763 B |
|
After Width: | Height: | Size: 767 B |
|
After Width: | Height: | Size: 759 B |
|
After Width: | Height: | Size: 756 B |
|
After Width: | Height: | Size: 201 B |
|
After Width: | Height: | Size: 200 B |
|
After Width: | Height: | Size: 200 B |
|
After Width: | Height: | Size: 196 B |
|
After Width: | Height: | Size: 242 B |