update 优化 封装全局统一请求头

This commit is contained in:
疯狂的狮子Li
2023-07-25 15:59:35 +08:00
parent 0082354aba
commit 0c791a1efc
6 changed files with 16 additions and 18 deletions

View File

@ -14,6 +14,10 @@ import { encrypt } from '@/utils/jsencrypt';
let downloadLoadingInstance: LoadingInstance;
// 是否显示重新登录
export const isRelogin = { show: false };
export const globalHeaders = {
Authorization: "Bearer " + getToken(),
clientid: import.meta.env.VITE_APP_CLIENT_ID
}
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8';
axios.defaults.headers['clientid'] = import.meta.env.VITE_APP_CLIENT_ID;