@liujitcn/kratos-admin-core 0.0.29 → 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.
Files changed (147) hide show
  1. package/README.md +15 -8
  2. package/build/auto-imports.json +73 -0
  3. package/build/plugins.ts +2 -58
  4. package/dist/package/declarations/src/api/base/{config.d.ts → v1/config.d.ts} +1 -1
  5. package/dist/package/declarations/src/api/base/{file.d.ts → v1/file.d.ts} +3 -1
  6. package/dist/package/declarations/src/api/base/{language.d.ts → v1/language.d.ts} +1 -1
  7. package/dist/package/declarations/src/api/base/{login.d.ts → v1/login.d.ts} +2 -2
  8. package/dist/package/declarations/src/api/base/v1/mfa.d.ts +26 -0
  9. package/dist/package/declarations/src/api/base/{oauth.d.ts → v1/oauth.d.ts} +1 -1
  10. package/dist/package/declarations/src/api/system/{auth.d.ts → admin/v1/auth.d.ts} +2 -2
  11. package/dist/package/declarations/src/api/system/{base_dict.d.ts → admin/v1/base_dict.d.ts} +1 -1
  12. package/dist/package/declarations/src/api/system/{base_tenant.d.ts → admin/v1/base_tenant.d.ts} +2 -2
  13. package/dist/package/declarations/src/components/Dialog/FormDialog.vue.d.ts +3 -3
  14. package/dist/package/declarations/src/components/Dialog/PasswordVerifyDialog.vue.d.ts +65 -0
  15. package/dist/package/declarations/src/components/Dialog/ProDialog.vue.d.ts +1 -1
  16. package/dist/package/declarations/src/components/Grid/components/GridItem.vue.d.ts +1 -1
  17. package/dist/package/declarations/src/components/Mfa/MfaRecoveryCodesDialog.vue.d.ts +19 -0
  18. package/dist/package/declarations/src/components/Mfa/MfaSetupPanel.vue.d.ts +8 -0
  19. package/dist/package/declarations/src/components/ProForm/components/ProFormItem.vue.d.ts +4 -4
  20. package/dist/package/declarations/src/components/ProForm/index.vue.d.ts +1 -1
  21. package/dist/package/declarations/src/components/ProForm/interface/index.d.ts +4 -1
  22. package/dist/package/declarations/src/components/ProTable/index.vue.d.ts +114 -0
  23. package/dist/package/declarations/src/components/RichTextPreview/index.vue.d.ts +8 -0
  24. package/dist/package/declarations/src/components/TreeFilter/index.vue.d.ts +84 -76
  25. package/dist/package/declarations/src/components/Upload/File.vue.d.ts +1 -1
  26. package/dist/package/declarations/src/components/Upload/Files.vue.d.ts +1 -1
  27. package/dist/package/declarations/src/components/Upload/Img.vue.d.ts +2 -2
  28. package/dist/package/declarations/src/components/Upload/Imgs.vue.d.ts +2 -2
  29. package/dist/package/declarations/src/components/WangEditor/index.vue.d.ts +2 -0
  30. package/dist/package/declarations/src/documentTitle.d.ts +2 -0
  31. package/dist/package/declarations/src/format.d.ts +1 -1
  32. package/dist/package/declarations/src/index.d.ts +2 -1
  33. package/dist/package/declarations/src/layouts/components/LockScreen.vue.d.ts +3 -0
  34. package/dist/package/declarations/src/locales/generated.d.ts +208 -0
  35. package/dist/package/declarations/src/locales/index.d.ts +2 -0
  36. package/dist/package/declarations/src/modules/index.d.ts +1 -3
  37. package/dist/package/declarations/src/request.d.ts +1 -1
  38. package/dist/package/declarations/src/routers/index.d.ts +1 -1
  39. package/dist/package/declarations/src/rpc/base/v1/login.d.ts +37 -5
  40. package/dist/package/declarations/src/rpc/base/v1/mfa.d.ts +152 -0
  41. package/dist/package/declarations/src/rpc/base/v1/oauth.d.ts +25 -0
  42. package/dist/package/declarations/src/rpc/base/v1/oauth_client.d.ts +23 -0
  43. package/dist/package/declarations/src/rpc/system/admin/v1/auth.d.ts +13 -0
  44. package/dist/package/declarations/src/rpc/system/admin/v1/base_dict.d.ts +0 -101
  45. package/dist/package/declarations/src/rpc/system/admin/v1/base_i18n.d.ts +10 -6
  46. package/dist/package/declarations/src/rpc/system/common/v1/common.d.ts +26 -0
  47. package/dist/package/declarations/src/security.d.ts +2 -0
  48. package/dist/package/declarations/src/stores/interface/index.d.ts +19 -1
  49. package/dist/package/declarations/src/stores/modules/lockScreen.d.ts +20 -0
  50. package/dist/package/declarations/src/stores/modules/user.d.ts +7 -6
  51. package/dist/package/declarations/src/stores/runtime.d.ts +1 -0
  52. package/dist/package/declarations/src/utils/clipboard.d.ts +2 -0
  53. package/dist/package/declarations/src/utils/passwordStrength.d.ts +1 -12
  54. package/dist/package/declarations/src/utils/request.d.ts +13 -2
  55. package/dist/package/declarations/src/utils/utils.d.ts +4 -0
  56. package/dist/package/declarations/src/utils/webauthn.d.ts +4 -0
  57. package/dist/package/declarations/vite.config.d.ts +2 -0
  58. package/dist/package/src/api/base/{config.ts → v1/config.ts} +2 -2
  59. package/dist/package/src/api/base/{file.ts → v1/file.ts} +20 -24
  60. package/dist/package/src/api/base/{language.ts → v1/language.ts} +2 -2
  61. package/dist/package/src/api/base/{login.ts → v1/login.ts} +3 -3
  62. package/dist/package/src/api/base/v1/mfa.ts +114 -0
  63. package/dist/package/src/api/base/{oauth.ts → v1/oauth.ts} +2 -2
  64. package/dist/package/src/api/system/{auth.ts → admin/v1/auth.ts} +3 -3
  65. package/dist/package/src/api/system/{base_dict.ts → admin/v1/base_dict.ts} +2 -2
  66. package/dist/package/src/api/system/{base_tenant.ts → admin/v1/base_tenant.ts} +3 -3
  67. package/dist/package/src/bootstrap.ts +6 -5
  68. package/dist/package/src/components/CronExpression/index.vue +4 -3
  69. package/dist/package/src/components/Dialog/PasswordVerifyDialog.vue +176 -0
  70. package/dist/package/src/components/Dialog/ProDialog.vue +1 -0
  71. package/dist/package/src/components/ImportExcel/index.vue +4 -2
  72. package/dist/package/src/components/Loading/fullScreen.ts +2 -1
  73. package/dist/package/src/components/MarkdownPreview/index.vue +22 -2
  74. package/dist/package/src/components/Mfa/MfaRecoveryCodesDialog.vue +91 -0
  75. package/dist/package/src/components/Mfa/MfaSetupPanel.vue +81 -0
  76. package/dist/package/src/components/PasswordStrength/index.vue +1 -1
  77. package/dist/package/src/components/ProForm/components/ProFormItem.vue +16 -1
  78. package/dist/package/src/components/ProForm/interface/index.ts +4 -0
  79. package/dist/package/src/components/ProTable/components/ColSetting.vue +1 -1
  80. package/dist/package/src/components/ProTable/components/TableColumn.vue +14 -6
  81. package/dist/package/src/components/ProTable/index.vue +9 -5
  82. package/dist/package/src/components/RichTextPreview/index.vue +56 -0
  83. package/dist/package/src/components/SelectIcon/index.vue +3 -2
  84. package/dist/package/src/components/Upload/File.vue +2 -2
  85. package/dist/package/src/components/Upload/Files.vue +2 -2
  86. package/dist/package/src/components/Upload/Img.vue +7 -5
  87. package/dist/package/src/components/Upload/Imgs.vue +6 -5
  88. package/dist/package/src/components/WangEditor/index.vue +10 -7
  89. package/dist/package/src/config/index.ts +1 -1
  90. package/dist/package/src/documentTitle.ts +8 -0
  91. package/dist/package/src/format.ts +1 -1
  92. package/dist/package/src/index.ts +2 -1
  93. package/dist/package/src/layouts/LayoutClassic/index.vue +3 -1
  94. package/dist/package/src/layouts/LayoutColumns/index.vue +3 -1
  95. package/dist/package/src/layouts/LayoutTransverse/index.vue +3 -1
  96. package/dist/package/src/layouts/LayoutVertical/index.vue +9 -1
  97. package/dist/package/src/layouts/components/Header/components/Avatar.vue +26 -6
  98. package/dist/package/src/layouts/components/Header/components/InfoDialog.vue +4 -3
  99. package/dist/package/src/layouts/components/Header/components/PasswordDialog.vue +4 -3
  100. package/dist/package/src/layouts/components/Header/components/SearchMenu.vue +16 -8
  101. package/dist/package/src/layouts/components/LockScreen.vue +573 -0
  102. package/dist/package/src/layouts/components/Tabs/index.vue +12 -3
  103. package/dist/package/src/layouts/components/ThemeDrawer/index.scss +4 -4
  104. package/dist/package/src/layouts/index.vue +2 -0
  105. package/dist/package/src/layouts/indexAsync.vue +2 -0
  106. package/dist/package/src/locales/README.md +2 -1
  107. package/dist/package/src/locales/en-US.json +51 -3
  108. package/dist/package/src/locales/index.ts +16 -12
  109. package/dist/package/src/locales/ja-JP.json +51 -3
  110. package/dist/package/src/locales/zh-CN.json +51 -3
  111. package/dist/package/src/locales/zh-TW.json +51 -3
  112. package/dist/package/src/modules/index.ts +2 -4
  113. package/dist/package/src/request.ts +3 -0
  114. package/dist/package/src/routers/index.ts +15 -14
  115. package/dist/package/src/rpc/base/v1/login.ts +37 -4
  116. package/dist/package/src/rpc/base/v1/mfa.ts +180 -0
  117. package/dist/package/src/rpc/base/v1/oauth.ts +25 -0
  118. package/dist/package/src/rpc/base/v1/oauth_client.ts +33 -0
  119. package/dist/package/src/rpc/system/admin/v1/auth.ts +13 -0
  120. package/dist/package/src/rpc/system/admin/v1/base_dict.ts +0 -112
  121. package/dist/package/src/rpc/system/admin/v1/base_i18n.ts +10 -6
  122. package/dist/package/src/rpc/system/common/v1/common.ts +35 -0
  123. package/dist/package/src/security.ts +2 -0
  124. package/dist/package/src/stores/interface/index.ts +20 -1
  125. package/dist/package/src/stores/modules/auth.ts +1 -1
  126. package/dist/package/src/stores/modules/config.ts +2 -2
  127. package/dist/package/src/stores/modules/dict.ts +1 -1
  128. package/dist/package/src/stores/modules/lockScreen.ts +78 -0
  129. package/dist/package/src/stores/modules/user.ts +34 -22
  130. package/dist/package/src/stores/runtime.ts +1 -0
  131. package/dist/package/src/styles/element.scss +35 -4
  132. package/dist/package/src/utils/clipboard.ts +22 -0
  133. package/dist/package/src/utils/passwordCrypto.ts +1 -1
  134. package/dist/package/src/utils/passwordStrength.ts +7 -24
  135. package/dist/package/src/utils/request.ts +175 -40
  136. package/dist/package/src/utils/tenant.ts +1 -1
  137. package/dist/package/src/utils/utils.ts +25 -6
  138. package/dist/package/src/utils/webauthn.ts +90 -0
  139. package/dist/package/src/views/login/components/LoginForm.vue +257 -24
  140. package/dist/package/src/views/login/index.scss +2 -2
  141. package/dist/package/src/views/login/index.vue +3 -1
  142. package/dist/package/types/generated/auto-imports.d.ts +132 -129
  143. package/dist/package/types/generated/components.d.ts +4 -72
  144. package/package.json +22 -1
  145. package/types/generated/auto-imports.d.ts +132 -129
  146. package/types/generated/components.d.ts +4 -72
  147. package/vite.config.ts +4 -1
