This commit is contained in:
yuping
2022-12-13 19:22:35 +08:00
parent 56875228a2
commit 5d17c8acc2
4 changed files with 9 additions and 7 deletions

View File

@@ -83,13 +83,13 @@ export async function request(_url, params) {
}
const body = method !== 'get' ? params || {} : {}
return axios({
url: BASE + url,
url,
method,
headers: {
'X-Token': localStorage.getItem('token'),
...method !== 'get' ? {'Content-Type': 'application/json'} : {}
},
baseURL: '',
baseURL: BASE,
...method !== 'get' ? {data: JSON.stringify(body)} : {}
}).then(resp => resp.data).then(response => {
if (response.code !== 200 && response.code !== 0) {