Browse Source

临时去掉token

master-xiaowang
mk 3 months ago
parent
commit
64a9351447
  1. 22
      src/utils/http.ts

22
src/utils/http.ts

@ -12,7 +12,7 @@ interface Result {
interface ResultData<T = any> extends Result {
data?: T
}
const URL: string = serviceUrls.yiyanService
const URL: string = serviceUrls.baseService
enum RequestEnums {
TIMEOUT = 20000,
OVERDUE = 600, // 登录失效
@ -40,16 +40,16 @@ class RequestHttp {
* -> [] ->
* token校验(JWT) : token,vuex/pinia/
*/
this.service.interceptors.request.use(
(config: InternalAxiosRequestConfig) => {
config.headers['Authorization'] = localStorage.getItem('token') || ''
return config
},
(error: AxiosError) => {
// 请求报错
Promise.reject(error)
}
)
// this.service.interceptors.request.use(
// (config: InternalAxiosRequestConfig) => {
// config.headers['Authorization'] = localStorage.getItem('token') || ''
// return config
// },
// (error: AxiosError) => {
// // 请求报错
// Promise.reject(error)
// }
// )
/**
*

Loading…
Cancel
Save