@pubinfo/core 2.2.0-beta.2 → 2.2.0-beta.4

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 (29) hide show
  1. package/dist/{AppSetting-BBCop_0D.js → AppSetting-6MGS4YPK.js} +6 -6
  2. package/dist/{HCheckList-cef4jGrw.js → HCheckList-BrnjaDkr.js} +1 -1
  3. package/dist/{HSlideover-B6gEDfA5.js → HSlideover-DqsKvKiI.js} +1 -1
  4. package/dist/{PreferencesContent-CuNffqV_.js → PreferencesContent-rJ9y4hog.js} +3 -5
  5. package/dist/{SettingBreadcrumb-CMn0gojs.js → SettingBreadcrumb-r--jPQkb.js} +1 -4
  6. package/dist/{SettingMenu-CEvBV2Wj.js → SettingMenu-EXak1lUo.js} +1 -4
  7. package/dist/{SettingTabbar-Ct3S8jS2.js → SettingTabbar-DGM4a0Jj.js} +1 -4
  8. package/dist/{SettingThemes-DaRKZ2Q3.js → SettingThemes--ObZszDO.js} +1 -3
  9. package/dist/{SettingTopbar-Ckg-OGSj.js → SettingTopbar-YTAQFcaE.js} +1 -4
  10. package/dist/{auth-BVTDpkDr.js → auth-BU3f3mc7.js} +3 -3
  11. package/dist/{change-organization-EdR25ifs.js → change-organization-Vl-hf_eS.js} +4 -5
  12. package/dist/{change-password-D-ZqBAmY.js → change-password-BV3YkrI2.js} +5 -6
  13. package/dist/{components-CKVAXENc.js → components-CKYu3evU.js} +124 -112
  14. package/dist/{core-Dg8YES9i.js → core--p_FvLxH.js} +6 -7
  15. package/dist/features/api/modules/auth/renzhengfuwu.d.ts +14 -0
  16. package/dist/features/components/PubinfoIcon/parser.d.ts +6 -0
  17. package/dist/{form-CGzMvzKZ.js → form-CmNl2b3W.js} +2 -2
  18. package/dist/index.js +12 -12
  19. package/dist/{modal-ybprgEqf.js → modal-DXJis9Ay.js} +2 -2
  20. package/dist/{not-found-CuHR6H_g.js → not-found-BLDgkCMn.js} +1 -3
  21. package/dist/{not-permission-BcQAkzxI.js → not-permission-DpD0vTVw.js} +1 -3
  22. package/dist/{profile-Bsc6FIbI.js → profile-Cp1PyI44.js} +14 -15
  23. package/dist/{tree-select-gPCwtMia.js → tree-select-DS-DUpQw.js} +1660 -1660
  24. package/dist/{watchDiff-DJP3s9bb.js → watchDiff-Dofh9yLN.js} +4 -4
  25. package/package.json +8 -8
  26. package/src/features/api/modules/auth/renzhengfuwu.ts +36 -0
  27. package/src/features/api/modules/auth/typings.d.ts +19 -1
  28. package/src/features/components/PubinfoIcon/index.vue +2 -43
  29. package/src/features/components/PubinfoIcon/parser.ts +42 -0
@@ -1,4 +1,4 @@
1
- import { Gr as e, Jr as t, Kr as n, Wr as r, Yr as i, qr as a } from "./modal-ybprgEqf.js";
1
+ import { Gr as e, Jr as t, Kr as n, Wr as r, Yr as i, qr as a } from "./modal-DXJis9Ay.js";
2
2
  import { watch as o } from "vue";
3
3
  //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js