@@ -0,0 +1,152 @@
1
+ import type { PasswordCrypto } from "../../common/v1/types";
2
+ import type { Empty } from "../../google/protobuf/empty";
3
+ import type { LoginResponse } from "./login";
4
+ /** 多因素认证校验请求。 */
5
+ export interface VerifyMfaRequest {
6
+ /** 多因素认证挑战ID */
7
+ challenge_id: string;
8
+ /** TOTP动态口令 */
9
+ code: string;
10
+ /** 一次性恢复码 */
11
+ recovery_code: string;
12
+ /** WebAuthn认证响应JSON */
13
+ webauthn_response_json: string;
14
+ }
15
+ /** 登录强制绑定多因素认证请求。 */
16
+ export interface BeginMfaEnrollmentRequest {
17
+ /** 强制绑定临时票据 */
18
+ setup_ticket: string;
19
+ }
20
+ /** 登录强制绑定多因素认证响应。 */
21
+ export interface BeginMfaEnrollmentResponse {
22
+ /** 绑定临时票据 */
23
+ setup_ticket: string;
24
+ /** Authenticator应用使用的otpauth地址 */
25
+ otpauth_uri: string;
26
+ /** 绑定临时票据有效时间,单位秒 */
27
+ expires_in: number;
28
+ /** 多因素认证方式:totp、webauthn */
29
+ method: string;
30
+ /** WebAuthn注册选项JSON */
31
+ webauthn_options_json: string;
32
+ }
33
+ /** 登录强制绑定多因素认证确认请求。 */
34
+ export interface ConfirmMfaEnrollmentRequest {
35
+ /** 绑定临时票据 */
36
+ setup_ticket: string;
37
+ /** TOTP动态口令 */
38
+ code: string;
39
+ /** WebAuthn注册响应JSON */
40
+ webauthn_response_json: string;
41
+ }
42
+ /** 登录强制绑定多因素认证确认响应。 */
43
+ export interface ConfirmMfaEnrollmentResponse {
44
+ /** 是否启用成功 */
45
+ enabled: boolean;
46
+ /** 一次性恢复码,仅本次返回 */
47
+ recovery_codes: string[];
48
+ }
49
+ /** 查询当前用户多因素认证状态请求。 */
50
+ export interface GetMfaStatusRequest {
51
+ }
52
+ /** 多因素认证状态响应。 */
53
+ export interface MfaStatusResponse {
54
+ /** 是否已启用多因素认证 */
55
+ enabled: boolean;
56
+ /** 全局多因素认证策略 */
57
+ policy: string;
58
+ /** 认证方式 */
59
+ method: string;
60
+ }
61
+ /** 开始绑定多因素认证请求。 */
62
+ export interface BeginMfaSetupRequest {
63
+ /** 当前登录密码 */
64
+ password: PasswordCrypto | undefined;
65
+ /** 强制绑定场景下的临时票据 */
66
+ setup_ticket: string;
67
+ }
68
+ /** 开始绑定多因素认证响应。 */
69
+ export interface BeginMfaSetupResponse {
70
+ /** 绑定临时票据 */
71
+ setup_ticket: string;
72
+ /** Authenticator 应用使用的 otpauth 地址 */
73
+ otpauth_uri: string;
74
+ /** 绑定临时票据有效时间,单位秒 */
75
+ expires_in: number;
76
+ /** 多因素认证方式:totp、webauthn */
77
+ method: string;
78
+ /** WebAuthn 注册选项 JSON */
79
+ webauthn_options_json: string;
80
+ }
81
+ /** 确认绑定多因素认证请求。 */
82
+ export interface ConfirmMfaSetupRequest {
83
+ /** 绑定临时票据 */
84
+ setup_ticket: string;
85
+ /** TOTP 动态口令 */
86
+ code: string;
87
+ /** WebAuthn 注册响应 JSON */
88
+ webauthn_response_json: string;
89
+ }
90
+ /** 确认绑定多因素认证响应。 */
91
+ export interface ConfirmMfaSetupResponse {
92
+ /** 是否启用成功 */
93
+ enabled: boolean;
94
+ /** 一次性恢复码,仅本次返回 */
95
+ recovery_codes: string[];
96
+ }
97
+ /** 开始禁用 WebAuthn 多因素认证请求。 */
98
+ export interface BeginMfaDisableRequest {
99
+ }
100
+ /** 开始禁用 WebAuthn 多因素认证响应。 */
101
+ export interface BeginMfaDisableResponse {
102
+ /** WebAuthn 禁用挑战 ID */
103
+ challenge_id: string;
104
+ /** WebAuthn 禁用挑战有效时间,单位秒 */
105
+ expires_in: number;
106
+ /** WebAuthn 验证选项 JSON */
107
+ webauthn_options_json: string;
108
+ }
109
+ /** 禁用多因素认证请求。 */
110
+ export interface DisableMfaRequest {
111
+ /** 当前登录密码 */
112
+ password: PasswordCrypto | undefined;
113
+ /** TOTP 动态口令 */
114
+ code: string;
115
+ /** WebAuthn 禁用挑战 ID */
116
+ webauthn_challenge_id: string;
117
+ /** WebAuthn 验证响应 JSON */
118
+ webauthn_response_json: string;
119
+ /** 一次性恢复码 */
120
+ recovery_code: string;
121
+ }
122
+ /** 重新生成恢复码请求。 */
123
+ export interface RegenerateMfaRecoveryCodesRequest {
124
+ /** TOTP 动态口令 */
125
+ code: string;
126
+ }
127
+ /** 恢复码响应。 */
128
+ export interface RecoveryCodesResponse {
129
+ /** 一次性恢复码,仅本次返回 */
130
+ recovery_codes: string[];
131
+ }
132
+ /** Base 多因素认证公共服务。 */
133
+ export interface MfaService {
134
+ /** 校验多因素认证 */
135
+ VerifyMfa(request: VerifyMfaRequest): Promise<LoginResponse>;
136
+ /** 开始登录强制绑定配置的 MFA 方式 */
137
+ BeginMfaEnrollment(request: BeginMfaEnrollmentRequest): Promise<BeginMfaEnrollmentResponse>;
138
+ /** 确认登录强制绑定配置的 MFA 方式 */
139
+ ConfirmMfaEnrollment(request: ConfirmMfaEnrollmentRequest): Promise<ConfirmMfaEnrollmentResponse>;
140
+ /** 查询当前用户多因素认证状态。 */
141
+ GetMfaStatus(request: GetMfaStatusRequest): Promise<MfaStatusResponse>;
142
+ /** 开始绑定当前用户的多因素认证方式。 */
143
+ BeginMfaSetup(request: BeginMfaSetupRequest): Promise<BeginMfaSetupResponse>;
144
+ /** 确认绑定当前用户的多因素认证方式。 */
145
+ ConfirmMfaSetup(request: ConfirmMfaSetupRequest): Promise<ConfirmMfaSetupResponse>;
146
+ /** 开始禁用 WebAuthn 多因素认证的 Passkey 验证。 */
147
+ BeginMfaDisable(request: BeginMfaDisableRequest): Promise<BeginMfaDisableResponse>;
148
+ /** 禁用当前用户的多因素认证。 */
149
+ DisableMfa(request: DisableMfaRequest): Promise<Empty>;
150
+ /** 重新生成当前用户的多因素认证恢复码。 */
151
+ RegenerateMfaRecoveryCodes(request: RegenerateMfaRecoveryCodesRequest): Promise<RecoveryCodesResponse>;
152
+ }
@@ -1,5 +1,6 @@
1
1
  import type { PasswordCrypto } from "../../common/v1/types";
