@liujitcn/kratos-admin-core 0.0.66 → 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.
Files changed (41) hide show
  1. package/dist/package/declarations/src/api/base/v1/login.d.ts +1 -3
  2. package/dist/package/declarations/src/api/base/v1/secret_crypto.d.ts +9 -0
  3. package/dist/package/declarations/src/components/Dialog/PasswordVerifyDialog.vue.d.ts +3 -7
  4. package/dist/package/declarations/src/components/ProForm/components/ProFormItem.vue.d.ts +6 -6
  5. package/dist/package/declarations/src/components/ProForm/components/SecretInput.vue.d.ts +23 -0
  6. package/dist/package/declarations/src/components/ProForm/interface/index.d.ts +14 -1
  7. package/dist/package/declarations/src/locales/generated.d.ts +32 -0
  8. package/dist/package/declarations/src/rpc/base/v1/login.d.ts +2 -39
  9. package/dist/package/declarations/src/rpc/base/v1/mfa.d.ts +3 -3
  10. package/dist/package/declarations/src/rpc/base/v1/oauth.d.ts +2 -2
  11. package/dist/package/declarations/src/rpc/base/v1/secret_crypto.d.ts +37 -0
  12. package/dist/package/declarations/src/rpc/common/v1/types.d.ts +4 -4
  13. package/dist/package/declarations/src/rpc/system/admin/v1/auth.d.ts +3 -3
  14. package/dist/package/declarations/src/security.d.ts +1 -1
  15. package/dist/package/declarations/src/utils/secretCrypto.d.ts +19 -0
  16. package/dist/package/src/api/base/v1/login.ts +0 -12
  17. package/dist/package/src/api/base/v1/secret_crypto.ts +35 -0
  18. package/dist/package/src/components/Dialog/PasswordVerifyDialog.vue +4 -8
  19. package/dist/package/src/components/ProForm/components/ProFormItem.vue +24 -1
  20. package/dist/package/src/components/ProForm/components/SecretInput.vue +117 -0
  21. package/dist/package/src/components/ProForm/interface/index.ts +15 -0
  22. package/dist/package/src/locales/README.md +1 -1
  23. package/dist/package/src/locales/en-US.json +9 -1
  24. package/dist/package/src/locales/ja-JP.json +9 -1
  25. package/dist/package/src/locales/zh-CN.json +9 -1
  26. package/dist/package/src/locales/zh-TW.json +9 -1
  27. package/dist/package/src/rpc/base/v1/login.ts +2 -42
  28. package/dist/package/src/rpc/base/v1/mfa.ts +3 -3
  29. package/dist/package/src/rpc/base/v1/oauth.ts +2 -2
  30. package/dist/package/src/rpc/base/v1/secret_crypto.ts +49 -0
  31. package/dist/package/src/rpc/common/v1/types.ts +4 -4
  32. package/dist/package/src/rpc/system/admin/v1/auth.ts +3 -3
  33. package/dist/package/src/security.ts +1 -1
  34. package/dist/package/src/utils/request.ts +3 -3
  35. package/dist/package/src/utils/{passwordCrypto.ts → secretCrypto.ts} +112 -50
  36. package/dist/package/src/views/demo/components/DemoFormDialog.vue +3 -3
  37. package/dist/package/src/views/demo/table/index.vue +2 -2
  38. package/dist/package/src/views/demo/tree-grid/index.vue +1 -1
  39. package/dist/package/src/views/login/components/LoginForm.vue +2 -2
  40. package/package.json +6 -2
  41. package/dist/package/declarations/src/utils/passwordCrypto.d.ts +0 -6
