GET请求
axios.get(urlString,
{
headers: {
'token': token
...
},
params: {
param1: string,
param2: string
},
...
}
)
.then(res => fn)
.catch(e => fn)
POST请求
axios.post(urlString,
{
data: data,
...
},
{
headers: {
'token': token
...
}
}
)
.then(res => fn)
.catch(e => fn)