This commit is contained in:
2025-03-31 10:33:16 +08:00
parent f036fa047c
commit 700243601f
18 changed files with 396 additions and 276 deletions
+2 -1
View File
@@ -1,9 +1,10 @@
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)
const res = await request.post<IResult>('/calc', config)
return res.data
}
}
+13
View File
@@ -0,0 +1,13 @@
export interface IResult {
skills: IResultSkill[]
}
export interface IResultSkill {
name: string
icon: string
lv: number
data: number
ratio: number
cd: number
damage: number
}
+14 -13
View File
@@ -3,6 +3,7 @@ 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'
@@ -80,19 +81,19 @@ export function defineRequest<T>(fn: (ax: AxiosInstance) => T) {
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}`,
// )
// },
// })
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') {
+2 -2
View File
@@ -6,7 +6,7 @@ export interface IAdventureInfo {
export interface IAlterOption {
name: string
title: string
class?: string
value?: string
}
export interface IAlterInfo {
@@ -17,7 +17,7 @@ export interface IAlterInfo {
options?: IAlterOption[]
open?: boolean
comment?: string
class?: string
value?: string
}
export interface ICharacterInfo {