4
4
  function s(e) {
@@ -323,7 +323,7 @@ function At() {
323
323
  //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hashDelete.js
324
324
  function jt(e) {
325
325
  var t = this.has(e) && delete this.__data__[e];
326
- return this.size -= t ? 1 : 0, t;
326
+ return this.size -= +!!t, t;
327
327
  }
328
328
  //#endregion
329
329
  //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hashGet.js
@@ -348,7 +348,7 @@ function It(e) {
348
348
  var Lt = "__lodash_hash_undefined__";
349
349
  function Rt(e, t) {
350
350
  var n = this.__data__;
351
- return this.size += this.has(e) ? 0 : 1, n[e] = F && t === void 0 ? Lt : t, this;
351
+ return this.size += +!this.has(e), n[e] = F && t === void 0 ? Lt : t, this;
352
352
  }
353
353
  //#endregion
354
354
  //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Hash.js
@@ -433,7 +433,7 @@ function B(e, t) {
433
433
  //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheDelete.js
434
434
  function qt(e) {
435
435
  var t = B(this, e).delete(e);
436
- return this.size -= t ? 1 : 0, t;
436
+ return this.size -= +!!t, t;
437
437
  }
438
438
  //#endregion
439
439
  //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheGet.js
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pubinfo/core",
3
3
  "type": "module",
4
- "version": "2.2.0-beta.2",
4
+ "version": "2.2.0-beta.4",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -31,9 +31,9 @@
31
31
  "pinia": "^3.0.4",
32
32
  "vue": "^3.5.28",
33
33
  "vue-router": "^5.0.2",
34
- "@pubinfo/config": "2.2.0-beta.2",
35
- "@pubinfo/vite": "2.2.0-beta.2",
36
- "@pubinfo/devtools": "2.2.0-beta.2"
34
+ "@pubinfo/config": "2.2.0-beta.4",
35
+ "@pubinfo/devtools": "2.2.0-beta.4",
36
+ "@pubinfo/vite": "2.2.0-beta.4"
37
37
  },
38
38
  "dependencies": {
39
39
  "@alova/adapter-axios": "^2.0.17",
@@ -63,7 +63,7 @@
63
63
  "unctx": "^2.5.0",
64
64
  "vue-m-message": "^4.0.2",
65
65
  "zxcvbn": "^4.4.2",
66
- "@pubinfo/shared": "2.2.0-beta.2"
66
+ "@pubinfo/shared": "2.2.0-beta.4"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@alova/mock": "^2.0.18",
@@ -89,12 +89,12 @@
89
89
  "unplugin-auto-import": "^21.0.0",
90
90
  "unplugin-icons": "^23.0.1",
91
91
  "unplugin-vue-components": "^31.0.0",
92
- "vite": "^8.0.0",
92
+ "vite": "^8.0.8",
93
93
  "vite-plugin-dts": "^4.5.4",
94
94
  "vue": "^3.5.28",
95
95
  "vue-router": "^5.0.2",
96
- "@pubinfo/vite": "2.2.0-beta.2",
97
- "@pubinfo/config": "2.2.0-beta.2"
96
+ "@pubinfo/config": "2.2.0-beta.4",
97
+ "@pubinfo/vite": "2.2.0-beta.4"
98
98
  },
99
99
  "scripts": {
100
100
  "dev": "vite build -w -m watch",
@@ -1,5 +1,41 @@
1
1
  import { auth as request } from '@/features/api/request';
2
2
 
3
+ /**
4
+ * @description 双因素认证-二次认证准备
5
+ * @url /auth/2fa/prepare
6
+ * @method POST
7
+ * @author @pubinfo/openapi
8
+ */
9
+ export function postAuth2FaPrepare<
10
+ R = API.ResponseDataString,
11
+ T = API.ResponseDataString,
12
+ >(body: API.Prepare2faDto, options?: Parameters<typeof request.Post<R, T>>[2]) {
13
+ return request.Post<R, T>('/auth/2fa/prepare', body, {
14
+ headers: {
15
+ 'Content-Type': 'application/json',
16
+ },
17
+ ...(options || {}),
18
+ });
19
+ }
20
+
21
+ /**
22
+ * @description 双因素认证-二次认证验证
23
+ * @url /auth/2fa/verify
24
+ * @method POST
25
+ * @author @pubinfo/openapi
26
+ */
27
+ export function postAuth2FaVerify<
28
+ R = API.ResponseDataLoginTokenVo,
29
+ T = API.ResponseDataLoginTokenVo,
30
+ >(body: API.Verify2faDto, options?: Parameters<typeof request.Post<R, T>>[2]) {
31
+ return request.Post<R, T>('/auth/2fa/verify', body, {
32
+ headers: {
33
+ 'Content-Type': 'application/json',
34
+ },
35
+ ...(options || {}),
36
+ });
37
+ }
38
+
3
39
  /**
4
40
  * @description 验证码-前端校验 需要校验的验证码类型:blockPuzzle、clickWord
5
41
  * @url /auth/captcha/check
@@ -40,9 +40,9 @@ declare namespace API {
40
40
  };
41
41
 
42
42
  type IResponseCode = {
43
- msg?: string;
44
43
  code?: number;
45
44
  hint?: string;
45
+ msg?: string;
46
46
  };
47
47
 
48
48
  type LoginByPwdCaptchaDto = {
@@ -79,6 +79,8 @@ declare namespace API {
79
79
  /** 访问令牌 */
80
80
  accessToken?: string;
81
81
  loginResponse?: IResponseCode;
82
+ /** 2FA登录码 不为空表示开启了2FA登录 */
83
+ login2faCode?: string;
82
84
  };
83
85
 
84
86
  type postAuthChangeLoginOrgParams = {
@@ -103,6 +105,13 @@ declare namespace API {
103
105
  refreshToken: string;
104
106
  };
105
107
 
108
+ type Prepare2faDto = {
109
+ /** login2faCode */
110
+ login2faCode: string;
111
+ /** 二次认证方式 默认支持sms */
112
+ fa2Type: string;
113
+ };
114
+
106
115
  type PubLoginTokenVo = {
107
116
  /** id */
108
117
  id?: string;
@@ -174,4 +183,13 @@ declare namespace API {
174
183
  key?: string;
175
184
  plaintext?: string;
176
185
  };
186
+
187
+ type Verify2faDto = {
188
+ /** login2faCode */
189
+ login2faCode: string;
190
+ /** 二次认证方式 默认支持sms */
191
+ fa2Type: string;
192
+ /** 认证码 */
193
+ verifyCode: string;
194
+ };
177
195
  }
@@ -5,6 +5,7 @@ import { Icon } from '@iconify/vue';
5
5
  import { shallowRef, watch } from 'vue';
6
6
  import { getCachedIcon, setCachedIcon, setupIcon } from '@/core';
7
7
  import { useProvider } from '../PubinfoProvider';
8
+ import { parseCustomIconName } from './parser';
8
9
  import PrismBox from './PrismBox.vue';
9
10
  import SquareBox from './SquareBox.vue';
10
11
 
@@ -74,7 +75,7 @@ const element = computed(() => {
74
75
  const icon = shallowRef<string | undefined>(undefined);
75
76
 
76
77
  function getIconLookupMeta(rawName: string) {
77
- const parsed = parseString(rawName);
78
+ const parsed = parseCustomIconName(rawName);
78
79
  const fileName = `${parsed.name}${parsed.ext || '.svg'}`;
79
80
  const moduleId = parsed.prefix || undefined;
80
81
  return { fileName, moduleId } as const;
@@ -159,48 +160,6 @@ watch(
159
160
  { immediate: true, flush: 'sync' },
160
161
  );
161
162
 
162
- interface Parsed {
163
- prefix: string
164
- name: string
165
- ext: string
166
- }
167
-
168
- function parseString(str: string): Parsed {
169
- let prefix = '';
170
- let name = '';
171
- let ext = '';
172
-
173
- // 匹配 RBAC-[org.svg] 或 RBAC-[org]
174
- const match = str.match(/^([^-\s]+)-\[(.+)\]$/);
175
-
176
- if (match) {
177
- prefix = match[1];
178
- const inner = match[2];
179
-
180
- const dotIdx = inner.lastIndexOf('.');
181
- if (dotIdx !== -1) {
182
- name = inner.slice(0, dotIdx);
183
- ext = inner.slice(dotIdx);
184
- }
185
- else {
186
- name = inner;
187
- }
188
- }
189
- else {
190
- // 如果没有前缀格式,就当普通文件处理
191
- const dotIdx = str.lastIndexOf('.');
192
- if (dotIdx !== -1) {
193
- name = str.slice(0, dotIdx);
194
- ext = str.slice(dotIdx);
195
- }
196
- else {
197
- name = str;
198
- }
199
- }
200
-
201
- return { prefix, name, ext };
202
- }
203
-
204
163
  const style = computed(() => {
205
164
  const transform: string[] = [];
206
165
  if (props.flip) {
@@ -0,0 +1,42 @@
1
+ export interface ParsedIconName {
2
+ prefix: string
3
+ name: string
4
+ ext: string
5
+ }
6
+
7
+ function splitNameExt(value: string) {
8
+ const dotIdx = value.lastIndexOf('.');
9
+ if (dotIdx !== -1) {
10
+ return {
11
+ name: value.slice(0, dotIdx),
12
+ ext: value.slice(dotIdx),
13
+ };
14
+ }
15
+
16
+ return {
17
+ name: value,
18
+ ext: '',
19
+ };
20
+ }
21
+
22
+ export function parseCustomIconName(str: string): ParsedIconName {
23
+ const markerIdx = str.lastIndexOf('-[');
24
+ const hasScopedSyntax = markerIdx > 0 && str.endsWith(']');
25
+
26
+ if (hasScopedSyntax) {
27
+ const prefix = str.slice(0, markerIdx);
28
+ const inner = str.slice(markerIdx + 2, -1);
29
+
30
+ if (prefix && inner) {
31
+ return {
32
+ prefix,
33
+ ...splitNameExt(inner),
34
+ };
35
+ }
36
+ }
37
+
38
+ return {
39
+ prefix: '',
40
+ ...splitNameExt(str),
41
+ };
42
+ }