更新
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* @Author: zhp
|
||||
* @Date: 2023-01-06 10:13:07
|
||||
* @LastEditTime: 2023-02-22 16:52:30
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-05-12 12:42:15
|
||||
* @LastEditors: zwq
|
||||
* @Description:
|
||||
*/
|
||||
import axios from 'axios'
|
||||
@@ -22,8 +22,12 @@ const http = axios.create({
|
||||
* 请求拦截
|
||||
*/
|
||||
http.interceptors.request.use(config => {
|
||||
config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN'
|
||||
config.headers['token'] = Cookies.get('token') || ''
|
||||
config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN'
|
||||
if (config.url === "/login") {
|
||||
config.headers['token'] = ''
|
||||
} else {
|
||||
config.headers['token'] = Cookies.get('token') || ''
|
||||
}
|
||||
// 默认参数
|
||||
var defaults = {}
|
||||
// 防止缓存,GET请求默认带_t参数
|
||||
|
||||
Reference in New Issue
Block a user