Merge pull request '添加del方法' (#42) from xbx into master

Reviewed-on: http://git.luyuan.tk/luyuan/beelink/pulls/42
This commit is contained in:
luyuan 2020-10-14 15:34:10 +08:00
commit 5fb97c7c78

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
}