优化
This commit is contained in:
@@ -19,7 +19,8 @@ export const isRelogin = { show: false };
|
||||
export const globalHeaders = () => {
|
||||
return {
|
||||
Authorization: 'Bearer ' + getToken(),
|
||||
clientid: import.meta.env.VITE_APP_CLIENT_ID
|
||||
clientid: import.meta.env.VITE_APP_CLIENT_ID,
|
||||
'Content-Language': getLanguage()
|
||||
};
|
||||
};
|
||||
|
||||
@@ -45,7 +46,7 @@ service.interceptors.request.use(
|
||||
// 是否需要防止数据重复提交
|
||||
const isRepeatSubmit = config.headers?.repeatSubmit === false;
|
||||
// 是否需要加密
|
||||
const isEncrypt = config.headers?.isEncrypt === 'true';
|
||||
const isEncrypt = config.headers?.isEncrypt === true || config.headers?.isEncrypt === 'true';
|
||||
|
||||
if (getToken() && !isToken) {
|
||||
config.headers['Authorization'] = 'Bearer ' + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
|
||||
Reference in New Issue
Block a user