@liujitcn/kratos-admin-core 0.0.31 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -4
- package/dist/package/declarations/src/api/base/{config.d.ts → v1/config.d.ts} +1 -1
- package/dist/package/declarations/src/api/base/{file.d.ts → v1/file.d.ts} +3 -1
- package/dist/package/declarations/src/api/base/{language.d.ts → v1/language.d.ts} +1 -1
- package/dist/package/declarations/src/api/base/{login.d.ts → v1/login.d.ts} +2 -2
- package/dist/package/declarations/src/api/base/{mfa.d.ts → v1/mfa.d.ts} +3 -3
- package/dist/package/declarations/src/api/base/{oauth.d.ts → v1/oauth.d.ts} +1 -1
- package/dist/package/declarations/src/api/system/{auth.d.ts → admin/v1/auth.d.ts} +2 -2
- package/dist/package/declarations/src/api/system/{base_dict.d.ts → admin/v1/base_dict.d.ts} +1 -1
- package/dist/package/declarations/src/api/system/{base_tenant.d.ts → admin/v1/base_tenant.d.ts} +2 -2
- package/dist/package/declarations/src/components/ProTable/index.vue.d.ts +114 -0
- package/dist/package/declarations/src/components/TreeFilter/index.vue.d.ts +84 -76
- package/dist/package/declarations/src/components/Upload/File.vue.d.ts +1 -1
- package/dist/package/declarations/src/components/Upload/Files.vue.d.ts +1 -1
- package/dist/package/declarations/src/components/Upload/Img.vue.d.ts +1 -1
- package/dist/package/declarations/src/components/Upload/Imgs.vue.d.ts +1 -1
- package/dist/package/declarations/src/components/WangEditor/index.vue.d.ts +2 -0
- package/dist/package/declarations/src/documentTitle.d.ts +2 -0
- package/dist/package/declarations/src/format.d.ts +1 -1
- package/dist/package/declarations/src/index.d.ts +2 -1
- package/dist/package/declarations/src/locales/generated.d.ts +40 -0
- package/dist/package/declarations/src/modules/index.d.ts +1 -3
- package/dist/package/declarations/src/request.d.ts +1 -1
- package/dist/package/declarations/src/routers/index.d.ts +1 -1
- package/dist/package/declarations/src/rpc/base/v1/login.d.ts +5 -3
- package/dist/package/declarations/src/rpc/system/admin/v1/auth.d.ts +13 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +0 -101
- package/dist/package/declarations/src/rpc/system/common/v1/common.d.ts +26 -0
- package/dist/package/declarations/src/stores/interface/index.d.ts +6 -1
- package/dist/package/declarations/src/stores/modules/user.d.ts +2 -4
- package/dist/package/declarations/src/utils/passwordStrength.d.ts +1 -12
- package/dist/package/declarations/src/utils/request.d.ts +13 -2
- package/dist/package/declarations/src/utils/utils.d.ts +4 -0
- package/dist/package/src/api/base/{config.ts → v1/config.ts} +2 -2
- package/dist/package/src/api/base/{file.ts → v1/file.ts} +20 -24
- package/dist/package/src/api/base/{language.ts → v1/language.ts} +2 -2
- package/dist/package/src/api/base/{login.ts → v1/login.ts} +3 -3
- package/dist/package/src/api/base/{mfa.ts → v1/mfa.ts} +4 -4
- package/dist/package/src/api/base/{oauth.ts → v1/oauth.ts} +2 -2
- package/dist/package/src/api/system/{auth.ts → admin/v1/auth.ts} +3 -3
- package/dist/package/src/api/system/{base_dict.ts → admin/v1/base_dict.ts} +2 -2
- package/dist/package/src/api/system/{base_tenant.ts → admin/v1/base_tenant.ts} +3 -3
- package/dist/package/src/bootstrap.ts +6 -5
- package/dist/package/src/components/CronExpression/index.vue +4 -3
- package/dist/package/src/components/Dialog/ProDialog.vue +1 -0
- package/dist/package/src/components/ImportExcel/index.vue +4 -2
- package/dist/package/src/components/MarkdownPreview/index.vue +1 -1
- package/dist/package/src/components/PasswordStrength/index.vue +1 -1
- package/dist/package/src/components/ProTable/components/TableColumn.vue +14 -6
- package/dist/package/src/components/ProTable/index.vue +3 -3
- package/dist/package/src/components/RichTextPreview/index.vue +12 -1
- package/dist/package/src/components/SelectIcon/index.vue +3 -2
- package/dist/package/src/components/Upload/File.vue +2 -2
- package/dist/package/src/components/Upload/Files.vue +2 -2
- package/dist/package/src/components/Upload/Img.vue +7 -5
- package/dist/package/src/components/Upload/Imgs.vue +6 -5
- package/dist/package/src/components/WangEditor/index.vue +10 -7
- package/dist/package/src/documentTitle.ts +8 -0
- package/dist/package/src/format.ts +1 -1
- package/dist/package/src/index.ts +2 -1
- package/dist/package/src/layouts/components/Header/components/Avatar.vue +7 -6
- package/dist/package/src/layouts/components/Header/components/InfoDialog.vue +3 -2
- package/dist/package/src/layouts/components/Header/components/PasswordDialog.vue +3 -2
- package/dist/package/src/layouts/components/Header/components/SearchMenu.vue +16 -8
- package/dist/package/src/layouts/components/LockScreen.vue +175 -52
- package/dist/package/src/layouts/components/Tabs/index.vue +12 -3
- package/dist/package/src/layouts/components/ThemeDrawer/index.scss +4 -4
- package/dist/package/src/locales/en-US.json +8 -2
- package/dist/package/src/locales/ja-JP.json +8 -2
- package/dist/package/src/locales/zh-CN.json +8 -2
- package/dist/package/src/locales/zh-TW.json +8 -2
- package/dist/package/src/modules/index.ts +2 -4
- package/dist/package/src/request.ts +3 -0
- package/dist/package/src/routers/index.ts +15 -14
- package/dist/package/src/rpc/base/v1/login.ts +4 -2
- package/dist/package/src/rpc/system/admin/v1/auth.ts +13 -0
- package/dist/package/src/rpc/system/admin/v1/base_dict.ts +0 -112
- package/dist/package/src/rpc/system/common/v1/common.ts +35 -0
- package/dist/package/src/stores/interface/index.ts +6 -1
- package/dist/package/src/stores/modules/auth.ts +1 -1
- package/dist/package/src/stores/modules/config.ts +2 -2
- package/dist/package/src/stores/modules/dict.ts +1 -1
- package/dist/package/src/stores/modules/user.ts +21 -22
- package/dist/package/src/styles/element.scss +35 -4
- package/dist/package/src/utils/passwordCrypto.ts +1 -1
- package/dist/package/src/utils/passwordStrength.ts +7 -24
- package/dist/package/src/utils/request.ts +155 -36
- package/dist/package/src/utils/tenant.ts +1 -1
- package/dist/package/src/utils/utils.ts +25 -6
- package/dist/package/src/views/login/components/LoginForm.vue +32 -20
- package/dist/package/src/views/login/index.scss +2 -2
- package/package.json +1 -1
- package/vite.config.ts +1 -0
|
@@ -38,6 +38,7 @@ export declare const LOCALE_MESSAGES: {
|
|
|
38
38
|
"common.validation.phone_required": string;
|
|
39
39
|
"common.title.notice": string;
|
|
40
40
|
"common.title.warning": string;
|
|
41
|
+
"common.confirm.delete": string;
|
|
41
42
|
"common.placeholder.input": string;
|
|
42
43
|
"common.placeholder.input_content": string;
|
|
43
44
|
"common.placeholder.select": string;
|
|
@@ -148,6 +149,7 @@ export declare const LOCALE_MESSAGES: {
|
|
|
148
149
|
"core.layout.home": string;
|
|
149
150
|
"core.layout.info": string;
|
|
150
151
|
"core.layout.password_change": string;
|
|
152
|
+
"core.layout.password_change_required": string;
|
|
151
153
|
"core.layout.unnamed_menu": string;
|
|
152
154
|
"core.layout.lock_screen": string;
|
|
153
155
|
"core.layout.lock_screen_action": string;
|
|
@@ -296,11 +298,15 @@ export declare const LOCALE_MESSAGES: {
|
|
|
296
298
|
"common.dialog.resource_field": string;
|
|
297
299
|
"common.dialog.status_change": string;
|
|
298
300
|
"common.field.created_at": string;
|
|
301
|
+
"common.field.department": string;
|
|
302
|
+
"common.field.post": string;
|
|
299
303
|
"common.field.remark": string;
|
|
304
|
+
"common.field.role": string;
|
|
300
305
|
"common.field.sort": string;
|
|
301
306
|
"common.field.status": string;
|
|
302
307
|
"common.field.tenant": string;
|
|
303
308
|
"common.field.updated_at": string;
|
|
309
|
+
"common.field.user": string;
|
|
304
310
|
"common.message.create_success": string;
|
|
305
311
|
"common.message.delete_success": string;
|
|
306
312
|
"common.message.load_children_failed": string;
|
|
@@ -360,6 +366,7 @@ export declare const LOCALE_MESSAGES: {
|
|
|
360
366
|
"common.validation.phone_required": string;
|
|
361
367
|
"common.title.notice": string;
|
|
362
368
|
"common.title.warning": string;
|
|
369
|
+
"common.confirm.delete": string;
|
|
363
370
|
"common.placeholder.input": string;
|
|
364
371
|
"common.placeholder.input_content": string;
|
|
365
372
|
"common.placeholder.select": string;
|
|
@@ -470,6 +477,7 @@ export declare const LOCALE_MESSAGES: {
|
|
|
470
477
|
"core.layout.home": string;
|
|
471
478
|
"core.layout.info": string;
|
|
472
479
|
"core.layout.password_change": string;
|
|
480
|
+
"core.layout.password_change_required": string;
|
|
473
481
|
"core.layout.unnamed_menu": string;
|
|
474
482
|
"core.layout.lock_screen": string;
|
|
475
483
|
"core.layout.lock_screen_action": string;
|
|
@@ -618,11 +626,15 @@ export declare const LOCALE_MESSAGES: {
|
|
|
618
626
|
"common.dialog.resource_field": string;
|
|
619
627
|
"common.dialog.status_change": string;
|
|
620
628
|
"common.field.created_at": string;
|
|
629
|
+
"common.field.department": string;
|
|
630
|
+
"common.field.post": string;
|
|
621
631
|
"common.field.remark": string;
|
|
632
|
+
"common.field.role": string;
|
|
622
633
|
"common.field.sort": string;
|
|
623
634
|
"common.field.status": string;
|
|
624
635
|
"common.field.tenant": string;
|
|
625
636
|
"common.field.updated_at": string;
|
|
637
|
+
"common.field.user": string;
|
|
626
638
|
"common.message.create_success": string;
|
|
627
639
|
"common.message.delete_success": string;
|
|
628
640
|
"common.message.load_children_failed": string;
|
|
@@ -682,6 +694,7 @@ export declare const LOCALE_MESSAGES: {
|
|
|
682
694
|
"common.validation.phone_required": string;
|
|
683
695
|
"common.title.notice": string;
|
|
684
696
|
"common.title.warning": string;
|
|
697
|
+
"common.confirm.delete": string;
|
|
685
698
|
"common.placeholder.input": string;
|
|
686
699
|
"common.placeholder.input_content": string;
|
|
687
700
|
"common.placeholder.select": string;
|
|
@@ -811,6 +824,7 @@ export declare const LOCALE_MESSAGES: {
|
|
|
811
824
|
"core.layout.home": string;
|
|
812
825
|
"core.layout.info": string;
|
|
813
826
|
"core.layout.password_change": string;
|
|
827
|
+
"core.layout.password_change_required": string;
|
|
814
828
|
"core.layout.unnamed_menu": string;
|
|
815
829
|
"core.layout.lock_screen": string;
|
|
816
830
|
"core.layout.lock_screen_action": string;
|
|
@@ -940,11 +954,15 @@ export declare const LOCALE_MESSAGES: {
|
|
|
940
954
|
"common.dialog.resource_field": string;
|
|
941
955
|
"common.dialog.status_change": string;
|
|
942
956
|
"common.field.created_at": string;
|
|
957
|
+
"common.field.department": string;
|
|
958
|
+
"common.field.post": string;
|
|
943
959
|
"common.field.remark": string;
|
|
960
|
+
"common.field.role": string;
|
|
944
961
|
"common.field.sort": string;
|
|
945
962
|
"common.field.status": string;
|
|
946
963
|
"common.field.tenant": string;
|
|
947
964
|
"common.field.updated_at": string;
|
|
965
|
+
"common.field.user": string;
|
|
948
966
|
"common.message.create_success": string;
|
|
949
967
|
"common.message.delete_success": string;
|
|
950
968
|
"common.message.load_children_failed": string;
|
|
@@ -1004,6 +1022,7 @@ export declare const LOCALE_MESSAGES: {
|
|
|
1004
1022
|
"common.validation.phone_required": string;
|
|
1005
1023
|
"common.title.notice": string;
|
|
1006
1024
|
"common.title.warning": string;
|
|
1025
|
+
"common.confirm.delete": string;
|
|
1007
1026
|
"common.placeholder.input": string;
|
|
1008
1027
|
"common.placeholder.input_content": string;
|
|
1009
1028
|
"common.placeholder.select": string;
|
|
@@ -1133,6 +1152,7 @@ export declare const LOCALE_MESSAGES: {
|
|
|
1133
1152
|
"core.layout.home": string;
|
|
1134
1153
|
"core.layout.info": string;
|
|
1135
1154
|
"core.layout.password_change": string;
|
|
1155
|
+
"core.layout.password_change_required": string;
|
|
1136
1156
|
"core.layout.unnamed_menu": string;
|
|
1137
1157
|
"core.layout.lock_screen": string;
|
|
1138
1158
|
"core.layout.lock_screen_action": string;
|
|
@@ -1262,11 +1282,15 @@ export declare const LOCALE_MESSAGES: {
|
|
|
1262
1282
|
"common.dialog.resource_field": string;
|
|
1263
1283
|
"common.dialog.status_change": string;
|
|
1264
1284
|
"common.field.created_at": string;
|
|
1285
|
+
"common.field.department": string;
|
|
1286
|
+
"common.field.post": string;
|
|
1265
1287
|
"common.field.remark": string;
|
|
1288
|
+
"common.field.role": string;
|
|
1266
1289
|
"common.field.sort": string;
|
|
1267
1290
|
"common.field.status": string;
|
|
1268
1291
|
"common.field.tenant": string;
|
|
1269
1292
|
"common.field.updated_at": string;
|
|
1293
|
+
"common.field.user": string;
|
|
1270
1294
|
"common.message.create_success": string;
|
|
1271
1295
|
"common.message.delete_success": string;
|
|
1272
1296
|
"common.message.load_children_failed": string;
|
|
@@ -1324,6 +1348,7 @@ export declare const ELEMENT_LOCALES: {
|
|
|
1324
1348
|
confirm: string;
|
|
1325
1349
|
dateTablePrompt: string;
|
|
1326
1350
|
monthTablePrompt: string;
|
|
1351
|
+
quarterTablePrompt: string;
|
|
1327
1352
|
yearTablePrompt: string;
|
|
1328
1353
|
selectedDate: string;
|
|
1329
1354
|
selectDate: string;
|
|
@@ -1382,6 +1407,9 @@ export declare const ELEMENT_LOCALES: {
|
|
|
1382
1407
|
dec: string;
|
|
1383
1408
|
};
|
|
1384
1409
|
};
|
|
1410
|
+
input: {
|
|
1411
|
+
characters: string;
|
|
1412
|
+
};
|
|
1385
1413
|
inputNumber: {
|
|
1386
1414
|
decrease: string;
|
|
1387
1415
|
increase: string;
|
|
@@ -1522,6 +1550,7 @@ export declare const ELEMENT_LOCALES: {
|
|
|
1522
1550
|
confirm: string;
|
|
1523
1551
|
dateTablePrompt: string;
|
|
1524
1552
|
monthTablePrompt: string;
|
|
1553
|
+
quarterTablePrompt: string;
|
|
1525
1554
|
yearTablePrompt: string;
|
|
1526
1555
|
selectedDate: string;
|
|
1527
1556
|
selectDate: string;
|
|
@@ -1580,6 +1609,9 @@ export declare const ELEMENT_LOCALES: {
|
|
|
1580
1609
|
dec: string;
|
|
1581
1610
|
};
|
|
1582
1611
|
};
|
|
1612
|
+
input: {
|
|
1613
|
+
characters: string;
|
|
1614
|
+
};
|
|
1583
1615
|
inputNumber: {
|
|
1584
1616
|
decrease: string;
|
|
1585
1617
|
increase: string;
|
|
@@ -1720,6 +1752,7 @@ export declare const ELEMENT_LOCALES: {
|
|
|
1720
1752
|
confirm: string;
|
|
1721
1753
|
dateTablePrompt: string;
|
|
1722
1754
|
monthTablePrompt: string;
|
|
1755
|
+
quarterTablePrompt: string;
|
|
1723
1756
|
yearTablePrompt: string;
|
|
1724
1757
|
selectedDate: string;
|
|
1725
1758
|
selectDate: string;
|
|
@@ -1778,6 +1811,9 @@ export declare const ELEMENT_LOCALES: {
|
|
|
1778
1811
|
dec: string;
|
|
1779
1812
|
};
|
|
1780
1813
|
};
|
|
1814
|
+
input: {
|
|
1815
|
+
characters: string;
|
|
1816
|
+
};
|
|
1781
1817
|
inputNumber: {
|
|
1782
1818
|
decrease: string;
|
|
1783
1819
|
increase: string;
|
|
@@ -1918,6 +1954,7 @@ export declare const ELEMENT_LOCALES: {
|
|
|
1918
1954
|
confirm: string;
|
|
1919
1955
|
dateTablePrompt: string;
|
|
1920
1956
|
monthTablePrompt: string;
|
|
1957
|
+
quarterTablePrompt: string;
|
|
1921
1958
|
yearTablePrompt: string;
|
|
1922
1959
|
selectedDate: string;
|
|
1923
1960
|
selectDate: string;
|
|
@@ -1976,6 +2013,9 @@ export declare const ELEMENT_LOCALES: {
|
|
|
1976
2013
|
dec: string;
|
|
1977
2014
|
};
|
|
1978
2015
|
};
|
|
2016
|
+
input: {
|
|
2017
|
+
characters: string;
|
|
2018
|
+
};
|
|
1979
2019
|
inputNumber: {
|
|
1980
2020
|
decrease: string;
|
|
1981
2021
|
increase: string;
|
|
@@ -37,9 +37,7 @@ export interface AdminUserMenuAction {
|
|
|
37
37
|
/** 操作唯一名称。 */
|
|
38
38
|
name: string;
|
|
39
39
|
/** 操作显示名称对应的稳定语言键。 */
|
|
40
|
-
labelKey
|
|
41
|
-
/** 兼容未迁移模块的静态显示名称。 */
|
|
42
|
-
label?: string;
|
|
40
|
+
labelKey: string;
|
|
43
41
|
/** 对应后端动态菜单名称,菜单不存在时不显示操作。 */
|
|
44
42
|
menuName: string;
|
|
45
43
|
/** 操作图标。 */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default } from "./utils/request";
|
|
2
|
-
export { ensureAccessToken, getRequestAccessToken, handleAuthExpired, hasValidAccessToken, requestBaseURL } from "./utils/request";
|
|
2
|
+
export { ensureAccessToken, getRequestAccessToken, handlePasswordChangeRequired, handleAuthExpired, hasValidAccessToken, clearPasswordChangeRequired, passwordChangeState, requestBaseURL } from "./utils/request";
|
|
3
3
|
export { getLocaleRequestHeaders } from "./locales";
|
|
@@ -13,7 +13,9 @@ export declare enum PasswordCryptoScene {
|
|
|
13
13
|
/** PASSWORD_CRYPTO_SCENE_UPDATE_USER_PASSWORD - 个人修改密码加密场景。 */
|
|
14
14
|
PASSWORD_CRYPTO_SCENE_UPDATE_USER_PASSWORD = 4,
|
|
15
15
|
/** PASSWORD_CRYPTO_SCENE_MFA - 多因素认证敏感操作场景。 */
|
|
16
|
-
PASSWORD_CRYPTO_SCENE_MFA = 5
|
|
16
|
+
PASSWORD_CRYPTO_SCENE_MFA = 5,
|
|
17
|
+
/** PASSWORD_CRYPTO_SCENE_CONFIGURE_PASSWORD_POLICY - 密码策略初始化密码配置场景。 */
|
|
18
|
+
PASSWORD_CRYPTO_SCENE_CONFIGURE_PASSWORD_POLICY = 6
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* LoginStatus 表示登录请求当前所处的认证阶段。
|
|
@@ -89,7 +91,7 @@ export interface RefreshTokenRequest {
|
|
|
89
91
|
export interface RefreshTokenResponse {
|
|
90
92
|
/** 访问令牌,必选项。 */
|
|
91
93
|
access_token: string;
|
|
92
|
-
/**
|
|
94
|
+
/** 更新令牌;管理端 Cookie-only 请求不在响应体返回,应用端请求可返回。 */
|
|
93
95
|
refresh_token: string;
|
|
94
96
|
/** 令牌类型,该值大小写不敏感,必选项,可以是bearer类型或mac类型。 */
|
|
95
97
|
token_type: string;
|
|
@@ -113,7 +115,7 @@ export interface LoginRequest {
|
|
|
113
115
|
export interface LoginResponse {
|
|
114
116
|
/** 访问令牌,必选项。 */
|
|
115
117
|
access_token: string;
|
|
116
|
-
/**
|
|
118
|
+
/** 更新令牌;管理端 Cookie-only 请求不在响应体返回,应用端请求可返回。 */
|
|
117
119
|
refresh_token: string;
|
|
118
120
|
/** 令牌类型,该值大小写不敏感,必选项,可以是bearer类型或mac类型。 */
|
|
119
121
|
token_type: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PasswordCrypto, StringValues } from "../../../common/v1/types";
|
|
2
2
|
import type { Empty } from "../../../google/protobuf/empty";
|
|
3
|
+
import type { BaseUserIDType } from "../../common/v1/common";
|
|
3
4
|
import type { BaseMenuType } from "./common";
|
|
4
5
|
/** 登录用户菜单树查询参数 */
|
|
5
6
|
export interface TreeUserMenuRequest {
|
|
@@ -23,6 +24,12 @@ export interface UserInfoForm {
|
|
|
23
24
|
nick_name: string;
|
|
24
25
|
/** 手机号 */
|
|
25
26
|
phone: string;
|
|
27
|
+
/** 邮箱 */
|
|
28
|
+
email: string;
|
|
29
|
+
/** 证件类型:枚举【BaseUserIDType】 */
|
|
30
|
+
id_type: BaseUserIDType;
|
|
31
|
+
/** 证件号 */
|
|
32
|
+
id_code: string;
|
|
26
33
|
/** 头像 */
|
|
27
34
|
avatar: string;
|
|
28
35
|
/** 角色编号 */
|
|
@@ -51,6 +58,12 @@ export interface UserProfileForm {
|
|
|
51
58
|
gender: number;
|
|
52
59
|
/** 手机号 */
|
|
53
60
|
phone: string;
|
|
61
|
+
/** 邮箱 */
|
|
62
|
+
email: string;
|
|
63
|
+
/** 证件类型:枚举【BaseUserIDType】 */
|
|
64
|
+
id_type: BaseUserIDType;
|
|
65
|
+
/** 证件号 */
|
|
66
|
+
id_code: string;
|
|
54
67
|
/** 角色名 */
|
|
55
68
|
role_name: string;
|
|
56
69
|
/** 部门名 */
|
|
@@ -47,26 +47,6 @@ export interface PageBaseDictResponse {
|
|
|
47
47
|
/** 总数 */
|
|
48
48
|
total: number;
|
|
49
49
|
}
|
|
50
|
-
/** 字典属性分页查询条件 */
|
|
51
|
-
export interface PageBaseDictItemRequest {
|
|
52
|
-
/** 字典ID */
|
|
53
|
-
dict_id: number;
|
|
54
|
-
/** 字典属性名称 */
|
|
55
|
-
label: string;
|
|
56
|
-
/** 状态 */
|
|
57
|
-
status?: Status | undefined;
|
|
58
|
-
/** 当前页码 */
|
|
59
|
-
page_num: number;
|
|
60
|
-
/** 每一页的行数 */
|
|
61
|
-
page_size: number;
|
|
62
|
-
}
|
|
63
|
-
/** 字典属性分页响应 */
|
|
64
|
-
export interface PageBaseDictItemResponse {
|
|
65
|
-
/** 分页数据 */
|
|
66
|
-
base_dict_items: BaseDictItem[];
|
|
67
|
-
/** 总数 */
|
|
68
|
-
total: number;
|
|
69
|
-
}
|
|
70
50
|
/** 查询字典请求参数 */
|
|
71
51
|
export interface GetBaseDictRequest {
|
|
72
52
|
/** 字典ID */
|
|
@@ -85,67 +65,21 @@ export interface BaseDictForm {
|
|
|
85
65
|
/** 状态 */
|
|
86
66
|
status: Status;
|
|
87
67
|
}
|
|
88
|
-
/** 查询字典属性请求参数 */
|
|
89
|
-
export interface GetBaseDictItemRequest {
|
|
90
|
-
/** 字典属性ID */
|
|
91
|
-
id: number;
|
|
92
|
-
}
|
|
93
|
-
/** 字典属性表单 */
|
|
94
|
-
export interface BaseDictItemForm {
|
|
95
|
-
/** 字典项ID */
|
|
96
|
-
id: number;
|
|
97
|
-
/** 字典ID */
|
|
98
|
-
dict_id: number;
|
|
99
|
-
/** 字典项值 */
|
|
100
|
-
value: string;
|
|
101
|
-
/** 字典项标签 */
|
|
102
|
-
label: string;
|
|
103
|
-
/** 标签类型,用于前端样式展示(如success、warning等) */
|
|
104
|
-
tag_type: string;
|
|
105
|
-
/** 排序 */
|
|
106
|
-
sort: number;
|
|
107
|
-
/** 非主语言翻译 */
|
|
108
|
-
i18ns: BaseI18n[];
|
|
109
|
-
/** 状态 */
|
|
110
|
-
status: Status;
|
|
111
|
-
}
|
|
112
68
|
/** 创建字典请求参数 */
|
|
113
69
|
export interface CreateBaseDictRequest {
|
|
114
70
|
/** 字典表单 */
|
|
115
71
|
base_dict: BaseDictForm | undefined;
|
|
116
72
|
}
|
|
117
|
-
/** 创建字典属性请求参数 */
|
|
118
|
-
export interface CreateBaseDictItemRequest {
|
|
119
|
-
/** 字典属性表单 */
|
|
120
|
-
base_dict_item: BaseDictItemForm | undefined;
|
|
121
|
-
}
|
|
122
73
|
/** 更新字典请求参数 */
|
|
123
74
|
export interface UpdateBaseDictRequest {
|
|
124
75
|
/** 字典表单 */
|
|
125
76
|
base_dict: BaseDictForm | undefined;
|
|
126
77
|
}
|
|
127
|
-
/** 更新字典属性请求参数 */
|
|
128
|
-
export interface UpdateBaseDictItemRequest {
|
|
129
|
-
/** 字典属性表单 */
|
|
130
|
-
base_dict_item: BaseDictItemForm | undefined;
|
|
131
|
-
}
|
|
132
78
|
/** 删除字典请求参数 */
|
|
133
79
|
export interface DeleteBaseDictRequest {
|
|
134
80
|
/** 字典ID列表 */
|
|
135
81
|
id: string;
|
|
136
82
|
}
|
|
137
|
-
/** 删除字典属性请求参数 */
|
|
138
|
-
export interface DeleteBaseDictItemRequest {
|
|
139
|
-
/** 字典属性ID列表 */
|
|
140
|
-
id: string;
|
|
141
|
-
}
|
|
142
|
-
/** 设置字典属性状态请求参数 */
|
|
143
|
-
export interface SetBaseDictItemStatusRequest {
|
|
144
|
-
/** 字典属性ID */
|
|
145
|
-
id: number;
|
|
146
|
-
/** 状态 */
|
|
147
|
-
status: number;
|
|
148
|
-
}
|
|
149
83
|
/** 设置字典状态请求参数 */
|
|
150
84
|
export interface SetBaseDictStatusRequest {
|
|
151
85
|
/** 字典ID */
|
|
@@ -170,55 +104,20 @@ export interface BaseDict {
|
|
|
170
104
|
/** 非主语言翻译 */
|
|
171
105
|
i18ns: BaseI18n[];
|
|
172
106
|
}
|
|
173
|
-
/** 字典项 */
|
|
174
|
-
export interface BaseDictItem {
|
|
175
|
-
/** 字典项ID */
|
|
176
|
-
id: number;
|
|
177
|
-
/** 字典ID */
|
|
178
|
-
dict_id: number;
|
|
179
|
-
/** 字典项值 */
|
|
180
|
-
value: string;
|
|
181
|
-
/** 字典项标签 */
|
|
182
|
-
label: string;
|
|
183
|
-
/** 标签类型,用于前端样式展示(如success、warning等) */
|
|
184
|
-
tag_type: string;
|
|
185
|
-
/** 排序 */
|
|
186
|
-
sort: number;
|
|
187
|
-
/** 状态 */
|
|
188
|
-
status: Status;
|
|
189
|
-
/** 创建时间 */
|
|
190
|
-
created_at: string;
|
|
191
|
-
/** 更新时间 */
|
|
192
|
-
updated_at: string;
|
|
193
|
-
/** 非主语言翻译 */
|
|
194
|
-
i18ns: BaseI18n[];
|
|
195
|
-
}
|
|
196
107
|
/** Admin字典服务 */
|
|
197
108
|
export interface BaseDictService {
|
|
198
109
|
/** 查询字典列表 */
|
|
199
110
|
OptionBaseDict(request: OptionBaseDictRequest): Promise<OptionBaseDictResponse>;
|
|
200
111
|
/** 查询字典分页列表 */
|
|
201
112
|
PageBaseDict(request: PageBaseDictRequest): Promise<PageBaseDictResponse>;
|
|
202
|
-
/** 查询字典属性分页列表 */
|
|
203
|
-
PageBaseDictItem(request: PageBaseDictItemRequest): Promise<PageBaseDictItemResponse>;
|
|
204
113
|
/** 查询字典 */
|
|
205
114
|
GetBaseDict(request: GetBaseDictRequest): Promise<BaseDictForm>;
|
|
206
|
-
/** 查询字典属性 */
|
|
207
|
-
GetBaseDictItem(request: GetBaseDictItemRequest): Promise<BaseDictItemForm>;
|
|
208
115
|
/** 创建字典 */
|
|
209
116
|
CreateBaseDict(request: CreateBaseDictRequest): Promise<Empty>;
|
|
210
|
-
/** 创建字典属性 */
|
|
211
|
-
CreateBaseDictItem(request: CreateBaseDictItemRequest): Promise<Empty>;
|
|
212
117
|
/** 更新字典 */
|
|
213
118
|
UpdateBaseDict(request: UpdateBaseDictRequest): Promise<Empty>;
|
|
214
|
-
/** 更新字典属性 */
|
|
215
|
-
UpdateBaseDictItem(request: UpdateBaseDictItemRequest): Promise<Empty>;
|
|
216
119
|
/** 删除字典 */
|
|
217
120
|
DeleteBaseDict(request: DeleteBaseDictRequest): Promise<Empty>;
|
|
218
|
-
/** 删除字典属性 */
|
|
219
|
-
DeleteBaseDictItem(request: DeleteBaseDictItemRequest): Promise<Empty>;
|
|
220
|
-
/** 设置状态 */
|
|
221
|
-
SetBaseDictItemStatus(request: SetBaseDictItemStatusRequest): Promise<Empty>;
|
|
222
121
|
/** 设置状态 */
|
|
223
122
|
SetBaseDictStatus(request: SetBaseDictStatusRequest): Promise<Empty>;
|
|
224
123
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** 系统公共用户相关枚举。 */
|
|
2
|
+
export declare enum BaseUserIDType {
|
|
3
|
+
/** BASE_USER_ID_TYPE_UNSPECIFIED - 未指定证件类型。 */
|
|
4
|
+
BASE_USER_ID_TYPE_UNSPECIFIED = 0,
|
|
5
|
+
/** BASE_USER_ID_TYPE_ID_CARD - 居民身份证。 */
|
|
6
|
+
BASE_USER_ID_TYPE_ID_CARD = 1,
|
|
7
|
+
/** BASE_USER_ID_TYPE_PASSPORT - 护照。 */
|
|
8
|
+
BASE_USER_ID_TYPE_PASSPORT = 2,
|
|
9
|
+
/** BASE_USER_ID_TYPE_HK_MACAO_PERMIT - 港澳居民来往内地通行证。 */
|
|
10
|
+
BASE_USER_ID_TYPE_HK_MACAO_PERMIT = 3,
|
|
11
|
+
/** BASE_USER_ID_TYPE_TAIWAN_PERMIT - 台湾居民来往大陆通行证。 */
|
|
12
|
+
BASE_USER_ID_TYPE_TAIWAN_PERMIT = 4,
|
|
13
|
+
/** BASE_USER_ID_TYPE_FOREIGN_PERMANENT_RESIDENCE - 外国人永久居留身份证。 */
|
|
14
|
+
BASE_USER_ID_TYPE_FOREIGN_PERMANENT_RESIDENCE = 5,
|
|
15
|
+
/** BASE_USER_ID_TYPE_OTHER - 其他证件。 */
|
|
16
|
+
BASE_USER_ID_TYPE_OTHER = 6
|
|
17
|
+
}
|
|
18
|
+
/** 用户密码修改状态。 */
|
|
19
|
+
export declare enum BaseUserPasswordChangeStatus {
|
|
20
|
+
/** BASE_USER_PASSWORD_CHANGE_STATUS_UNSPECIFIED - 未指定密码修改状态。 */
|
|
21
|
+
BASE_USER_PASSWORD_CHANGE_STATUS_UNSPECIFIED = 0,
|
|
22
|
+
/** BASE_USER_PASSWORD_CHANGE_STATUS_REQUIRED - 当前必须修改密码。 */
|
|
23
|
+
BASE_USER_PASSWORD_CHANGE_STATUS_REQUIRED = 1,
|
|
24
|
+
/** BASE_USER_PASSWORD_CHANGE_STATUS_NOT_REQUIRED - 当前无需修改密码。 */
|
|
25
|
+
BASE_USER_PASSWORD_CHANGE_STATUS_NOT_REQUIRED = 2
|
|
26
|
+
}
|
|
@@ -47,9 +47,14 @@ export interface GlobalState {
|
|
|
47
47
|
/** 当前登录用户认证状态。 */
|
|
48
48
|
export interface UserState {
|
|
49
49
|
token: string;
|
|
50
|
-
refreshToken: string;
|
|
51
50
|
tokenType: string;
|
|
52
51
|
tokenExpiresAt: number;
|
|
52
|
+
/** 是否正在执行退出登录,阻止后台请求刷新令牌。 */
|
|
53
|
+
isLoggingOut: boolean;
|
|
54
|
+
/** 认证状态版本,用于丢弃退出期间完成的旧刷新请求。 */
|
|
55
|
+
authVersion: number;
|
|
56
|
+
/** 当前认证是否已被本地显式清理。 */
|
|
57
|
+
authInvalidated: boolean;
|
|
53
58
|
userInfo: UserInfoForm;
|
|
54
59
|
}
|
|
55
60
|
/** 当前管理端锁屏状态。 */
|
|
@@ -5,8 +5,6 @@ import { UserState } from "../../stores/interface";
|
|
|
5
5
|
export declare const useUserStore: import("pinia").StoreDefinition<"admin-user", import("pinia").StateTree, {}, {
|
|
6
6
|
/** 设置访问令牌 */
|
|
7
7
|
setToken(token: string): void;
|
|
8
|
-
/** 设置刷新令牌 */
|
|
9
|
-
setRefreshToken(refreshToken: string): void;
|
|
10
8
|
/** 设置令牌类型 */
|
|
11
9
|
setTokenType(tokenType: string): void;
|
|
12
10
|
/** 设置令牌过期时间戳 */
|
|
@@ -14,14 +12,14 @@ export declare const useUserStore: import("pinia").StoreDefinition<"admin-user",
|
|
|
14
12
|
/** 设置用户信息 */
|
|
15
13
|
setUserInfo(userInfo: UserState["userInfo"]): void;
|
|
16
14
|
/** 根据接口返回统一更新令牌信息 */
|
|
17
|
-
updateTokenAuth(accessToken: string,
|
|
15
|
+
updateTokenAuth(accessToken: string, tokenType: string, expiresIn?: number): void;
|
|
18
16
|
/** 判断当前访问令牌是否仍然可用 */
|
|
19
17
|
isAuthenticated(): boolean;
|
|
20
18
|
/** 登录 */
|
|
21
19
|
login(loginRequest: LoginRequest): Promise<LoginResponse>;
|
|
22
20
|
/** 校验登录阶段的多因素认证并保存正式令牌。 */
|
|
23
21
|
verifyMfa(request: VerifyMfaRequest): Promise<LoginResponse>;
|
|
24
|
-
/**
|
|
22
|
+
/** 通过 HttpOnly Cookie 刷新认证令牌。 */
|
|
25
23
|
refreshAccessToken(): Promise<import("../../rpc/base/v1/login").RefreshTokenResponse>;
|
|
26
24
|
/** 获取用户信息 */
|
|
27
25
|
getUserInfo(): Promise<UserInfoForm>;
|
|
@@ -8,22 +8,11 @@ export interface PasswordStrengthResult {
|
|
|
8
8
|
strengthScore: number;
|
|
9
9
|
/** 强度等级。 */
|
|
10
10
|
level: PasswordStrengthLevel;
|
|
11
|
-
/** 是否达到允许提交的最高强度。 */
|
|
12
|
-
isValid: boolean;
|
|
13
11
|
}
|
|
14
12
|
/**
|
|
15
|
-
*
|
|
13
|
+
* 计算密码强度结果,供表单展示使用;最终规则由服务端密码策略校验。
|
|
16
14
|
*
|
|
17
15
|
* @param password 当前密码
|
|
18
16
|
* @returns 密码强度分析结果
|
|
19
17
|
*/
|
|
20
18
|
export declare function getPasswordStrength(password?: string): PasswordStrengthResult;
|
|
21
|
-
/**
|
|
22
|
-
* 校验密码是否达到最高强度,便于表单规则直接复用。
|
|
23
|
-
*
|
|
24
|
-
* @param password 当前密码
|
|
25
|
-
* @returns 校验结果
|
|
26
|
-
*/
|
|
27
|
-
export declare function validatePasswordStrengthValue(password?: string): {
|
|
28
|
-
valid: boolean;
|
|
29
|
-
};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
import { type AxiosRequestConfig } from "axios";
|
|
1
2
|
export declare const requestBaseURL: string;
|
|
2
|
-
|
|
3
|
+
/** 强制改密弹窗状态。 */
|
|
4
|
+
export declare const passwordChangeState: {
|
|
5
|
+
required: boolean;
|
|
6
|
+
message: string;
|
|
7
|
+
};
|
|
8
|
+
/** 处理强制改密响应,避免并发请求重复提示并打开全局改密弹窗。 */
|
|
9
|
+
export declare function handlePasswordChangeRequired(message: string): void;
|
|
10
|
+
/** 清理强制改密弹窗状态。 */
|
|
11
|
+
export declare function clearPasswordChangeRequired(): void;
|
|
3
12
|
/** 判断当前访问令牌是否仍在有效期内。 */
|
|
4
13
|
export declare function hasValidAccessToken(): boolean;
|
|
5
14
|
/** 读取最新可用访问令牌,必要时先串行刷新,供 axios、fetch 与 SSE 共用。 */
|
|
@@ -8,4 +17,6 @@ export declare function getRequestAccessToken(): Promise<string>;
|
|
|
8
17
|
export declare function ensureAccessToken(): Promise<boolean>;
|
|
9
18
|
/** 统一处理认证失效 */
|
|
10
19
|
export declare function handleAuthExpired(): void;
|
|
11
|
-
|
|
20
|
+
/** 以请求体、响应体顺序提供带类型约束的 HTTP 请求函数。 */
|
|
21
|
+
declare function request<Request = unknown, Response = unknown>(config: AxiosRequestConfig<Request>): Promise<Response>;
|
|
22
|
+
export default request;
|
|
@@ -10,3 +10,7 @@ export declare function formatPrice(price?: number): string;
|
|
|
10
10
|
* 按静态资源域名补齐图片地址。
|
|
11
11
|
*/
|
|
12
12
|
export declare function formatSrc(src: string): string;
|
|
13
|
+
/** 将对象路径转换为统一的数据访问路径。 */
|
|
14
|
+
export declare function normalizeStaticAssetPath(src: string): string;
|
|
15
|
+
/** 将富文本中的媒体路径转换为统一的数据访问路径。 */
|
|
16
|
+
export declare function normalizeRichTextMediaPaths(html: string): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import service from "
|
|
2
|
-
import type { ConfigService, GetConfigRequest, GetConfigResponse } from "
|
|
1
|
+
import service from "../../../utils/request";
|
|
2
|
+
import type { ConfigService, GetConfigRequest, GetConfigResponse } from "../../../rpc/base/v1/config";
|
|
3
3
|
|
|
4
4
|
const CONFIG_URL = "/v1/base/config";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import service from "
|
|
2
|
-
import type { DownloadFileRequest, MultiUploadFileResponse, FileInfo } from "
|
|
1
|
+
import service from "../../../utils/request";
|
|
2
|
+
import type { DownloadFileRequest, MultiUploadFileResponse, FileInfo } from "../../../rpc/base/v1/file";
|
|
3
3
|
|
|
4
4
|
const FILE_URL = "/v1/base/file";
|
|
5
5
|
|
|
@@ -35,33 +35,29 @@ export class FileServiceImpl {
|
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
+
|
|
39
|
+
/** 读取文件内容并返回 Blob。 */
|
|
40
|
+
async GetFileBlob(file: string, fileName: string): Promise<Blob> {
|
|
41
|
+
const response = await service<DownloadFileRequest, any>({
|
|
42
|
+
url: `${FILE_URL}`,
|
|
43
|
+
method: "get",
|
|
44
|
+
params: {
|
|
45
|
+
name: fileName,
|
|
46
|
+
path: file
|
|
47
|
+
} as DownloadFileRequest,
|
|
48
|
+
responseType: "blob"
|
|
49
|
+
});
|
|
50
|
+
return response.data instanceof Blob ? response.data : new Blob([response.data]);
|
|
51
|
+
}
|
|
52
|
+
|
|
38
53
|
/** 下载文件 */
|
|
39
|
-
async DownloadFile(file: string, fileName: string) {
|
|
54
|
+
async DownloadFile(file: string, fileName: string): Promise<void> {
|
|
40
55
|
try {
|
|
41
|
-
const response = await service<DownloadFileRequest, any>({
|
|
42
|
-
url: `${FILE_URL}`,
|
|
43
|
-
method: "get",
|
|
44
|
-
params: {
|
|
45
|
-
name: fileName,
|
|
46
|
-
path: file
|
|
47
|
-
} as DownloadFileRequest,
|
|
48
|
-
responseType: "blob" // 明确要求返回 Blob 类型
|
|
49
|
-
});
|
|
50
|
-
// 获取文件名
|
|
51
|
-
const contentDisposition = response.headers["content-disposition"];
|
|
52
|
-
let downloadFilename = fileName;
|
|
53
|
-
if (contentDisposition) {
|
|
54
|
-
const match = contentDisposition.match(/filename="?(.+?)"?$/);
|
|
55
|
-
if (match && match[1]) {
|
|
56
|
-
downloadFilename = match[1];
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
56
|
// 创建下载链接
|
|
61
|
-
const url = window.URL.createObjectURL(
|
|
57
|
+
const url = window.URL.createObjectURL(await this.GetFileBlob(file, fileName));
|
|
62
58
|
const a = document.createElement("a");
|
|
63
59
|
a.href = url;
|
|
64
|
-
a.download =
|
|
60
|
+
a.download = fileName;
|
|
65
61
|
document.body.appendChild(a);
|
|
66
62
|
a.click();
|
|
67
63
|
document.body.removeChild(a);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import service from "
|
|
2
|
-
import type { LanguageService, OptionLanguageRequest, OptionLanguageResponse } from "
|
|
1
|
+
import service from "../../../utils/request";
|
|
2
|
+
import type { LanguageService, OptionLanguageRequest, OptionLanguageResponse } from "../../../rpc/base/v1/language";
|
|
3
3
|
|
|
4
4
|
const LANGUAGE_URL = "/v1/base/language";
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import service from "
|
|
1
|
+
import service from "../../../utils/request";
|
|
2
2
|
import type {
|
|
3
3
|
CaptchaRequest,
|
|
4
4
|
CaptchaResponse,
|
|
@@ -12,8 +12,8 @@ import type {
|
|
|
12
12
|
VerifyCaptchaRequest,
|
|
13
13
|
VerifyCaptchaResponse,
|
|
14
14
|
LoginService
|
|
15
|
-
} from "
|
|
16
|
-
import type { Empty } from "
|
|
15
|
+
} from "../../../rpc/base/v1/login";
|
|
16
|
+
import type { Empty } from "../../../rpc/google/protobuf/empty";
|
|
17
17
|
|
|
18
18
|
const CAPTCHA_URL = "/v1/base/captcha";
|
|
19
19
|
const CAPTCHA_VERIFY_URL = "/v1/base/captcha/verify";
|