feat(frontend): optimize frontend interaction (#8)

Support auto refresh. Change authentication method. Streamline the frontend code.
This commit is contained in:
Li4n0
2021-04-25 22:15:56 +08:00
committed by GitHub
parent 50a6749070
commit 7e99d93e43
21 changed files with 347 additions and 232 deletions
-9
View File
@@ -5,13 +5,4 @@ const service = axios.create({
timeout: 5000 // request timeout
})
service.interceptors.request.use(function (config) {
const token = localStorage.getItem("token")
if (token !== null) {
config.headers['Token'] = token
}
// 在发送请求之前做些什么
return config
})
export default service