@@ -123,13 +123,13 @@ const deptTreeOptions: ProFormOption[] = demoDeptTree.map(dept => ({
123
123
 
124
124
  /** 租户静态选项:tenant-select 传入 options 后不再请求租户接口,纯静态可渲染。 */
125
125
  const tenantOptions: ProFormOption[] = [
126
- { label: "Demo 总租户", value: 1 },
127
- { label: "Demo 子租户", value: 2 }
126
+ { label: t("core.demo.form.tenant.main"), value: 1 },
127
+ { label: t("core.demo.form.tenant.sub"), value: 2 }
128
128
  ];
129
129
 
130
130
  /** 协作成员穿梭框数据源:value 即选中后的 key。 */
131
131
  const memberOptions: ProFormOption[] = demoDeptTree[0].children!.map((dept, index) => ({
132
- label: `${dept.name}负责人`,
132
+ label: t("core.demo.form.leader_title", { name: dept.name }),
133
133
  value: index + 1
134
134
  }));
135
135
 
@@ -68,7 +68,7 @@ const statusTagOptions = [
68
68
  ];
69
69
 
70
70
  /** select-v2 大数据下拉的静态选项(isShow: false,仅出现在搜索区)。 */
71
- const tagSearchOptions = Array.from({ length: 50 }, (_, index) => ({ label: `标签 ${index + 1}`, value: `tag-${index + 1}` }));
71
+ const tagSearchOptions = Array.from({ length: 50 }, (_, index) => ({ label: t("core.demo.table.tag_item", { index: index + 1 }), value: `tag-${index + 1}` }));
72
72
 
73
73
  /** tree-select 搜索项的静态团队树(isShow: false,仅出现在搜索区)。 */
74
74
  const ownerGroupOptions = demoRegionTree;
@@ -121,7 +121,7 @@ const columns = computed<ColumnProps[]>(() => [
121
121
  minWidth: 130,
122
122
  align: "right",
123
123
  cellType: "money",
124
- moneyProps: { prefix: "¥", suffix: " 元" }
124
+ moneyProps: { prefix: "¥", suffix: t("core.demo.table.money_unit") }
125
125
  },
126
126
  {
127
127
  // 多级表头:_children 嵌套的列渲染在“任务情况”分组下
@@ -180,7 +180,7 @@ function handleCreateChild(parentId?: number) {
180
180
  function handleFormSubmit(data: Record<string, any>) {
181
181
  const node: DemoCatalog = {
182
182
  id: ++nextId,
183
- name: String(data.name || `Demo 目录 ${nextId}`),
183
+ name: String(data.name || t("core.demo.tree.new_dir", { id: nextId })),
184
184
  code: `demo-${nextId}`,
185
185
  owner: data.visibility === "private" ? "--" : "Demo",
186
186
  status: data.enabled ? STATUS_ENABLE : STATUS_DISABLE,
@@ -217,7 +217,7 @@ import { useKeepAliveStore } from "../../../stores/modules/keepAlive";
217
217
  import { initDynamicRouter } from "../../../routers/modules/dynamicRouter";
218
218
  import { isUnmatchedRoute, navigateTo, resolveFrontendRouteURL } from "../../../utils/router";
219
219
  import type { ElForm, FormRules } from "element-plus";
220
- import { PASSWORD_CRYPTO_SCENE, encryptPassword } from "../../../utils/passwordCrypto";
220
+ import { encryptPassword } from "../../../utils/secretCrypto";
221
221
  import { useConfigStore } from "../../../stores/modules/config";
222
222
  import { Click as GoCaptchaClick, Rotate as GoCaptchaRotate, Slide as GoCaptchaSlide } from "go-captcha-vue";
223
223
  import "go-captcha-vue/dist/style.css";
@@ -797,7 +797,7 @@ const verifyCaptchaToken = async (captchaCode: string) => {
797
797
  const submitLogin = async (captchaToken: string) => {
798
798
  loading.value = true;
799
799
  try {
800
- const password = await encryptPassword(loginForm.password, PASSWORD_CRYPTO_SCENE.PASSWORD_CRYPTO_SCENE_LOGIN);
800
+ const password = await encryptPassword(loginForm.password);
801
801
  const loginRequest: LoginRequest = {
802
802
  tenant_code: configStore.showTenantCode ? loginForm.tenant_code : "0000",
803
803
  user_name: loginForm.user_name,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@liujitcn/kratos-admin-core",
3
3
  "private": false,
4
- "version": "0.0.66",
4
+ "version": "0.0.67",
5
5
  "type": "module",
6
6
  "description": "kratos-admin frontend runtime and base modules",
7
7
  "author": {
@@ -232,7 +232,11 @@
232
232
  "types": "./dist/package/declarations/vite.config.d.ts",
233
233
  "default": "./vite.config.ts"
234
234
  },
235
- "./package.json": "./package.json"
235
+ "./package.json": "./package.json",
236
+ "./utils/secretCrypto": {
237
+ "types": "./dist/package/declarations/src/utils/secretCrypto.d.ts",
238
+ "default": "./dist/package/src/utils/secretCrypto.ts"
239
+ }
236
240
  },
237
241
  "files": [
238
242
  "dist/package",
@@ -1,6 +0,0 @@
1
- import { PasswordCryptoScene } from "../rpc/base/v1/login";
2
- import type { PasswordCrypto } from "../rpc/common/v1/types";
3
- export declare const PASSWORD_CRYPTO_SCENE: typeof PasswordCryptoScene;
4
- export type { PasswordCryptoScene };
5
- /** 加密单个密码字段,返回后端可解析的密码密文。 */
6
- export declare function encryptPassword(password: string, scene: PasswordCryptoScene): Promise<PasswordCrypto>;