@pubinfo-pr/core 0.228.1 → 0.230.1

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.
@@ -1,4 +1,18 @@
1
1
  import { auth as request } from '../../request';
2
+ /**
3
+ * @description 双因素认证-二次认证准备
4
+ * @url /auth/2fa/prepare
5
+ * @method POST
6
+ * @author @pubinfo/openapi
7
+ */
8
+ export declare function postAuth2FaPrepare<R = API.ResponseDataString, T = API.ResponseDataString>(body: API.Prepare2faDto, options?: Parameters<typeof request.Post<R, T>>[2]): import('alova').Method<import('alova').RespondedAlovaGenerics<import('../../../..').AG, R, T>>;
9
+ /**
10
+ * @description 双因素认证-二次认证验证
11
+ * @url /auth/2fa/verify
12
+ * @method POST
13
+ * @author @pubinfo/openapi
14
+ */
15
+ export declare function postAuth2FaVerify<R = API.ResponseDataLoginTokenVo, T = API.ResponseDataLoginTokenVo>(body: API.Verify2faDto, options?: Parameters<typeof request.Post<R, T>>[2]): import('alova').Method<import('alova').RespondedAlovaGenerics<import('../../../..').AG, R, T>>;
2
16
  /**
3
17
  * @description 验证码-前端校验 需要校验的验证码类型:blockPuzzle、clickWord
4
18
  * @url /auth/captcha/check
@@ -0,0 +1,6 @@
1
+ export interface ParsedIconName {
2
+ prefix: string;
3
+ name: string;
4
+ ext: string;
5
+ }
6
+ export declare function parseCustomIconName(str: string): ParsedIconName;
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { A as T, B as re, C as ie, D as ae, E as oe, F as se, M as ce, N as le,
4
4
  import { s as Re, t as ze } from "./watchDiff-DJP3s9bb.js";
5
5
  import { a as Be, c as Ve, d as He, f as Ue, i as We, l as Ge, n as Ke, o as qe, r as Je, u as Ye } from "./dist-HLiWAOC7.js";
6
6
  import { z as Xe } from "./tree-select-gPCwtMia.js";
7
- import { a as Ze, c as Qe, d as $e, i as et, l as tt, n as nt, o as rt, r as it, s as at, t as ot, u as st } from "./components-CKVAXENc.js";
7
+ import { a as Ze, c as Qe, d as $e, i as et, l as tt, n as nt, o as rt, r as it, s as at, t as ot, u as st } from "./components-BHWiQ3ez.js";
8
8
  import { t as ct } from "./_plugin-vue_export-helper-CsLplWgU.js";
9
9
  import { n as D, t as lt } from "./useContext-Dlqfap_7.js";
10
10
  import { t as ut } from "./HButton-pEqyd918.js";
@@ -112,7 +112,7 @@ function Rn(e = {}) {
112
112
  var zn = [{
113
113
  path: "/change-password/:changePassWordToken",
114
114
  name: "ChangePassword",
115
- component: () => import("./change-password-D-ZqBAmY.js"),
115
+ component: () => import("./change-password-BTb3qYGv.js"),
116
116
  beforeEnter: (e) => ue(e.params.changePassWordToken) ? { name: "Login" } : !0,
117
117
  meta: {
118
118
  whiteList: !0,
@@ -121,7 +121,7 @@ var zn = [{
121
121
  }, {
122
122
  path: "/change-organization/:orgId",
123
123
  name: "ChangeOrganization",
124
- component: () => import("./change-organization-EdR25ifs.js"),
124
+ component: () => import("./change-organization-BezqpSfp.js"),
125
125
  beforeEnter: (e) => {
126
126
  let t = ve();
127
127
  return ue(e.params.orgId) || e.params.orgId !== t.user.orgId ? { name: "Login" } : !0;
@@ -1723,7 +1723,7 @@ var la = /* @__PURE__ */ I({
1723
1723
  name: "Preferences",
1724
1724
  __name: "index",
1725
1725
  setup(e, { expose: t }) {
1726
- let n = Ut(() => import("./PreferencesContent-CuNffqV_.js")), [r, i] = Ue(!1);
1726
+ let n = Ut(() => import("./PreferencesContent-8y4xvxPh.js")), [r, i] = Ue(!1);
1727
1727
  return t({ open: () => i() }), (e, t) => {
1728
1728
  let i = At;
1729
1729
  return z(), A(i, {
@@ -3519,7 +3519,7 @@ var Rs = L({
3519
3519
  name: "SettingBar",
3520
3520
  __name: "index",
3521
3521
  setup(e) {
3522
- let t = Ut(() => import("./AppSetting-BBCop_0D.js")), { settingsStore: n, isDev: r } = D();
3522
+ let t = Ut(() => import("./AppSetting-DxV7nNkI.js")), { settingsStore: n, isDev: r } = D();
3523
3523
  function i() {
3524
3524
  window.open("http://124.223.184.245:10000/docs/");
3525
3525
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pubinfo-pr/core",
3
3
  "type": "module",
4
- "version": "0.228.1",
4
+ "version": "0.230.1",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -27,9 +27,9 @@
27
27
  "node": "^20.19.0 || >=22.12.0"
28
28
  },
29
29
  "peerDependencies": {
30
- "@pubinfo-pr/config": "0.228.1",
31
- "@pubinfo-pr/devtools": "0.228.1",
32
- "@pubinfo-pr/vite": "0.228.1",
30
+ "@pubinfo-pr/config": "0.230.1",
31
+ "@pubinfo-pr/devtools": "0.230.1",
32
+ "@pubinfo-pr/vite": "0.230.1",
33
33
  "alova": "^3.5.0",
34
34
  "pinia": "^3.0.4",
35
35
  "vue": "^3.5.28",
@@ -42,7 +42,7 @@
42
42
  "@headlessui/vue": "^1.7.23",
43
43
  "@imengyu/vue3-context-menu": "^1.5.4",
44
44
  "@pubinfo/pro-components": "^1.8.2",
45
- "@pubinfo-pr/shared": "0.228.1",
45
+ "@pubinfo-pr/shared": "0.230.1",
46
46
  "@unocss/reset": "^66.6.0",
47
47
  "@vueuse/core": "^14.2.1",
48
48
  "@vueuse/integrations": "^14.2.1",
@@ -69,10 +69,10 @@
69
69
  "@alova/mock": "^2.0.18",
70
70
  "@iconify/json": "^2.2.437",
71
71
  "@iconify/vue": "^5.0.0",
72
- "@pubinfo-pr/config": "0.228.1",
72
+ "@pubinfo-pr/config": "0.230.1",
73
73
  "@pubinfo/openapi": "^0.9.1",
74
74
  "@pubinfo/preset-openapi": "^0.9.1",
75
- "@pubinfo-pr/vite": "0.228.1",
75
+ "@pubinfo-pr/vite": "0.230.1",
76
76
  "@types/lodash-es": "^4.17.12",
77
77
  "@types/md5": "^2.3.6",
78
78
  "@types/nprogress": "^0.2.3",
@@ -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
+ }