2
2
  import type { Empty } from "../../google/protobuf/empty";
3
+ import type { LoginStatus } from "./login";
3
4
  /** 个人中心三方账号绑定列表查询条件 */
4
5
  export interface ListOauthBindingRequest {
5
6
  }
@@ -76,6 +77,18 @@ export interface CreateOauthSessionResponse {
76
77
  expires_in: number;
77
78
  /** 是否需要绑定已有账号。 */
78
79
  binding_required: boolean;
80
+ /** 登录认证状态 */
81
+ status: LoginStatus;
82
+ /** 多因素认证挑战ID */
83
+ mfa_challenge_id: string;
84
+ /** 多因素认证绑定临时票据 */
85
+ mfa_setup_ticket: string;
86
+ /** 多因素认证挑战或绑定票据有效时间,单位秒 */
87
+ mfa_expires_in: number;
88
+ /** 多因素认证方式:totp、webauthn */
89
+ mfa_method: string;
90
+ /** WebAuthn认证选项JSON */
91
+ mfa_webauthn_options_json: string;
79
92
  }
80
93
  /** 三方登录回调请求 */
81
94
  export interface HandleOauthCallbackRequest {
@@ -108,6 +121,18 @@ export interface ExchangeOauthTicketResponse {
108
121
  token_type: string;
109
122
  /** 令牌有效时间,单位为秒。 */
110
123
  expires_in: number;
124
+ /** 登录认证状态 */
125
+ status: LoginStatus;
126
+ /** 多因素认证挑战ID */
127
+ mfa_challenge_id: string;
128
+ /** 多因素认证绑定临时票据 */
129
+ mfa_setup_ticket: string;
130
+ /** 多因素认证挑战或绑定票据有效时间,单位秒 */
131
+ mfa_expires_in: number;
132
+ /** 多因素认证方式:totp、webauthn */
133
+ mfa_method: string;
134
+ /** WebAuthn认证选项JSON */
135
+ mfa_webauthn_options_json: string;
111
136
  }
112
137
  /** 个人中心三方账号绑定回调请求 */
113
138
  export interface HandleOauthBindingCallbackRequest {
@@ -0,0 +1,23 @@
1
+ /** 客户端凭据令牌请求。 */
2
+ export interface IssueOauthClientTokenRequest {
3
+ /** 客户端标识 */
4
+ client_id: string;
5
+ /** 客户端密钥 */
6
+ client_secret: string;
7
+ /** 授权类型 */
8
+ grant_type: string;
9
+ }
10
+ /** 客户端凭据令牌响应。 */
11
+ export interface IssueOauthClientTokenResponse {
12
+ /** 访问令牌 */
13
+ access_token: string;
14
+ /** 令牌类型 */
15
+ token_type: string;
16
+ /** 令牌有效时间,单位为秒 */
17
+ expires_in: number;
18
+ }
19
+ /** 开放授权客户端令牌服务。 */
20
+ export interface OauthClientService {
21
+ /** 使用客户端凭据换取访问令牌。 */
22
+ IssueOauthClientToken(request: IssueOauthClientTokenRequest): Promise<IssueOauthClientTokenResponse>;
23
+ }
@@ -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
  }
@@ -7,12 +7,16 @@ export declare enum I18nTargetType {
7
7
  I18N_TARGET_TYPE_BASE_CONFIG_VALUE = 1,
8
8
  /** I18N_TARGET_TYPE_BASE_CONFIG_NAME - 系统配置名称。 */
9
9
  I18N_TARGET_TYPE_BASE_CONFIG_NAME = 2,
10
- /** I18N_TARGET_TYPE_BASE_DICT - 字典名称。 */
11
- I18N_TARGET_TYPE_BASE_DICT = 3,
12
- /** I18N_TARGET_TYPE_BASE_DICT_ITEM - 字典项标签。 */
13
- I18N_TARGET_TYPE_BASE_DICT_ITEM = 4,
14
- /** I18N_TARGET_TYPE_BASE_MENU - 菜单标题。 */
15
- I18N_TARGET_TYPE_BASE_MENU = 5
10
+ /** I18N_TARGET_TYPE_BASE_DICT_NAME - 字典名称。 */
11
+ I18N_TARGET_TYPE_BASE_DICT_NAME = 3,
12
+ /** I18N_TARGET_TYPE_BASE_DICT_ITEM_LABEL - 字典项标签。 */
13
+ I18N_TARGET_TYPE_BASE_DICT_ITEM_LABEL = 4,
14
+ /** I18N_TARGET_TYPE_BASE_MENU_META_TITLE - 菜单标题。 */
15
+ I18N_TARGET_TYPE_BASE_MENU_META_TITLE = 5,
16
+ /** I18N_TARGET_TYPE_BASE_JOB_NAME - 定时任务名称。 */
17
+ I18N_TARGET_TYPE_BASE_JOB_NAME = 6,
18
+ /** I18N_TARGET_TYPE_BASE_MIGRATION_DESCRIPTION - 数据库迁移说明。 */
19
+ I18N_TARGET_TYPE_BASE_MIGRATION_DESCRIPTION = 7
16
20
  }
17
21
  /** 翻译单个文本请求。 */
18
22
  export interface DraftBaseI18nRequest {
@@ -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
+ }
@@ -1,3 +1,5 @@
1
1
  export * from "./utils/oauthProvider";
2
2
  export * from "./utils/passwordCrypto";
3
3
  export * from "./utils/passwordStrength";
4
+ export * from "./utils/webauthn";
5
+ export * from "./utils/clipboard";
@@ -47,11 +47,29 @@ 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
  }
