添加del方法

This commit is contained in:
luyuan 2020-10-14 15:33:46 +08:00
parent 34beff1594
commit 4b095a853c
Signed by: theluyuan
GPG Key ID: A7972FD973317FF3

View File

@ -17,13 +17,18 @@ axios.interceptors.response.use((response)=>{
return Promise.reject(error) return Promise.reject(error)
}) })
const get: Get = async function (url: string,data?: unknown) { const get: Get = async function (url: string, data?: unknown) {
const res = await axios.get(url,{params:data}); const res = await axios.get(url, {params:data});
return res.data; return res.data;
} }
const post: Get = async function (url: string,data?: unknown) { const post: Get = async function (url: string, data?: unknown) {
const res = await axios.post(url,data) 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; return res.data;
} }
@ -34,5 +39,6 @@ function setToken(){
export { export {
get, get,
post, post,
del,
setToken setToken
} }