如果有token,就不允许跳转到登录页了
This commit is contained in:
@@ -21,6 +21,8 @@ instance.interceptors.request.use(
|
||||
(config: InternalAxiosRequestConfig) => {
|
||||
const token = store.token
|
||||
|
||||
if(config.method === "get") return config
|
||||
|
||||
// 如果有token就把赋值给请求头
|
||||
if (token) config.headers["Authorization"] = `Bearer ${token}`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user