60
+ /** 当前管理端锁屏状态。 */
61
+ export interface LockScreenState {
62
+ /** 是否处于锁屏状态。 */
63
+ isLocked: boolean;
64
+ /** 当前锁屏密码的摘要,仅在锁屏期间持久化。 */
65
+ passwordHash: string;
66
+ /** 是否显示设置锁屏密码界面。 */
67
+ setupVisible: boolean;
68
+ /** 是否显示解锁输入界面。 */
69
+ unlockVisible: boolean;
70
+ /** 最近一次解锁是否失败。 */
71
+ unlockError: boolean;
72
+ }
55
73
  /** 标签页菜单项状态。 */
56
74
  export interface TabsMenuProps {
57
75
  icon: string;
@@ -0,0 +1,20 @@
1
+ /** 管理端锁屏状态仓库。 */
2
+ export declare const useLockScreenStore: import("pinia").StoreDefinition<"admin-lock-screen", import("pinia").StateTree, {
3
+ /** 当前是否已配置可用于解锁的密码。 */
4
+ isConfigured: (state: import("pinia").StateTree & import("pinia").PiniaCustomStateProperties<import("pinia").StateTree>) => boolean;
5
+ }, {
6
+ /** 打开锁屏密码设置界面。 */
7
+ openSetup(): void;
8
+ /** 关闭锁屏密码设置界面。 */
9
+ closeSetup(): void;
10
+ /** 设置锁屏密码并立即进入锁屏状态。 */
11
+ lock(password: string): Promise<void>;
12
+ /** 打开锁屏解锁输入界面。 */
13
+ openUnlock(): void;
14
+ /** 返回锁屏首页。 */
15
+ closeUnlock(): void;
16
+ /** 校验锁屏密码,成功后解除当前锁定。 */
17
+ unlock(password: string): Promise<boolean>;
18
+ /** 清理锁屏状态,供退出登录时使用。 */
19
+ clearLock(): void;
20
+ }>;
@@ -1,11 +1,10 @@
1
- import type { LoginRequest } from "../../rpc/base/v1/login";
1
+ import type { LoginRequest, LoginResponse } from "../../rpc/base/v1/login";
2
+ import type { VerifyMfaRequest } from "../../rpc/base/v1/mfa";
2
3
  import type { UserInfoForm } from "../../rpc/system/admin/v1/auth";
3
4
  import { UserState } from "../../stores/interface";
4
5
  export declare const useUserStore: import("pinia").StoreDefinition<"admin-user", import("pinia").StateTree, {}, {
5
6
  /** 设置访问令牌 */
6
7
  setToken(token: string): void;
7
- /** 设置刷新令牌 */
8
- setRefreshToken(refreshToken: string): void;
9
8
  /** 设置令牌类型 */
10
9
  setTokenType(tokenType: string): void;
11
10
  /** 设置令牌过期时间戳 */
@@ -13,12 +12,14 @@ export declare const useUserStore: import("pinia").StoreDefinition<"admin-user",
13
12
  /** 设置用户信息 */
14
13
  setUserInfo(userInfo: UserState["userInfo"]): void;
15
14
  /** 根据接口返回统一更新令牌信息 */
16
- updateTokenAuth(accessToken: string, refreshToken: string, tokenType: string, expiresIn?: number): void;
15
+ updateTokenAuth(accessToken: string, tokenType: string, expiresIn?: number): void;
17
16
  /** 判断当前访问令牌是否仍然可用 */
18
17
  isAuthenticated(): boolean;
19
18
  /** 登录 */
20
- login(loginRequest: LoginRequest): Promise<void>;
21
- /** 刷新认证令牌 */
19
+ login(loginRequest: LoginRequest): Promise<LoginResponse>;
20
+ /** 校验登录阶段的多因素认证并保存正式令牌。 */
21
+ verifyMfa(request: VerifyMfaRequest): Promise<LoginResponse>;
22
+ /** 通过 HttpOnly Cookie 刷新认证令牌。 */
22
23
  refreshAccessToken(): Promise<import("../../rpc/base/v1/login").RefreshTokenResponse>;
23
24
  /** 获取用户信息 */
24
25
  getUserInfo(): Promise<UserInfoForm>;
@@ -1,5 +1,6 @@
1
1
  export { useAuthStore } from "./modules/auth";
2
2
  export { useConfigStore } from "./modules/config";
3
3
  export { useGlobalStore } from "./modules/global";
4
+ export { useLockScreenStore } from "./modules/lockScreen";
4
5
  export { useTabsStore } from "./modules/tabs";
5
6
  export { useUserStore } from "./modules/user";
@@ -0,0 +1,2 @@
1
+ /** 将文本复制到系统剪贴板,并兼容非安全上下文的管理端开发地址。 */
2
+ export declare function copyText(content: string): Promise<void>;
@@ -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
- declare const service: import("axios").AxiosInstance;
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
- export default service;
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;
@@ -0,0 +1,4 @@
1
+ /** 执行 WebAuthn 注册 ceremony。 */
2
+ export declare function createWebAuthnCredential(optionsJson: string): Promise<string>;
3
+ /** 执行 WebAuthn 登录 ceremony。 */
4
+ export declare function getWebAuthnAssertion(optionsJson: string): Promise<string>;
@@ -6,6 +6,8 @@ export interface AdminViteConfigOptions {
6
6
  optimizeDependencies?: string[];
7
7
  /** 静态资源构建输出目录。 */
8
8
  outputDirectory?: string;
9
+ /** 自动组件声明输出位置,外部宿主默认不写入依赖包。 */
10
+ componentDts?: string | false;
9
11
  }
10
12
  /** 创建管理端宿主 Vite 配置。 */
11
13
  export declare function defineAdminViteConfig(options?: AdminViteConfigOptions): import("vite").UserConfigFnObject;
@@ -1,5 +1,5 @@
1
- import service from "../../utils/request";
2
- import type { ConfigService, GetConfigRequest, GetConfigResponse } from "../../rpc/base/v1/config";
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