添加了put方法

This commit is contained in:
2020-10-15 09:21:00 +08:00
parent 6bf0fbc16f
commit c240c7aba3
3 changed files with 11 additions and 2 deletions

View File

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