添加del方法
This commit is contained in:
parent
34beff1594
commit
4b095a853c
@ -17,13 +17,18 @@ axios.interceptors.response.use((response)=>{
|
||||
return Promise.reject(error)
|
||||
})
|
||||
|
||||
const get: Get = async function (url: string,data?: unknown) {
|
||||
const res = await axios.get(url,{params:data});
|
||||
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?: unknown) {
|
||||
const res = await axios.post(url,data)
|
||||
const post: Get = async function (url: string, data?: unknown) {
|
||||
const res = await axios.post(url, data)
|
||||
return res.data;
|
||||
}
|
||||
|
||||
const del: Get = async function (url: string, data?: unknown){
|
||||
const res = await axios.delete(url, {params:data})
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@ -34,5 +39,6 @@ function setToken(){
|
||||
export {
|
||||
get,
|
||||
post,
|
||||
del,
|
||||
setToken
|
||||
}
|
Loading…
Reference in New Issue
Block a user