diff --git a/src/api/base.ts b/src/api/base.ts index a859850..72c378d 100644 --- a/src/api/base.ts +++ b/src/api/base.ts @@ -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 } \ No newline at end of file