dev
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
@@ -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') {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user