diff --git a/z_ele/src/layout/components/lock-dialog.vue b/z_ele/src/layout/components/lock-dialog.vue
index cbccd14..cc4b7ea 100644
--- a/z_ele/src/layout/components/lock-dialog.vue
+++ b/z_ele/src/layout/components/lock-dialog.vue
@@ -18,7 +18,7 @@
placeholder="请输入临时锁定密码/为空则使用默认使用账号密码"
/>
- 锁定客户端
@@ -27,23 +27,39 @@
diff --git a/z_ele/src/utils/request.ts b/z_ele/src/utils/request.ts
index fbcd20c..61b53b0 100644
--- a/z_ele/src/utils/request.ts
+++ b/z_ele/src/utils/request.ts
@@ -8,13 +8,21 @@ import { API_BASE_URL, LAYOUT_PATH } from '@/config/setting';
import type { ApiResult } from '@/api';
import router from '@/router';
import { isWhiteList } from '@/router/routes';
-import {getClientInfo, getToken, setToken} from './token-util';
+import { getToken, setToken } from './token-util';
import {logout, showLogoutConfirm, toURLSearch} from './common';
+import {useClientStore} from "@/store/modules/client";
/**
* 请求拦截处理
*/
export function requestInterceptor(config: InternalAxiosRequestConfig) {
+ // 添加客户端信息到header
+ const client = useClientStore();
+ if(config.headers) {
+ config.headers['Client'] = client.clientName
+ config.headers['Client-Id'] = client.clientId;
+ config.headers['Client-Version'] = client.clientVersion;
+ }
// 添加token到header
const token = getToken();
if (token && config.headers) {
@@ -25,13 +33,6 @@ export function requestInterceptor(config: InternalAxiosRequestConfig) {
config.url = toURLSearch(config.params, config.url);
config.params = {};
}
- // 客户端信息
- let clientInfo = getClientInfo();
- if(clientInfo) {
- config.headers['Client'] = clientInfo.name;
- config.headers['Client-Id'] = clientInfo.id;
- config.headers['Client-Version'] = clientInfo.version;
- }
}
/**