@befly-addon/admin 1.2.14 → 1.2.16
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/adminViews/config/dict/index.vue +1 -1
- package/adminViews/config/dictType/index.vue +1 -1
- package/adminViews/config/system/index.vue +1 -1
- package/adminViews/log/email/index.vue +1 -1
- package/adminViews/log/login/index.vue +1 -1
- package/adminViews/log/operate/index.vue +1 -1
- package/adminViews/login_1/index.vue +1 -1
- package/adminViews/people/admin/components/edit.vue +2 -2
- package/adminViews/people/admin/index.vue +1 -1
- package/adminViews/permission/api/index.vue +1 -1
- package/adminViews/permission/menu/index.vue +1 -1
- package/adminViews/permission/role/components/edit.vue +1 -1
- package/adminViews/permission/role/index.vue +1 -1
- package/apis/admin/cacheRefresh.ts +3 -5
- package/libs/emailHelper.ts +2 -3
- package/package.json +3 -21
- package/plugins/email.ts +2 -4
|
@@ -83,7 +83,7 @@ import ILucideChevronDown from "~icons/lucide/chevron-down";
|
|
|
83
83
|
import EditDialog from "./components/edit.vue";
|
|
84
84
|
import DetailPanel from "@/components/DetailPanel.vue";
|
|
85
85
|
import { $Http } from "@/plugins/http";
|
|
86
|
-
import { withDefaultColumns } from "befly-
|
|
86
|
+
import { withDefaultColumns } from "befly-shared/utils/withDefaultColumns";
|
|
87
87
|
|
|
88
88
|
definePage({
|
|
89
89
|
meta: {
|
|
@@ -80,7 +80,7 @@ import ILucideChevronDown from "~icons/lucide/chevron-down";
|
|
|
80
80
|
import EditDialog from "./components/edit.vue";
|
|
81
81
|
import DetailPanel from "@/components/DetailPanel.vue";
|
|
82
82
|
import { $Http } from "@/plugins/http";
|
|
83
|
-
import { withDefaultColumns } from "befly-
|
|
83
|
+
import { withDefaultColumns } from "befly-shared/utils/withDefaultColumns";
|
|
84
84
|
|
|
85
85
|
definePage({
|
|
86
86
|
meta: {
|
|
@@ -91,7 +91,7 @@ import ILucideChevronDown from "~icons/lucide/chevron-down";
|
|
|
91
91
|
import EditDialog from "./components/edit.vue";
|
|
92
92
|
import DetailPanel from "@/components/DetailPanel.vue";
|
|
93
93
|
import { $Http } from "@/plugins/http";
|
|
94
|
-
import { withDefaultColumns } from "befly-
|
|
94
|
+
import { withDefaultColumns } from "befly-shared/utils/withDefaultColumns";
|
|
95
95
|
|
|
96
96
|
definePage({
|
|
97
97
|
meta: {
|
|
@@ -90,7 +90,7 @@ import ILucideSend from "~icons/lucide/send";
|
|
|
90
90
|
import ILucideCheckCircle from "~icons/lucide/check-circle";
|
|
91
91
|
import DetailPanel from "@/components/DetailPanel.vue";
|
|
92
92
|
import { $Http } from "@/plugins/http";
|
|
93
|
-
import { withDefaultColumns } from "befly-
|
|
93
|
+
import { withDefaultColumns } from "befly-shared/utils/withDefaultColumns";
|
|
94
94
|
|
|
95
95
|
definePage({
|
|
96
96
|
meta: {
|
|
@@ -54,7 +54,7 @@ import { Button as TButton, Table as TTable, Tag as TTag, Pagination as TPaginat
|
|
|
54
54
|
import ILucideRotateCw from "~icons/lucide/rotate-cw";
|
|
55
55
|
import DetailPanel from "@/components/DetailPanel.vue";
|
|
56
56
|
import { $Http } from "@/plugins/http";
|
|
57
|
-
import { withDefaultColumns } from "befly-
|
|
57
|
+
import { withDefaultColumns } from "befly-shared/utils/withDefaultColumns";
|
|
58
58
|
|
|
59
59
|
definePage({
|
|
60
60
|
meta: {
|
|
@@ -74,7 +74,7 @@ import { Button as TButton, Table as TTable, Tag as TTag, Pagination as TPaginat
|
|
|
74
74
|
import ILucideRotateCw from "~icons/lucide/rotate-cw";
|
|
75
75
|
import DetailPanel from "@/components/DetailPanel.vue";
|
|
76
76
|
import { $Http } from "@/plugins/http";
|
|
77
|
-
import { withDefaultColumns } from "befly-
|
|
77
|
+
import { withDefaultColumns } from "befly-shared/utils/withDefaultColumns";
|
|
78
78
|
|
|
79
79
|
definePage({
|
|
80
80
|
meta: {
|
|
@@ -70,7 +70,7 @@ import ILucideUser from "~icons/lucide/user";
|
|
|
70
70
|
import ILucideLock from "~icons/lucide/lock";
|
|
71
71
|
import { $Http } from "@/plugins/http";
|
|
72
72
|
import { $Storage } from "@/plugins/storage";
|
|
73
|
-
import { hashPassword } from "befly-
|
|
73
|
+
import { hashPassword } from "befly-shared/utils/hashPassword";
|
|
74
74
|
|
|
75
75
|
definePage({
|
|
76
76
|
meta: {
|
|
@@ -47,8 +47,8 @@ import {
|
|
|
47
47
|
MessagePlugin
|
|
48
48
|
} from "tdesign-vue-next";
|
|
49
49
|
import { $Http } from "@/plugins/http";
|
|
50
|
-
import { fieldClear } from "befly-
|
|
51
|
-
import { hashPassword } from "befly-
|
|
50
|
+
import { fieldClear } from "befly-shared/utils/fieldClear";
|
|
51
|
+
import { hashPassword } from "befly-shared/utils/hashPassword";
|
|
52
52
|
|
|
53
53
|
const $Prop = defineProps({
|
|
54
54
|
modelValue: {
|
|
@@ -79,7 +79,7 @@ import ILucideChevronDown from "~icons/lucide/chevron-down";
|
|
|
79
79
|
import EditDialog from "./components/edit.vue";
|
|
80
80
|
import DetailPanel from "@/components/DetailPanel.vue";
|
|
81
81
|
import { $Http } from "@/plugins/http";
|
|
82
|
-
import { withDefaultColumns } from "befly-
|
|
82
|
+
import { withDefaultColumns } from "befly-shared/utils/withDefaultColumns";
|
|
83
83
|
|
|
84
84
|
definePage({
|
|
85
85
|
meta: {
|
|
@@ -55,7 +55,7 @@ import { Button as TButton, Table as TTable, Tag as TTag, Input as TInput, Messa
|
|
|
55
55
|
import ILucideRotateCw from "~icons/lucide/rotate-cw";
|
|
56
56
|
import ILucideSearch from "~icons/lucide/search";
|
|
57
57
|
import { $Http } from "@/plugins/http";
|
|
58
|
-
import { withDefaultColumns } from "befly-
|
|
58
|
+
import { withDefaultColumns } from "befly-shared/utils/withDefaultColumns";
|
|
59
59
|
import DetailPanel from "@/components/DetailPanel.vue";
|
|
60
60
|
|
|
61
61
|
definePage({
|
|
@@ -45,7 +45,7 @@ import ILucideRotateCw from "~icons/lucide/rotate-cw";
|
|
|
45
45
|
import DetailPanel from "@/components/DetailPanel.vue";
|
|
46
46
|
import { $Http } from "@/plugins/http";
|
|
47
47
|
import { arrayToTree } from "befly-shared/utils/arrayToTree";
|
|
48
|
-
import { withDefaultColumns } from "befly-
|
|
48
|
+
import { withDefaultColumns } from "befly-shared/utils/withDefaultColumns";
|
|
49
49
|
|
|
50
50
|
definePage({
|
|
51
51
|
meta: {
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
Button as TButton,
|
|
43
43
|
MessagePlugin
|
|
44
44
|
} from "tdesign-vue-next";
|
|
45
|
-
import { fieldClear } from "befly-
|
|
45
|
+
import { fieldClear } from "befly-shared/utils/fieldClear";
|
|
46
46
|
import { $Http } from "@/plugins/http";
|
|
47
47
|
|
|
48
48
|
const $Prop = defineProps({
|
|
@@ -102,7 +102,7 @@ import MenuDialog from "./components/menu.vue";
|
|
|
102
102
|
import ApiDialog from "./components/api.vue";
|
|
103
103
|
import DetailPanel from "@/components/DetailPanel.vue";
|
|
104
104
|
import { $Http } from "@/plugins/http";
|
|
105
|
-
import { withDefaultColumns } from "befly-
|
|
105
|
+
import { withDefaultColumns } from "befly-shared/utils/withDefaultColumns";
|
|
106
106
|
|
|
107
107
|
definePage({
|
|
108
108
|
meta: {
|
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
* - 缓存出现异常需要重建
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { CacheKeys } from "befly/lib/cacheKeys";
|
|
16
|
-
|
|
17
15
|
export default {
|
|
18
16
|
name: "刷新全部缓存",
|
|
19
17
|
handler: async (befly, _ctx) => {
|
|
@@ -31,7 +29,7 @@ export default {
|
|
|
31
29
|
table: "addon_admin_api"
|
|
32
30
|
});
|
|
33
31
|
|
|
34
|
-
await befly.redis.setObject(
|
|
32
|
+
await befly.redis.setObject("apis:all", apis.data.lists);
|
|
35
33
|
results.apis = { success: true, count: apis.data.lists.length };
|
|
36
34
|
} catch (error: any) {
|
|
37
35
|
befly.logger.error({ err: error }, "刷新接口缓存失败");
|
|
@@ -44,7 +42,7 @@ export default {
|
|
|
44
42
|
table: "addon_admin_menu"
|
|
45
43
|
});
|
|
46
44
|
|
|
47
|
-
await befly.redis.setObject(
|
|
45
|
+
await befly.redis.setObject("menus:all", menus.data.lists);
|
|
48
46
|
|
|
49
47
|
const parentCount = menus.data.lists.filter((m: any) => typeof m.parentPath !== "string" || m.parentPath.length === 0).length;
|
|
50
48
|
const childCount = menus.data.lists.filter((m: any) => typeof m.parentPath === "string" && m.parentPath.length > 0).length;
|
|
@@ -69,7 +67,7 @@ export default {
|
|
|
69
67
|
// 使用 setBatch 批量缓存所有角色
|
|
70
68
|
const count = await befly.redis.setBatch(
|
|
71
69
|
roles.data.lists.map((role: any) => ({
|
|
72
|
-
key:
|
|
70
|
+
key: `role:info:${role.code}`,
|
|
73
71
|
value: role
|
|
74
72
|
}))
|
|
75
73
|
);
|
package/libs/emailHelper.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* 提供邮件发送功能,支持 SMTP 配置
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import type { BeflyContext } from "befly/types/befly";
|
|
7
6
|
import type { Transporter } from "nodemailer";
|
|
8
7
|
|
|
9
8
|
import nodemailer from "nodemailer";
|
|
@@ -53,9 +52,9 @@ export interface SendEmailResult {
|
|
|
53
52
|
export class EmailHelper {
|
|
54
53
|
private config: EmailConfig;
|
|
55
54
|
private transporter: Transporter | null = null;
|
|
56
|
-
private befly
|
|
55
|
+
private befly;
|
|
57
56
|
|
|
58
|
-
constructor(befly
|
|
57
|
+
constructor(befly, config: EmailConfig) {
|
|
59
58
|
this.befly = befly;
|
|
60
59
|
this.config = config;
|
|
61
60
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@befly-addon/admin",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "1.2.16",
|
|
4
|
+
"gitHead": "f5d17c019a58e82cfacec5ce3a1f04e3225ba838",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Befly - 管理后台功能组件",
|
|
7
7
|
"keywords": [
|
|
@@ -47,27 +47,9 @@
|
|
|
47
47
|
"preview": "vite preview"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"befly": "^3.
|
|
51
|
-
"befly-shared": "^1.3.8",
|
|
52
|
-
"befly-vite": "^1.2.9",
|
|
50
|
+
"befly-shared": "^1.3.9",
|
|
53
51
|
"nodemailer": "^7.0.12",
|
|
54
52
|
"ua-parser-js": "^2.0.7"
|
|
55
53
|
},
|
|
56
|
-
"devDependencies": {
|
|
57
|
-
"@iconify-json/lucide": "^1.2.82",
|
|
58
|
-
"@types/nodemailer": "^7.0.4",
|
|
59
|
-
"@types/ua-parser-js": "^0.7.39",
|
|
60
|
-
"pinia": "^3.0.4",
|
|
61
|
-
"tdesign-vue-next": "^1.17.7",
|
|
62
|
-
"vue": "^3.5.26",
|
|
63
|
-
"vue-router": "^4.6.4"
|
|
64
|
-
},
|
|
65
|
-
"peerDependencies": {
|
|
66
|
-
"@iconify-json/lucide": "^1.2.82",
|
|
67
|
-
"pinia": "^3.0.4",
|
|
68
|
-
"tdesign-vue-next": "^1.17.7",
|
|
69
|
-
"vue": "^3.5.26",
|
|
70
|
-
"vue-router": "^4.6.4"
|
|
71
|
-
},
|
|
72
54
|
"addonName": "管理后台"
|
|
73
55
|
}
|
package/plugins/email.ts
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { EmailConfig } from "../libs/emailHelper.js";
|
|
7
|
-
import type { BeflyContext } from "befly/types/befly";
|
|
8
|
-
import type { Plugin } from "befly/types/plugin";
|
|
9
7
|
|
|
10
8
|
import { EmailHelper } from "../libs/emailHelper.js";
|
|
11
9
|
|
|
@@ -21,7 +19,7 @@ const defaultConfig: EmailConfig = {
|
|
|
21
19
|
|
|
22
20
|
export default {
|
|
23
21
|
deps: ["db", "logger", "config"],
|
|
24
|
-
async handler(befly
|
|
22
|
+
async handler(befly): Promise<EmailHelper> {
|
|
25
23
|
// 从 befly.config.addons.admin.email 获取配置
|
|
26
24
|
const addonEmailConfig = befly.config?.addons?.admin?.email || {};
|
|
27
25
|
const emailConfig: EmailConfig = {
|
|
@@ -31,4 +29,4 @@ export default {
|
|
|
31
29
|
|
|
32
30
|
return new EmailHelper(befly, emailConfig);
|
|
33
31
|
}
|
|
34
|
-
}
|
|
32
|
+
};
|