@liujitcn/kratos-admin-system 0.0.65 → 0.0.67
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 +5 -3
- package/dist/package/declarations/src/api/base/v1/ai_knowledge.d.ts +7 -0
- package/dist/package/declarations/src/api/system/admin/v1/ai_provider.d.ts +3 -1
- package/dist/package/declarations/src/api/system/admin/v1/ai_query.d.ts +10 -0
- package/dist/package/declarations/src/api/system/admin/v1/ai_session.d.ts +9 -0
- package/dist/package/declarations/src/locales/generated.d.ts +1805 -1553
- package/dist/package/declarations/src/rpc/base/v1/ai_knowledge.d.ts +22 -0
- package/dist/package/declarations/src/rpc/base/v1/ai_message.d.ts +2 -0
- package/dist/package/declarations/src/rpc/base/v1/login.d.ts +2 -39
- package/dist/package/declarations/src/rpc/base/v1/oauth.d.ts +2 -2
- package/dist/package/declarations/src/rpc/common/v1/types.d.ts +4 -4
- package/dist/package/declarations/src/rpc/system/admin/v1/ai_provider.d.ts +66 -7
- package/dist/package/declarations/src/rpc/system/admin/v1/ai_query.d.ts +73 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/ai_session.d.ts +114 -0
- package/dist/package/declarations/src/rpc/system/admin/v1/auth.d.ts +3 -3
- package/dist/package/declarations/src/rpc/system/admin/v1/base_config.d.ts +4 -3
- package/dist/package/declarations/src/rpc/system/admin/v1/base_login_policy.d.ts +2 -2
- package/dist/package/declarations/src/rpc/system/admin/v1/base_message_provider.d.ts +3 -2
- package/dist/package/declarations/src/rpc/system/admin/v1/base_oauth_provider.d.ts +3 -2
- package/dist/package/declarations/src/rpc/system/admin/v1/base_user.d.ts +3 -3
- package/dist/package/declarations/src/views/ai/chat/components/ChatPanel.vue.d.ts +9 -2
- package/dist/package/declarations/src/views/ai/chat/components/XSender.vue.d.ts +7 -0
- package/dist/package/declarations/src/views/ai/query/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/ai/session/index.vue.d.ts +3 -0
- package/dist/package/src/api/base/v1/ai_knowledge.ts +22 -0
- package/dist/package/src/api/system/admin/v1/ai_provider.ts +7 -0
- package/dist/package/src/api/system/admin/v1/ai_query.ts +25 -0
- package/dist/package/src/api/system/admin/v1/ai_session.ts +25 -0
- package/dist/package/src/components/account/ChangePasswordForm.vue +7 -5
- package/dist/package/src/components/tenant-project/TenantProjectSelect.vue +21 -4
- package/dist/package/src/locales/README.md +1 -1
- package/dist/package/src/locales/en-US.json +355 -292
- package/dist/package/src/locales/ja-JP.json +352 -289
- package/dist/package/src/locales/zh-CN.json +352 -289
- package/dist/package/src/locales/zh-TW.json +352 -289
- package/dist/package/src/module.ts +8 -0
- package/dist/package/src/rpc/base/v1/ai_knowledge.ts +33 -0
- package/dist/package/src/rpc/base/v1/ai_message.ts +2 -0
- package/dist/package/src/rpc/base/v1/login.ts +2 -42
- package/dist/package/src/rpc/base/v1/oauth.ts +2 -2
- package/dist/package/src/rpc/common/v1/types.ts +4 -4
- package/dist/package/src/rpc/system/admin/v1/ai_provider.ts +73 -7
- package/dist/package/src/rpc/system/admin/v1/ai_query.ts +89 -0
- package/dist/package/src/rpc/system/admin/v1/ai_session.ts +131 -0
- package/dist/package/src/rpc/system/admin/v1/auth.ts +3 -3
- package/dist/package/src/rpc/system/admin/v1/base_config.ts +6 -3
- package/dist/package/src/rpc/system/admin/v1/base_login_policy.ts +2 -2
- package/dist/package/src/rpc/system/admin/v1/base_message_provider.ts +5 -2
- package/dist/package/src/rpc/system/admin/v1/base_oauth_provider.ts +5 -2
- package/dist/package/src/rpc/system/admin/v1/base_user.ts +3 -3
- package/dist/package/src/views/ai/chat/components/ChatPanel.vue +18 -0
- package/dist/package/src/views/ai/chat/components/XSender.vue +102 -0
- package/dist/package/src/views/ai/chat/index.vue +22 -2
- package/dist/package/src/views/ai/query/index.vue +222 -0
- package/dist/package/src/views/ai/session/index.vue +422 -0
- package/dist/package/src/views/base/ai-provider/index.vue +216 -169
- package/dist/package/src/views/base/config/index.vue +9 -9
- package/dist/package/src/views/base/login-policy/index.vue +2 -2
- package/dist/package/src/views/base/message-provider/index.vue +7 -5
- package/dist/package/src/views/base/oauth-provider/index.vue +10 -7
- package/dist/package/src/views/base/tenant-project-grant/index.vue +9 -4
- package/dist/package/src/views/base/user/index.vue +3 -3
- package/dist/package/src/views/profile/components/security.vue +4 -5
- package/dist/package/src/views/tool/code-gen/config.ts +2 -0
- package/package.json +2 -2
|
@@ -144,6 +144,7 @@ import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
|
|
|
144
144
|
import { BaseConfigType } from "@liujitcn/kratos-admin-system/rpc/system/admin/v1/base_config";
|
|
145
145
|
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
146
146
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
147
|
+
import { encryptSecret } from "@liujitcn/kratos-admin-core/security";
|
|
147
148
|
import DynamicI18nEditor from "@liujitcn/kratos-admin-system/components/i18n/DynamicI18nEditor.vue";
|
|
148
149
|
import DynamicI18nCell from "@liujitcn/kratos-admin-system/components/i18n/DynamicI18nCell.vue";
|
|
149
150
|
import {
|
|
@@ -153,11 +154,13 @@ import {
|
|
|
153
154
|
} from "@liujitcn/kratos-admin-system/components/i18n/dynamicI18n";
|
|
154
155
|
|
|
155
156
|
/** 系统配置编辑表单状态,新增时枚举字段保持为空,避免把未知值 0 显示为下拉文本。 */
|
|
156
|
-
type BaseConfigFormState = Omit<BaseConfigForm, "site" | "type"> & {
|
|
157
|
+
type BaseConfigFormState = Omit<BaseConfigForm, "site" | "type" | "value"> & {
|
|
157
158
|
/** 配置位置。 */
|
|
158
159
|
site?: BaseConfigSite;
|
|
159
160
|
/** 配置类型。 */
|
|
160
161
|
type?: BaseConfigType;
|
|
162
|
+
/** 配置值编辑缓冲,提交时统一加密为 SecretCrypto。 */
|
|
163
|
+
value: string;
|
|
161
164
|
};
|
|
162
165
|
|
|
163
166
|
defineOptions({
|
|
@@ -337,13 +340,6 @@ const rules = computed(() => ({
|
|
|
337
340
|
trigger: "blur"
|
|
338
341
|
}
|
|
339
342
|
],
|
|
340
|
-
value: [
|
|
341
|
-
{
|
|
342
|
-
required: true,
|
|
343
|
-
message: t("common.validation.required_input", { field: t("system.base.config.field.value") }),
|
|
344
|
-
trigger: "blur"
|
|
345
|
-
}
|
|
346
|
-
],
|
|
347
343
|
status: [
|
|
348
344
|
{
|
|
349
345
|
required: true,
|
|
@@ -661,6 +657,8 @@ async function handleOpenDialog(configId?: number) {
|
|
|
661
657
|
commit: ({ data }) => {
|
|
662
658
|
if (data) {
|
|
663
659
|
Object.assign(formData, data);
|
|
660
|
+
// 契约中 value 为 SecretCrypto,编辑缓冲取解密后的明文或脱敏文本。
|
|
661
|
+
formData.value = data.value?.text ?? "";
|
|
664
662
|
if (formData.type === BaseConfigType.BASE_CONFIG_TYPE_FORM) loadFormValue(formData.value);
|
|
665
663
|
}
|
|
666
664
|
activeTab.value = configId && formData.type === BaseConfigType.BASE_CONFIG_TYPE_FORM ? "form" : "basic";
|
|
@@ -774,6 +772,8 @@ async function handleSubmit() {
|
|
|
774
772
|
saving.value = true;
|
|
775
773
|
try {
|
|
776
774
|
const submitData = JSON.parse(JSON.stringify(formData)) as BaseConfigForm;
|
|
775
|
+
// 配置值统一密文提交,留空表示保留现有值。
|
|
776
|
+
submitData.value = formData.value.trim() !== "" ? await encryptSecret(formData.value) : undefined;
|
|
777
777
|
submitData.name_i18ns = serializeDynamicI18ns(
|
|
778
778
|
nameI18nValues.value,
|
|
779
779
|
"base_config.name",
|
|
@@ -786,7 +786,7 @@ async function handleSubmit() {
|
|
|
786
786
|
valueI18nValues.value,
|
|
787
787
|
"base_config.value",
|
|
788
788
|
submitData.id,
|
|
789
|
-
|
|
789
|
+
formData.value
|
|
790
790
|
)
|
|
791
791
|
: [];
|
|
792
792
|
|
|
@@ -74,7 +74,7 @@ import type { ColumnProps, HeaderActionProps, ProTableInstance } from "@liujitcn
|
|
|
74
74
|
import type { ProFormField, ProFormOption } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
75
75
|
import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
76
76
|
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
77
|
-
import {
|
|
77
|
+
import { encryptPassword } from "@liujitcn/kratos-admin-core/security";
|
|
78
78
|
import { useTenantScope } from "@liujitcn/kratos-admin-core/tenant";
|
|
79
79
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
80
80
|
import { defBaseLoginPolicyService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_login_policy";
|
|
@@ -490,7 +490,7 @@ async function handleSubmit() {
|
|
|
490
490
|
tenant_id: formData.tenant_id ?? 0,
|
|
491
491
|
user_id: formData.user_id ?? 0,
|
|
492
492
|
initial_password: formData.initial_password
|
|
493
|
-
? await encryptPassword(formData.initial_password,
|
|
493
|
+
? await encryptPassword(formData.initial_password, )
|
|
494
494
|
: undefined
|
|
495
495
|
};
|
|
496
496
|
if (formData.id) await defBaseLoginPolicyService.UpdateBaseLoginPolicy({ base_login_policy: baseLoginPolicy });
|
|
@@ -27,6 +27,7 @@ import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
|
27
27
|
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
28
28
|
import { useTenantScope } from "@liujitcn/kratos-admin-core/tenant";
|
|
29
29
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
30
|
+
import { encodeSecretFields } from "@liujitcn/kratos-admin-core/security";
|
|
30
31
|
import { defBaseMessageProviderService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_message_provider";
|
|
31
32
|
import type {
|
|
32
33
|
BaseMessageProvider,
|
|
@@ -68,8 +69,8 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
68
69
|
{ prop: "name", label: t("system.base.message_provider.field.name"), component: "input", props: { maxlength: 50 } },
|
|
69
70
|
{ prop: "description", label: t("system.base.message_provider.field.description"), component: "input", colSpan: 24, props: { maxlength: 255 } },
|
|
70
71
|
{ prop: "icon", label: t("system.base.message_provider.field.icon"), component: "input", props: { maxlength: 100 } },
|
|
71
|
-
{ prop: "client_id", label: t("system.base.message_provider.field.client_id"), component: "input", props: { maxlength: 255 } },
|
|
72
|
-
{ prop: "client_secret", label: t("system.base.message_provider.field.client_secret"), component: "input", props: { type: "password", showPassword: true, maxlength: 1024, placeholder: dialog.editing ? t("system.base.message_provider.placeholder.keep_secret") : "" } },
|
|
72
|
+
{ prop: "client_id", label: t("system.base.message_provider.field.client_id"), component: "input", props: { maxlength: 255, autocomplete: "off" } },
|
|
73
|
+
{ prop: "client_secret", label: t("system.base.message_provider.field.client_secret"), component: "input", secret: { resource: "base_message_provider", field: "client_secret" }, props: { type: "password", showPassword: true, maxlength: 1024, autocomplete: "new-password", placeholder: dialog.editing ? t("system.base.message_provider.placeholder.keep_secret") : "" } },
|
|
73
74
|
{ prop: "config_items", label: t("system.base.message_provider.field.config"), component: "kv-list", props: { keyInputProps: { maxlength: 128 } } },
|
|
74
75
|
{ prop: "sort", label: t("common.field.sort"), component: "input-number", props: { min: 0, precision: 0 } },
|
|
75
76
|
{ prop: "status", label: t("common.field.status"), component: "radio-group", options: statusOptions.value }
|
|
@@ -99,7 +100,7 @@ const headerActions = computed<HeaderActionProps[]>(() => [
|
|
|
99
100
|
]);
|
|
100
101
|
|
|
101
102
|
function defaultForm(): FormState {
|
|
102
|
-
return { id: 0, provider: "", name: "", description: "", icon: "", client_id: "", client_secret:
|
|
103
|
+
return { id: 0, provider: "", name: "", description: "", icon: "", client_id: "", client_secret: undefined, secret_configured: false, config: {}, config_items: [], sort: 0, status: Status.STATUS_DISABLE };
|
|
103
104
|
}
|
|
104
105
|
|
|
105
106
|
async function requestTable(params: Record<string, unknown>) {
|
|
@@ -121,8 +122,9 @@ async function handleSubmit() {
|
|
|
121
122
|
const payload = JSON.parse(JSON.stringify(formData)) as BaseMessageProviderForm & { config_items?: ConfigItem[] };
|
|
122
123
|
delete payload.config_items;
|
|
123
124
|
payload.config = config;
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
const form = await encodeSecretFields(formFields.value, payload) as BaseMessageProviderForm;
|
|
126
|
+
if (form.id) await defBaseMessageProviderService.UpdateBaseMessageProvider({ base_message_provider: form });
|
|
127
|
+
else await defBaseMessageProviderService.CreateBaseMessageProvider({ base_message_provider: form });
|
|
126
128
|
ElMessage.success(t("common.message.operation_success"));
|
|
127
129
|
dialog.visible = false;
|
|
128
130
|
await proTable.value?.getTableList();
|
|
@@ -39,6 +39,7 @@ import { useAuthButtons } from "@liujitcn/kratos-admin-core/auth";
|
|
|
39
39
|
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
40
40
|
import { useTenantScope } from "@liujitcn/kratos-admin-core/tenant";
|
|
41
41
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
42
|
+
import { encodeSecretFields } from "@liujitcn/kratos-admin-core/security";
|
|
42
43
|
import { defBaseOauthProviderService } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_oauth_provider";
|
|
43
44
|
import { loadEnabledBaseLanguages } from "@liujitcn/kratos-admin-system/api/system/admin/v1/base_language";
|
|
44
45
|
import type {
|
|
@@ -102,8 +103,8 @@ const formFields = computed<ProFormField[]>(() => [
|
|
|
102
103
|
{ prop: "name", suffixSlotName: "nameI18ns", label: t("system.base.oauth_provider.field.name"), component: "input", colSpan: 12, props: { maxlength: 50, placeholder: t("system.base.oauth_provider.placeholder.name") } },
|
|
103
104
|
{ prop: "description", suffixSlotName: "descriptionI18ns", label: t("system.base.oauth_provider.field.description"), component: "input", colSpan: 24, props: { maxlength: 255, placeholder: t("system.base.oauth_provider.placeholder.description") } },
|
|
104
105
|
{ prop: "icon", label: t("system.base.oauth_provider.field.icon"), component: "input", colSpan: 12, props: { maxlength: 255, placeholder: t("system.base.oauth_provider.placeholder.icon") } },
|
|
105
|
-
{ prop: "client_id", label: t("system.base.oauth_provider.field.client_id"), component: "input", colSpan: 12, props: { maxlength: 255, placeholder: t("system.base.oauth_provider.placeholder.client_id") } },
|
|
106
|
-
{ prop: "client_secret", label: t("system.base.oauth_provider.field.client_secret"), component: "input", colSpan: 12, props: { type: "password", showPassword: true, maxlength: 512, placeholder: dialog.editing ? t("system.base.oauth_provider.placeholder.keep_secret") : t("system.base.oauth_provider.placeholder.client_secret") } },
|
|
106
|
+
{ prop: "client_id", label: t("system.base.oauth_provider.field.client_id"), component: "input", colSpan: 12, props: { maxlength: 255, autocomplete: "off", placeholder: t("system.base.oauth_provider.placeholder.client_id") } },
|
|
107
|
+
{ prop: "client_secret", label: t("system.base.oauth_provider.field.client_secret"), component: "input", colSpan: 12, secret: { resource: "base_oauth_provider", field: "client_secret" }, props: { type: "password", showPassword: true, maxlength: 512, autocomplete: "new-password", placeholder: dialog.editing ? t("system.base.oauth_provider.placeholder.keep_secret") : t("system.base.oauth_provider.placeholder.client_secret") } },
|
|
107
108
|
{ prop: "redirect_uri", label: t("system.base.oauth_provider.field.redirect_uri"), component: "input", colSpan: 12, props: { maxlength: 512, placeholder: t("system.base.oauth_provider.placeholder.redirect_uri") } },
|
|
108
109
|
{ prop: "scopes", label: t("system.base.oauth_provider.field.scopes"), component: "dynamic-list", colSpan: 12, props: { inputProps: { maxlength: 128, placeholder: t("system.base.oauth_provider.placeholder.scopes") } } },
|
|
109
110
|
{ prop: "config_items", label: t("system.base.oauth_provider.field.config"), component: "kv-list", colSpan: 12, props: { keyInputProps: { maxlength: 128 } } },
|
|
@@ -152,7 +153,7 @@ const headerActions = computed<HeaderActionProps[]>(() => [
|
|
|
152
153
|
|
|
153
154
|
/** 创建默认 OAuth 登录方式表单。 */
|
|
154
155
|
function defaultForm(): OauthProviderFormState {
|
|
155
|
-
return { id: 0, provider: "", name: "", description: "", icon: "", client_id: "", client_secret:
|
|
156
|
+
return { id: 0, provider: "", name: "", description: "", icon: "", client_id: "", client_secret: undefined, secret_configured: false, redirect_uri: "", scopes: [], config: {}, config_items: [], sort: 0, status: Status.STATUS_DISABLE, name_i18ns: [], description_i18ns: [] };
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
/** 请求 OAuth 登录方式表格数据。 */
|
|
@@ -185,11 +186,13 @@ async function handleSubmit() {
|
|
|
185
186
|
const payload = JSON.parse(JSON.stringify(formData)) as BaseOauthProviderForm & { config_items?: OauthProviderConfigItem[] };
|
|
186
187
|
delete payload.config_items;
|
|
187
188
|
payload.config = config;
|
|
189
|
+
const source = await encodeSecretFields(formFields.value, payload);
|
|
188
190
|
payload.scopes = [...new Set(formData.scopes.map(value => value.trim()).filter(Boolean))];
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
source.name_i18ns = serializeDynamicI18ns(nameI18nValues.value, "base_oauth_provider.name", source.id, source.name);
|
|
192
|
+
source.description_i18ns = serializeDynamicI18ns(descriptionI18nValues.value, "base_oauth_provider.description", source.id, source.name);
|
|
193
|
+
const form = source as BaseOauthProviderForm;
|
|
194
|
+
if (form.id) await defBaseOauthProviderService.UpdateBaseOauthProvider({ base_oauth_provider: form });
|
|
195
|
+
else await defBaseOauthProviderService.CreateBaseOauthProvider({ base_oauth_provider: form });
|
|
193
196
|
ElMessage.success(t("common.message.operation_success"));
|
|
194
197
|
dialog.visible = false;
|
|
195
198
|
await proTable.value?.getTableList();
|
|
@@ -150,9 +150,12 @@ const columns = computed<ColumnProps[]>(() => [
|
|
|
150
150
|
showOverflowTooltip: true,
|
|
151
151
|
render: scope => {
|
|
152
152
|
const row = scope.row as BaseTenantProjectGrant;
|
|
153
|
-
|
|
153
|
+
// proto3 JSON 会省略空数组字段,project_id / project_names 可能为 undefined。
|
|
154
|
+
const projectIds = row.project_id ?? [];
|
|
155
|
+
const projectNames = row.project_names ?? [];
|
|
156
|
+
return projectIds.length === 1 && projectIds[0] === 0
|
|
154
157
|
? t("system.base.tenant_project_grant.all_projects")
|
|
155
|
-
:
|
|
158
|
+
: projectNames.join(", ") || projectIds.join(", ") || t("common.value.none");
|
|
156
159
|
}
|
|
157
160
|
},
|
|
158
161
|
{
|
|
@@ -213,12 +216,14 @@ async function handleOpenDialog(row?: BaseTenantProjectGrant) {
|
|
|
213
216
|
await formDialogRef.value?.open({
|
|
214
217
|
load: async () => {
|
|
215
218
|
await loadTenantOptions(true);
|
|
219
|
+
// proto3 JSON 会省略空数组字段,行数据里的 project_id 可能为 undefined。
|
|
220
|
+
const rowProjectIds = row?.project_id ?? [];
|
|
216
221
|
const nextForm = {
|
|
217
222
|
tenant_id: row?.tenant_id ?? (isDefaultTenant.value ? undefined : Number(tenantOptions.value[0]?.value) || undefined),
|
|
218
223
|
subject_type: row?.subject_type ?? DEFAULT_SUBJECT_TYPE,
|
|
219
224
|
subject_id: row?.subject_id,
|
|
220
|
-
project_id: row && !(
|
|
221
|
-
all: Boolean(row &&
|
|
225
|
+
project_id: row && !(rowProjectIds.length === 1 && rowProjectIds[0] === 0) ? [...rowProjectIds] : [],
|
|
226
|
+
all: Boolean(row && rowProjectIds.length === 1 && rowProjectIds[0] === 0)
|
|
222
227
|
} satisfies ProjectGrantFormState;
|
|
223
228
|
const [projects, subjects] = await Promise.all([
|
|
224
229
|
requestProjectOptions(nextForm.tenant_id),
|
|
@@ -85,7 +85,7 @@ import { defBasePostService } from "@liujitcn/kratos-admin-system/api/system/adm
|
|
|
85
85
|
import type { SelectOptionResponse_Option, TreeOptionResponse_Option } from "@liujitcn/kratos-admin-system/rpc/common/v1/common";
|
|
86
86
|
import { Status } from "@liujitcn/kratos-admin-system/rpc/common/v1/enum";
|
|
87
87
|
import { buildPageRequest, normalizeSelectedIds } from "@liujitcn/kratos-admin-core/table";
|
|
88
|
-
import {
|
|
88
|
+
import { encryptPassword } from "@liujitcn/kratos-admin-core/security";
|
|
89
89
|
import { useTenantScope } from "@liujitcn/kratos-admin-core/tenant";
|
|
90
90
|
import { t } from "@liujitcn/kratos-admin-core";
|
|
91
91
|
|
|
@@ -775,7 +775,7 @@ async function handleConfirmResetPassword() {
|
|
|
775
775
|
resetPwdFormDialogRef.value?.validate()?.then(async valid => {
|
|
776
776
|
if (!valid) return;
|
|
777
777
|
|
|
778
|
-
const pwd = await encryptPassword(resetPwdForm.pwd,
|
|
778
|
+
const pwd = await encryptPassword(resetPwdForm.pwd, );
|
|
779
779
|
defBaseUserService.ResetBaseUserPassword({ id: resetPwdForm.id, pwd }).then(() => {
|
|
780
780
|
ElMessage.success(t("system.base.user.message.reset_password_success", { name: resetPwdTargetName.value }));
|
|
781
781
|
handleCloseResetPasswordDialog();
|
|
@@ -796,7 +796,7 @@ const handleSubmit = useDebounceFn(() => {
|
|
|
796
796
|
pwd:
|
|
797
797
|
submitData.id || !submitData.pwd
|
|
798
798
|
? undefined
|
|
799
|
-
: await encryptPassword(submitData.pwd,
|
|
799
|
+
: await encryptPassword(submitData.pwd, )
|
|
800
800
|
} as BaseUserForm;
|
|
801
801
|
const request = submitData.id
|
|
802
802
|
? defBaseUserService.UpdateBaseUser({ base_user: baseUser })
|
|
@@ -192,12 +192,11 @@ import ProForm from "@liujitcn/kratos-admin-core/components/ProForm/index.vue";
|
|
|
192
192
|
import MfaSetupPanel from "@liujitcn/kratos-admin-core/components/Mfa/MfaSetupPanel.vue";
|
|
193
193
|
import MfaRecoveryCodesDialog from "@liujitcn/kratos-admin-core/components/Mfa/MfaRecoveryCodesDialog.vue";
|
|
194
194
|
import type { ProFormField, ProFormInstance } from "@liujitcn/kratos-admin-core/components/ProForm/interface";
|
|
195
|
-
import type {
|
|
195
|
+
import type { SecretCrypto } from "@liujitcn/kratos-admin-core/rpc/common/v1/types";
|
|
196
196
|
import {
|
|
197
197
|
getOauthProviderIcon,
|
|
198
198
|
withOauthProviderDisplay,
|
|
199
199
|
type OauthProviderDisplay,
|
|
200
|
-
PASSWORD_CRYPTO_SCENE,
|
|
201
200
|
encryptPassword,
|
|
202
201
|
copyText,
|
|
203
202
|
createWebAuthnCredential,
|
|
@@ -449,7 +448,7 @@ function openMfaRecovery() {
|
|
|
449
448
|
}
|
|
450
449
|
|
|
451
450
|
/** 开始绑定 MFA。 */
|
|
452
|
-
async function beginMfaSetup(password:
|
|
451
|
+
async function beginMfaSetup(password: SecretCrypto) {
|
|
453
452
|
mfaLoading.value = true;
|
|
454
453
|
try {
|
|
455
454
|
const result = await defMfaService.BeginMfaSetup({ password, setup_ticket: "" });
|
|
@@ -494,7 +493,7 @@ async function disableMfa() {
|
|
|
494
493
|
}
|
|
495
494
|
mfaLoading.value = true;
|
|
496
495
|
try {
|
|
497
|
-
const password = await encryptPassword(mfaForm.password
|
|
496
|
+
const password = await encryptPassword(mfaForm.password);
|
|
498
497
|
if (mfaForm.recoveryCode) {
|
|
499
498
|
await defMfaService.DisableMfa({
|
|
500
499
|
password,
|
|
@@ -574,7 +573,7 @@ async function handleMfaAction() {
|
|
|
574
573
|
return;
|
|
575
574
|
}
|
|
576
575
|
try {
|
|
577
|
-
const password = await encryptPassword(mfaForm.password
|
|
576
|
+
const password = await encryptPassword(mfaForm.password);
|
|
578
577
|
await beginMfaSetup(password);
|
|
579
578
|
mfaForm.password = "";
|
|
580
579
|
} catch (error) {
|
|
@@ -74,12 +74,14 @@ const codeGenFormComponentLabelKeys: Record<ProFormComponentType, string> = {
|
|
|
74
74
|
input: "system.code.gen.component.input",
|
|
75
75
|
password: "system.code.gen.component.password",
|
|
76
76
|
textarea: "system.code.gen.component.textarea",
|
|
77
|
+
"yaml-editor": "system.code.gen.component.yaml_editor",
|
|
77
78
|
"input-number": "system.code.gen.component.input_number",
|
|
78
79
|
"color-picker": "system.code.gen.component.color_picker",
|
|
79
80
|
segmented: "system.code.gen.component.segmented",
|
|
80
81
|
switch: "system.code.gen.component.switch",
|
|
81
82
|
checkbox: "system.code.gen.component.checkbox",
|
|
82
83
|
select: "system.code.gen.component.select",
|
|
84
|
+
cascader: "system.code.gen.component.cascader",
|
|
83
85
|
"tenant-select": "system.code.gen.component.select",
|
|
84
86
|
dict: "system.code.gen.component.dict",
|
|
85
87
|
"radio-group": "system.code.gen.component.radio_group",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liujitcn/kratos-admin-system",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.67",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "kratos-admin system management module",
|
|
7
7
|
"license": "MIT",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"sortablejs": "^1.15.2",
|
|
17
17
|
"swagger-ui-dist": "^5.32.15",
|
|
18
18
|
"vue-element-plus-x": "^2.0.3",
|
|
19
|
-
"@liujitcn/kratos-admin-core": "0.0.
|
|
19
|
+
"@liujitcn/kratos-admin-core": "0.0.67"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"@element-plus/icons-vue": "^2.3.1",
|