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

@ -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
}