@befly-addon/admin 1.1.29 → 1.1.31
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/apis/admin/cacheRefresh.ts +29 -24
- package/apis/admin/del.ts +12 -12
- package/apis/admin/detail.ts +9 -41
- package/apis/admin/ins.ts +28 -21
- package/apis/admin/list.ts +12 -12
- package/apis/admin/upd.ts +49 -14
- package/apis/api/all.ts +14 -10
- package/apis/api/list.ts +16 -25
- package/apis/auth/login.ts +55 -52
- package/apis/auth/sendSmsCode.ts +6 -6
- package/apis/dashboard/configStatus.ts +18 -18
- package/apis/dashboard/environmentInfo.ts +12 -12
- package/apis/dashboard/performanceMetrics.ts +5 -5
- package/apis/dashboard/permissionStats.ts +7 -7
- package/apis/dashboard/serviceStatus.ts +29 -29
- package/apis/dashboard/systemInfo.ts +5 -5
- package/apis/dashboard/systemOverview.ts +7 -7
- package/apis/dashboard/systemResources.ts +8 -8
- package/apis/dict/all.ts +24 -7
- package/apis/dict/del.ts +9 -17
- package/apis/dict/detail.ts +30 -16
- package/apis/dict/ins.ts +36 -18
- package/apis/dict/items.ts +27 -0
- package/apis/dict/list.ts +35 -10
- package/apis/dict/upd.ts +54 -20
- package/apis/dictType/all.ts +11 -0
- package/apis/dictType/del.ts +32 -0
- package/apis/dictType/detail.ts +17 -0
- package/apis/dictType/ins.ts +30 -0
- package/apis/dictType/list.ts +22 -0
- package/apis/dictType/upd.ts +42 -0
- package/apis/email/config.ts +4 -4
- package/apis/email/logList.ts +10 -10
- package/apis/email/send.ts +18 -18
- package/apis/email/verify.ts +5 -5
- package/apis/loginLog/list.ts +10 -10
- package/apis/menu/all.ts +17 -20
- package/apis/menu/list.ts +12 -13
- package/apis/operateLog/list.ts +10 -10
- package/apis/role/all.ts +7 -7
- package/apis/role/apiSave.ts +14 -16
- package/apis/role/apis.ts +24 -0
- package/apis/role/del.ts +27 -19
- package/apis/role/detail.ts +6 -7
- package/apis/role/ins.ts +10 -10
- package/apis/role/list.ts +11 -11
- package/apis/role/menuSave.ts +12 -14
- package/apis/role/menus.ts +24 -0
- package/apis/role/save.ts +14 -15
- package/apis/role/upd.ts +10 -10
- package/apis/sysConfig/all.ts +5 -6
- package/apis/sysConfig/del.ts +10 -10
- package/apis/sysConfig/get.ts +10 -11
- package/apis/sysConfig/ins.ts +11 -11
- package/apis/sysConfig/list.ts +9 -9
- package/apis/sysConfig/upd.ts +11 -11
- package/libs/emailHelper.ts +7 -7
- package/package.json +46 -34
- package/plugins/email.ts +9 -9
- package/tables/admin.json +0 -6
- package/tables/dict.json +13 -19
- package/tables/dictType.json +28 -0
- package/tables/role.json +4 -2
- package/views/403_1/index.vue +19 -3
- package/views/config/dict/components/edit.vue +76 -124
- package/views/config/dict/index.vue +142 -84
- package/views/config/dictType/components/edit.vue +105 -0
- package/views/config/dictType/index.vue +242 -0
- package/views/config/index.vue +12 -0
- package/views/config/system/components/edit.vue +36 -36
- package/views/config/system/index.vue +79 -50
- package/views/index/components/addonList.vue +3 -3
- package/views/index/components/environmentInfo.vue +10 -10
- package/views/index/components/operationLogs.vue +10 -10
- package/views/index/components/performanceMetrics.vue +8 -8
- package/views/index/components/quickActions.vue +3 -3
- package/views/index/components/serviceStatus.vue +19 -19
- package/views/index/components/systemNotifications.vue +12 -12
- package/views/index/components/systemOverview.vue +7 -7
- package/views/index/components/systemResources.vue +11 -11
- package/views/index/components/userInfo.vue +20 -19
- package/views/index/index.vue +12 -5
- package/views/log/email/index.vue +58 -51
- package/views/log/index.vue +12 -0
- package/views/log/login/index.vue +45 -38
- package/views/log/operate/index.vue +55 -48
- package/views/login_1/index.vue +191 -2
- package/views/people/admin/components/edit.vue +28 -29
- package/views/people/admin/index.vue +76 -40
- package/views/people/index.vue +12 -0
- package/views/permission/api/index.vue +21 -15
- package/views/permission/index.vue +12 -0
- package/views/permission/menu/index.vue +31 -16
- package/views/permission/role/components/api.vue +23 -23
- package/views/permission/role/components/edit.vue +18 -18
- package/views/permission/role/components/menu.vue +17 -19
- package/views/permission/role/index.vue +84 -49
- package/apis/admin/roleDetail.ts +0 -29
- package/apis/admin/roleSave.ts +0 -39
- package/apis/auth/logout.ts +0 -17
- package/apis/auth/register.ts +0 -43
- package/apis/dashboard/changelog.ts +0 -31
- package/apis/role/apiDetail.ts +0 -24
- package/apis/role/menuDetail.ts +0 -24
- package/views/403_1/meta.json +0 -4
- package/views/config/dict/meta.json +0 -4
- package/views/config/meta.json +0 -4
- package/views/config/system/meta.json +0 -4
- package/views/index/meta.json +0 -4
- package/views/log/email/meta.json +0 -4
- package/views/log/login/meta.json +0 -4
- package/views/log/meta.json +0 -4
- package/views/log/operate/meta.json +0 -4
- package/views/login_1/components/emailLoginForm.vue +0 -174
- package/views/login_1/components/registerForm.vue +0 -175
- package/views/login_1/components/welcomePanel.vue +0 -61
- package/views/login_1/meta.json +0 -4
- package/views/people/admin/meta.json +0 -4
- package/views/people/meta.json +0 -4
- package/views/permission/api/meta.json +0 -4
- package/views/permission/menu/meta.json +0 -4
- package/views/permission/meta.json +0 -4
- package/views/permission/role/meta.json +0 -4
package/apis/sysConfig/del.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
name:
|
|
2
|
+
name: "删除系统配置",
|
|
3
3
|
fields: {
|
|
4
|
-
id:
|
|
4
|
+
id: "@id"
|
|
5
5
|
},
|
|
6
6
|
handler: async (befly, ctx) => {
|
|
7
7
|
try {
|
|
8
8
|
// 检查是否为系统配置
|
|
9
9
|
const config = await befly.db.getDetail({
|
|
10
|
-
table:
|
|
10
|
+
table: "addon_admin_sys_config",
|
|
11
11
|
where: { id: ctx.body.id }
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
if (!config) {
|
|
15
|
-
return befly.tool.No(
|
|
14
|
+
if (!config?.id) {
|
|
15
|
+
return befly.tool.No("配置不存在");
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
if (config.isSystem === 1) {
|
|
19
|
-
return befly.tool.No(
|
|
19
|
+
return befly.tool.No("系统配置不允许删除");
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
await befly.db.delData({
|
|
23
|
-
table:
|
|
23
|
+
table: "addon_admin_sys_config",
|
|
24
24
|
where: { id: ctx.body.id }
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
return befly.tool.Yes(
|
|
27
|
+
return befly.tool.Yes("操作成功");
|
|
28
28
|
} catch (error) {
|
|
29
|
-
befly.logger.error({ err: error },
|
|
30
|
-
return befly.tool.No(
|
|
29
|
+
befly.logger.error({ err: error }, "删除系统配置失败");
|
|
30
|
+
return befly.tool.No("操作失败");
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
};
|
package/apis/sysConfig/get.ts
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
name:
|
|
2
|
+
name: "根据代码获取配置值",
|
|
3
3
|
auth: false,
|
|
4
4
|
fields: {
|
|
5
|
-
code: { name:
|
|
5
|
+
code: { name: "配置代码", type: "string", min: 1, max: 50 }
|
|
6
6
|
},
|
|
7
7
|
handler: async (befly, ctx) => {
|
|
8
8
|
const config = await befly.db.getDetail({
|
|
9
|
-
table:
|
|
10
|
-
fields: ['code', 'value', 'valueType'],
|
|
9
|
+
table: "addon_admin_sys_config",
|
|
11
10
|
where: { code: ctx.body.code }
|
|
12
11
|
});
|
|
13
12
|
|
|
14
|
-
if (!config) {
|
|
15
|
-
return befly.tool.No(
|
|
13
|
+
if (!config?.id) {
|
|
14
|
+
return befly.tool.No("配置不存在");
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
// 根据类型转换值
|
|
19
18
|
let value = config.value;
|
|
20
|
-
if (config.valueType ===
|
|
19
|
+
if (config.valueType === "number") {
|
|
21
20
|
value = Number(config.value);
|
|
22
|
-
} else if (config.valueType ===
|
|
23
|
-
value = config.value ===
|
|
24
|
-
} else if (config.valueType ===
|
|
21
|
+
} else if (config.valueType === "boolean") {
|
|
22
|
+
value = config.value === "true" || config.value === "1";
|
|
23
|
+
} else if (config.valueType === "json") {
|
|
25
24
|
try {
|
|
26
25
|
value = JSON.parse(config.value);
|
|
27
26
|
} catch {
|
|
@@ -29,6 +28,6 @@ export default {
|
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
return befly.tool.Yes(
|
|
31
|
+
return befly.tool.Yes("操作成功", { code: config.code, value: value });
|
|
33
32
|
}
|
|
34
33
|
};
|
package/apis/sysConfig/ins.ts
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import sysConfigTable from
|
|
1
|
+
import sysConfigTable from "../../tables/sysConfig.json";
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
name:
|
|
4
|
+
name: "添加系统配置",
|
|
5
5
|
fields: sysConfigTable,
|
|
6
6
|
handler: async (befly, ctx) => {
|
|
7
7
|
try {
|
|
8
8
|
// 检查 code 是否已存在
|
|
9
9
|
const existing = await befly.db.getDetail({
|
|
10
|
-
table:
|
|
10
|
+
table: "addon_admin_sys_config",
|
|
11
11
|
where: { code: ctx.body.code }
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
if (existing) {
|
|
15
|
-
return befly.tool.No(
|
|
15
|
+
return befly.tool.No("配置代码已存在");
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const configId = await befly.db.insData({
|
|
19
|
-
table:
|
|
19
|
+
table: "addon_admin_sys_config",
|
|
20
20
|
data: {
|
|
21
21
|
name: ctx.body.name,
|
|
22
22
|
code: ctx.body.code,
|
|
23
23
|
value: ctx.body.value,
|
|
24
|
-
valueType: ctx.body.valueType ||
|
|
25
|
-
group: ctx.body.group ||
|
|
24
|
+
valueType: ctx.body.valueType || "string",
|
|
25
|
+
group: ctx.body.group || "",
|
|
26
26
|
sort: ctx.body.sort || 0,
|
|
27
27
|
isSystem: ctx.body.isSystem || 0,
|
|
28
|
-
description: ctx.body.description ||
|
|
28
|
+
description: ctx.body.description || ""
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
return befly.tool.Yes(
|
|
32
|
+
return befly.tool.Yes("操作成功", { id: configId });
|
|
33
33
|
} catch (error) {
|
|
34
|
-
befly.logger.error({ err: error },
|
|
35
|
-
return befly.tool.No(
|
|
34
|
+
befly.logger.error({ err: error }, "添加系统配置失败");
|
|
35
|
+
return befly.tool.No("操作失败");
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
};
|
package/apis/sysConfig/list.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
name:
|
|
2
|
+
name: "获取系统配置列表",
|
|
3
3
|
fields: {
|
|
4
|
-
page:
|
|
5
|
-
limit:
|
|
6
|
-
keyword:
|
|
7
|
-
state:
|
|
4
|
+
page: "@page",
|
|
5
|
+
limit: "@limit",
|
|
6
|
+
keyword: "@keyword",
|
|
7
|
+
state: "@state"
|
|
8
8
|
},
|
|
9
9
|
handler: async (befly, ctx) => {
|
|
10
10
|
const result = await befly.db.getList({
|
|
11
|
-
table:
|
|
12
|
-
fields: [
|
|
11
|
+
table: "addon_admin_sys_config",
|
|
12
|
+
fields: ["id", "name", "code", "value", "valueType", "group", "sort", "isSystem", "description", "state", "createdAt", "updatedAt"],
|
|
13
13
|
page: ctx.body.page,
|
|
14
14
|
limit: ctx.body.limit,
|
|
15
|
-
orderBy: [
|
|
15
|
+
orderBy: ["group#ASC", "sort#ASC", "id#ASC"]
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
return befly.tool.Yes(
|
|
18
|
+
return befly.tool.Yes("操作成功", result);
|
|
19
19
|
}
|
|
20
20
|
};
|
package/apis/sysConfig/upd.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import sysConfigTable from
|
|
1
|
+
import sysConfigTable from "../../tables/sysConfig.json";
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
name:
|
|
4
|
+
name: "更新系统配置",
|
|
5
5
|
fields: {
|
|
6
|
-
id:
|
|
6
|
+
id: "@id",
|
|
7
7
|
...sysConfigTable
|
|
8
8
|
},
|
|
9
9
|
handler: async (befly, ctx) => {
|
|
10
10
|
try {
|
|
11
11
|
// 检查是否为系统配置
|
|
12
12
|
const config = await befly.db.getDetail({
|
|
13
|
-
table:
|
|
13
|
+
table: "addon_admin_sys_config",
|
|
14
14
|
where: { id: ctx.body.id }
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
if (!config) {
|
|
18
|
-
return befly.tool.No(
|
|
17
|
+
if (!config?.id) {
|
|
18
|
+
return befly.tool.No("配置不存在");
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
// 系统配置只能修改 value
|
|
22
22
|
if (config.isSystem === 1) {
|
|
23
23
|
await befly.db.updData({
|
|
24
|
-
table:
|
|
24
|
+
table: "addon_admin_sys_config",
|
|
25
25
|
data: {
|
|
26
26
|
value: ctx.body.value
|
|
27
27
|
},
|
|
@@ -29,7 +29,7 @@ export default {
|
|
|
29
29
|
});
|
|
30
30
|
} else {
|
|
31
31
|
await befly.db.updData({
|
|
32
|
-
table:
|
|
32
|
+
table: "addon_admin_sys_config",
|
|
33
33
|
data: {
|
|
34
34
|
name: ctx.body.name,
|
|
35
35
|
code: ctx.body.code,
|
|
@@ -44,10 +44,10 @@ export default {
|
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
return befly.tool.Yes(
|
|
47
|
+
return befly.tool.Yes("操作成功");
|
|
48
48
|
} catch (error) {
|
|
49
|
-
befly.logger.error({ err: error },
|
|
50
|
-
return befly.tool.No(
|
|
49
|
+
befly.logger.error({ err: error }, "更新系统配置失败");
|
|
50
|
+
return befly.tool.No("操作失败");
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
};
|
package/libs/emailHelper.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* 提供邮件发送功能,支持 SMTP 配置
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import type { BeflyContext } from "befly/types/befly";
|
|
7
|
+
import type { Transporter } from "nodemailer";
|
|
7
8
|
|
|
8
|
-
import
|
|
9
|
-
import type { BeflyContext } from 'befly/types/befly.js';
|
|
9
|
+
import nodemailer from "nodemailer";
|
|
10
10
|
|
|
11
11
|
/** 邮件配置 */
|
|
12
12
|
export interface EmailConfig {
|
|
@@ -80,7 +80,7 @@ export class EmailHelper {
|
|
|
80
80
|
if (!this.transporter) {
|
|
81
81
|
return {
|
|
82
82
|
success: false,
|
|
83
|
-
error:
|
|
83
|
+
error: "邮件服务未配置,请检查 SMTP 配置"
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -104,7 +104,7 @@ export class EmailHelper {
|
|
|
104
104
|
} catch (error: any) {
|
|
105
105
|
return {
|
|
106
106
|
success: false,
|
|
107
|
-
error: error.message ||
|
|
107
|
+
error: error.message || "发送失败"
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -128,10 +128,10 @@ export class EmailHelper {
|
|
|
128
128
|
/**
|
|
129
129
|
* 获取当前配置(隐藏密码)
|
|
130
130
|
*/
|
|
131
|
-
getConfig(): Omit<EmailConfig,
|
|
131
|
+
getConfig(): Omit<EmailConfig, "pass"> & { pass: string } {
|
|
132
132
|
return {
|
|
133
133
|
...this.config,
|
|
134
|
-
pass: this.config.pass ?
|
|
134
|
+
pass: this.config.pass ? "******" : ""
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
}
|
package/package.json
CHANGED
|
@@ -1,58 +1,70 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@befly-addon/admin",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"title": "管理后台",
|
|
5
|
-
"description": "Befly - 管理后台功能组件",
|
|
6
|
-
"type": "module",
|
|
3
|
+
"version": "1.1.31",
|
|
7
4
|
"private": false,
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
"
|
|
5
|
+
"description": "Befly - 管理后台功能组件",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"addon",
|
|
8
|
+
"admin",
|
|
9
|
+
"auth",
|
|
10
|
+
"befly",
|
|
11
|
+
"rbac",
|
|
12
|
+
"typescript"
|
|
13
|
+
],
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/chenbimo/befly.git",
|
|
17
|
+
"directory": "packages/addon-admin"
|
|
11
18
|
},
|
|
19
|
+
"author": "chenbimo",
|
|
20
|
+
"license": "Apache-2.0",
|
|
21
|
+
"type": "module",
|
|
12
22
|
"main": "package.json",
|
|
13
23
|
"exports": {
|
|
14
24
|
".": "./package.json",
|
|
15
25
|
"./styles/*": "./styles/*"
|
|
16
26
|
},
|
|
17
|
-
"scripts": {
|
|
18
|
-
"dev": "vite",
|
|
19
|
-
"build": "vite build",
|
|
20
|
-
"preview": "vite preview"
|
|
21
|
-
},
|
|
22
27
|
"files": [
|
|
28
|
+
"README.md",
|
|
23
29
|
"apis",
|
|
24
30
|
"libs",
|
|
31
|
+
"package.json",
|
|
25
32
|
"plugins",
|
|
26
33
|
"styles",
|
|
27
34
|
"tables",
|
|
28
|
-
"views"
|
|
29
|
-
"package.json",
|
|
30
|
-
"README.md"
|
|
35
|
+
"views"
|
|
31
36
|
],
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"rbac",
|
|
37
|
-
"auth",
|
|
38
|
-
"typescript"
|
|
39
|
-
],
|
|
40
|
-
"author": "chenbimo",
|
|
41
|
-
"license": "Apache-2.0",
|
|
42
|
-
"repository": {
|
|
43
|
-
"type": "git",
|
|
44
|
-
"url": "https://github.com/chenbimo/befly.git",
|
|
45
|
-
"directory": "packages/addon-admin"
|
|
37
|
+
"scripts": {
|
|
38
|
+
"dev": "vite",
|
|
39
|
+
"build": "vite build",
|
|
40
|
+
"preview": "vite preview"
|
|
46
41
|
},
|
|
47
|
-
"gitHead": "e078b94f087ddf21f289b55ab86c0b8dce105807",
|
|
48
42
|
"dependencies": {
|
|
49
|
-
"befly": "^3.9.
|
|
50
|
-
"befly-
|
|
43
|
+
"befly": "^3.9.39",
|
|
44
|
+
"befly-vite": "^1.1.12",
|
|
51
45
|
"nodemailer": "^7.0.11",
|
|
52
46
|
"ua-parser-js": "^2.0.7"
|
|
53
47
|
},
|
|
54
48
|
"devDependencies": {
|
|
49
|
+
"@iconify-json/lucide": "^1.2.80",
|
|
55
50
|
"@types/nodemailer": "^7.0.4",
|
|
56
|
-
"@types/ua-parser-js": "^0.7.39"
|
|
57
|
-
|
|
51
|
+
"@types/ua-parser-js": "^0.7.39",
|
|
52
|
+
"pinia": "^3.0.4",
|
|
53
|
+
"tdesign-vue-next": "^1.17.7",
|
|
54
|
+
"vue": "^3.5.26",
|
|
55
|
+
"vue-router": "^4.6.4"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"@iconify-json/lucide": "^1.2.80",
|
|
59
|
+
"pinia": "^3.0.4",
|
|
60
|
+
"tdesign-vue-next": "^1.17.7",
|
|
61
|
+
"vue": "^3.5.26",
|
|
62
|
+
"vue-router": "^4.6.4"
|
|
63
|
+
},
|
|
64
|
+
"publishConfig": {
|
|
65
|
+
"access": "public",
|
|
66
|
+
"registry": "https://registry.npmjs.org"
|
|
67
|
+
},
|
|
68
|
+
"gitHead": "d42bf60ba6b8b11fef7e759fa008ada075829772",
|
|
69
|
+
"title": "管理后台"
|
|
58
70
|
}
|
package/plugins/email.ts
CHANGED
|
@@ -3,27 +3,27 @@
|
|
|
3
3
|
* 提供邮件发送功能,支持 SMTP 配置
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import type { EmailConfig } from "../libs/emailHelper.js";
|
|
7
|
+
import type { BeflyContext } from "befly/types/befly";
|
|
8
|
+
import type { Plugin } from "befly/types/plugin";
|
|
7
9
|
|
|
8
|
-
import
|
|
9
|
-
import type { Plugin } from 'befly/types/plugin.js';
|
|
10
|
-
import type { BeflyContext } from 'befly/types/befly.js';
|
|
10
|
+
import { EmailHelper } from "../libs/emailHelper.js";
|
|
11
11
|
|
|
12
12
|
/** 默认配置 */
|
|
13
13
|
const defaultConfig: EmailConfig = {
|
|
14
|
-
host:
|
|
14
|
+
host: "smtp.qq.com",
|
|
15
15
|
port: 465,
|
|
16
16
|
secure: true,
|
|
17
|
-
user:
|
|
18
|
-
pass:
|
|
19
|
-
fromName:
|
|
17
|
+
user: "",
|
|
18
|
+
pass: "",
|
|
19
|
+
fromName: "Befly System"
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* 邮件插件
|
|
24
24
|
*/
|
|
25
25
|
const emailPlugin: Plugin = {
|
|
26
|
-
after: [
|
|
26
|
+
after: ["db", "logger", "config"],
|
|
27
27
|
async handler(befly: BeflyContext): Promise<EmailHelper> {
|
|
28
28
|
// 从 befly.config.addons.admin.email 获取配置
|
|
29
29
|
const addonEmailConfig = befly.config?.addons?.admin?.email || {};
|
package/tables/admin.json
CHANGED
package/tables/dict.json
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"name": "
|
|
2
|
+
"typeCode": {
|
|
3
|
+
"name": "字典类型代码",
|
|
4
4
|
"type": "string",
|
|
5
5
|
"min": 2,
|
|
6
6
|
"max": 50,
|
|
7
|
-
"index": true
|
|
7
|
+
"index": true,
|
|
8
|
+
"regexp": "@alphanumeric_"
|
|
8
9
|
},
|
|
9
|
-
"
|
|
10
|
-
"name": "
|
|
10
|
+
"key": {
|
|
11
|
+
"name": "字典键",
|
|
11
12
|
"type": "string",
|
|
12
|
-
"min":
|
|
13
|
+
"min": 1,
|
|
13
14
|
"max": 50,
|
|
14
15
|
"index": true,
|
|
15
16
|
"regexp": "@alphanumeric_"
|
|
16
17
|
},
|
|
17
|
-
"
|
|
18
|
-
"name": "
|
|
18
|
+
"label": {
|
|
19
|
+
"name": "字典标签",
|
|
19
20
|
"type": "string",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
21
|
+
"min": 1,
|
|
22
|
+
"max": 100
|
|
22
23
|
},
|
|
23
24
|
"sort": {
|
|
24
25
|
"name": "排序",
|
|
@@ -27,15 +28,8 @@
|
|
|
27
28
|
"max": 9999,
|
|
28
29
|
"default": 0
|
|
29
30
|
},
|
|
30
|
-
"
|
|
31
|
-
"name": "
|
|
32
|
-
"type": "number",
|
|
33
|
-
"min": 0,
|
|
34
|
-
"default": 0,
|
|
35
|
-
"index": true
|
|
36
|
-
},
|
|
37
|
-
"description": {
|
|
38
|
-
"name": "描述",
|
|
31
|
+
"remark": {
|
|
32
|
+
"name": "备注",
|
|
39
33
|
"type": "string",
|
|
40
34
|
"max": 200
|
|
41
35
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"code": {
|
|
3
|
+
"name": "类型代码",
|
|
4
|
+
"type": "string",
|
|
5
|
+
"min": 2,
|
|
6
|
+
"max": 50,
|
|
7
|
+
"unique": true,
|
|
8
|
+
"regexp": "@alphanumeric_"
|
|
9
|
+
},
|
|
10
|
+
"name": {
|
|
11
|
+
"name": "类型名称",
|
|
12
|
+
"type": "string",
|
|
13
|
+
"min": 2,
|
|
14
|
+
"max": 50
|
|
15
|
+
},
|
|
16
|
+
"description": {
|
|
17
|
+
"name": "描述",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"max": 200
|
|
20
|
+
},
|
|
21
|
+
"sort": {
|
|
22
|
+
"name": "排序",
|
|
23
|
+
"type": "number",
|
|
24
|
+
"min": 0,
|
|
25
|
+
"max": 9999,
|
|
26
|
+
"default": 0
|
|
27
|
+
}
|
|
28
|
+
}
|
package/tables/role.json
CHANGED
|
@@ -21,11 +21,13 @@
|
|
|
21
21
|
},
|
|
22
22
|
"menus": {
|
|
23
23
|
"name": "菜单权限",
|
|
24
|
-
"type": "
|
|
24
|
+
"type": "array_number_text",
|
|
25
|
+
"detail": "菜单ID数组,如 [1,2,3]"
|
|
25
26
|
},
|
|
26
27
|
"apis": {
|
|
27
28
|
"name": "接口权限",
|
|
28
|
-
"type": "
|
|
29
|
+
"type": "array_number_text",
|
|
30
|
+
"detail": "接口ID数组,如 [1,2,3]"
|
|
29
31
|
},
|
|
30
32
|
"sort": {
|
|
31
33
|
"name": "排序",
|
package/views/403_1/index.vue
CHANGED
|
@@ -13,14 +13,21 @@
|
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
15
|
<script setup>
|
|
16
|
-
import { useRouter } from
|
|
17
|
-
import { Button as TButton } from
|
|
16
|
+
import { useRouter } from "vue-router";
|
|
17
|
+
import { Button as TButton } from "tdesign-vue-next";
|
|
18
|
+
|
|
19
|
+
definePage({
|
|
20
|
+
meta: {
|
|
21
|
+
title: "403",
|
|
22
|
+
order: 101
|
|
23
|
+
}
|
|
24
|
+
});
|
|
18
25
|
|
|
19
26
|
const router = useRouter();
|
|
20
27
|
|
|
21
28
|
const $Method = {
|
|
22
29
|
goHome() {
|
|
23
|
-
router.push(
|
|
30
|
+
router.push("/");
|
|
24
31
|
},
|
|
25
32
|
goBack() {
|
|
26
33
|
router.back();
|
|
@@ -56,4 +63,13 @@ const $Method = {
|
|
|
56
63
|
.error-description {
|
|
57
64
|
font-size: 16px;
|
|
58
65
|
color: var(--text-secondary);
|
|
66
|
+
margin: 8px 0 24px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.error-actions {
|
|
70
|
+
display: flex;
|
|
71
|
+
gap: 12px;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
59
75
|
</style>
|