升级了部分依赖 安装了新的包
This commit is contained in:
@@ -6,7 +6,7 @@ import { message } from 'ant-design-vue';
|
||||
|
||||
// 泛型接口
|
||||
export interface Get {
|
||||
<T>(url: string, params?: object, config?: AxiosRequestConfig): Promise<CustomSuccessData<T>>;
|
||||
<T>(url: string, params?: unknown, config?: AxiosRequestConfig): Promise<CustomSuccessData<T>>;
|
||||
}
|
||||
|
||||
axios.interceptors.response.use((response)=>{
|
||||
@@ -17,12 +17,12 @@ axios.interceptors.response.use((response)=>{
|
||||
return Promise.reject(error)
|
||||
})
|
||||
|
||||
const get: Get = async function (url: string,data?: object) {
|
||||
const get: Get = async function (url: string,data?: unknown) {
|
||||
const res = await axios.get(url,{params:data});
|
||||
return res.data;
|
||||
}
|
||||
|
||||
const post: Get = async function (url: string,data?: object) {
|
||||
const post: Get = async function (url: string,data?: unknown) {
|
||||
const res = await axios.post(url,data)
|
||||
return res.data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user