!31 【轻量级 PR】新增全局请求头 clientid 适配后端 token 校验
Merge pull request !31 from MichelleChung/ts
This commit is contained in:
@ -4,7 +4,7 @@ import { LoginData, LoginResult, VerifyCodeResult, TenantInfo } from './types';
|
||||
import { UserInfo } from '@/api/system/user/types';
|
||||
|
||||
// pc端固定客户端授权id
|
||||
const clientId = 'e5cd7e4891bf95d1d19206ce24a7b32e';
|
||||
const clientId = import.meta.env.VITE_APP_CLIENT_ID;
|
||||
|
||||
/**
|
||||
* @param data {LoginData}
|
||||
|
1
src/types/env.d.ts
vendored
1
src/types/env.d.ts
vendored
@ -68,6 +68,7 @@ interface ImportMetaEnv {
|
||||
VITE_APP_POWERJOB_ADMIN: string;
|
||||
VITE_APP_ENV: string;
|
||||
VITE_APP_RSA_PUBLIC_KEY: string;
|
||||
VITE_APP_CLIENT_ID: string;
|
||||
}
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
|
@ -16,6 +16,7 @@ let downloadLoadingInstance: LoadingInstance;
|
||||
export const isRelogin = { show: false };
|
||||
|
||||
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8';
|
||||
axios.defaults.headers['clientid'] = import.meta.env.VITE_APP_CLIENT_ID;
|
||||
// 创建 axios 实例
|
||||
const service = axios.create({
|
||||
baseURL: import.meta.env.VITE_APP_BASE_API,
|
||||
|
Reference in New Issue
Block a user