mirror of
https://gitee.com/dromara/go-view.git
synced 2026-05-30 00:00:05 +08:00
feat: 接口增加泛型支持
This commit is contained in:
+3
-3
@@ -8,14 +8,14 @@ import { redirectErrorPage, getLocalStorage, routerTurnByName, isPreview } from
|
||||
import { fetchAllowList } from './axios.config'
|
||||
import includes from 'lodash/includes'
|
||||
|
||||
export interface MyResponseType {
|
||||
export interface MyResponseType<T> {
|
||||
code: ResultEnum
|
||||
data: any
|
||||
data: T
|
||||
message: string
|
||||
}
|
||||
|
||||
export interface MyRequestInstance extends Axios {
|
||||
(config: AxiosRequestConfig): Promise<MyResponseType>
|
||||
<T = any>(config: AxiosRequestConfig): Promise<MyResponseType<T>>
|
||||
}
|
||||
|
||||
const axiosInstance = axios.create({
|
||||
|
||||
Reference in New Issue
Block a user