update 增加全局请求头 clientid 用于判断 token 是否有效 ;
This commit is contained in:
parent
f801f4fb11
commit
19a311effa
@ -4,7 +4,7 @@ import { LoginData, LoginResult, VerifyCodeResult, TenantInfo } from './types';
|
|||||||
import { UserInfo } from '@/api/system/user/types';
|
import { UserInfo } from '@/api/system/user/types';
|
||||||
|
|
||||||
// pc端固定客户端授权id
|
// pc端固定客户端授权id
|
||||||
const clientId = 'e5cd7e4891bf95d1d19206ce24a7b32e';
|
export const clientId = 'e5cd7e4891bf95d1d19206ce24a7b32e';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param data {LoginData}
|
* @param data {LoginData}
|
||||||
|
@ -10,12 +10,14 @@ import FileSaver from 'file-saver';
|
|||||||
import { getLanguage } from '@/lang';
|
import { getLanguage } from '@/lang';
|
||||||
import { encryptBase64, encryptWithAes, generateAesKey } from '@/utils/crypto';
|
import { encryptBase64, encryptWithAes, generateAesKey } from '@/utils/crypto';
|
||||||
import { encrypt } from '@/utils/jsencrypt';
|
import { encrypt } from '@/utils/jsencrypt';
|
||||||
|
import { clientId } from '@/api/login';
|
||||||
|
|
||||||
let downloadLoadingInstance: LoadingInstance;
|
let downloadLoadingInstance: LoadingInstance;
|
||||||
// 是否显示重新登录
|
// 是否显示重新登录
|
||||||
export const isRelogin = { show: false };
|
export const isRelogin = { show: false };
|
||||||
|
|
||||||
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8';
|
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8';
|
||||||
|
axios.defaults.headers['clientid'] = clientId;
|
||||||
// 创建 axios 实例
|
// 创建 axios 实例
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: import.meta.env.VITE_APP_BASE_API,
|
baseURL: import.meta.env.VITE_APP_BASE_API,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user