添加del方法 #42

Merged
theluyuan merged 1 commits from xbx into master 2020-10-14 07:34:11 +00:00
Showing only changes of commit 4b095a853c - Show all commits

View File

@ -27,6 +27,11 @@ const post: Get = async function (url: string,data?: unknown) {
return res.data;
}
const del: Get = async function (url: string, data?: unknown){
const res = await axios.delete(url, {params:data})
return res.data;
}
function setToken(){
axios.defaults.headers.common['Authorization'] = "Bearer " + getValue("token");
}
@ -34,5 +39,6 @@ function setToken(){
export {
get,
post,
del,
setToken
}