@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
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<span class="col-ip">{{ log.ip }}</span>
|
|
24
24
|
<span class="col-status">
|
|
25
25
|
<t-tag :type="log.status === 'success' ? 'success' : 'danger'" size="small">
|
|
26
|
-
{{ log.status ===
|
|
26
|
+
{{ log.status === "success" ? "成功" : "失败" }}
|
|
27
27
|
</t-tag>
|
|
28
28
|
</span>
|
|
29
29
|
</div>
|
|
@@ -36,19 +36,19 @@
|
|
|
36
36
|
<script setup>
|
|
37
37
|
// 组件内部数据
|
|
38
38
|
const operationLogs = $ref([
|
|
39
|
-
{ id: 1, userName:
|
|
40
|
-
{ id: 2, userName:
|
|
41
|
-
{ id: 3, userName:
|
|
42
|
-
{ id: 4, userName:
|
|
43
|
-
{ id: 5, userName:
|
|
39
|
+
{ id: 1, userName: "管理员", action: "创建角色", module: "权限管理", ip: "192.168.1.100", status: "success", createdAt: Date.now() - 120000 },
|
|
40
|
+
{ id: 2, userName: "张三", action: "修改菜单", module: "系统设置", ip: "192.168.1.101", status: "success", createdAt: Date.now() - 900000 },
|
|
41
|
+
{ id: 3, userName: "李四", action: "删除接口", module: "接口管理", ip: "192.168.1.102", status: "failed", createdAt: Date.now() - 3600000 },
|
|
42
|
+
{ id: 4, userName: "管理员", action: "同步数据库", module: "数据库", ip: "192.168.1.100", status: "success", createdAt: Date.now() - 7200000 },
|
|
43
|
+
{ id: 5, userName: "王五", action: "登录系统", module: "系统", ip: "192.168.1.103", status: "success", createdAt: Date.now() - 10800000 }
|
|
44
44
|
]);
|
|
45
45
|
|
|
46
46
|
const formatTime = (timestamp) => {
|
|
47
47
|
const date = new Date(timestamp);
|
|
48
|
-
const month = String(date.getMonth() + 1).padStart(2,
|
|
49
|
-
const day = String(date.getDate()).padStart(2,
|
|
50
|
-
const hours = String(date.getHours()).padStart(2,
|
|
51
|
-
const minutes = String(date.getMinutes()).padStart(2,
|
|
48
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
49
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
50
|
+
const hours = String(date.getHours()).padStart(2, "0");
|
|
51
|
+
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
52
52
|
return `${month}-${day} ${hours}:${minutes}`;
|
|
53
53
|
};
|
|
54
54
|
</script>
|
|
@@ -53,12 +53,12 @@
|
|
|
53
53
|
</template>
|
|
54
54
|
|
|
55
55
|
<script setup>
|
|
56
|
-
import ILucideActivity from
|
|
57
|
-
import ILucideClock from
|
|
58
|
-
import ILucideTrendingUp from
|
|
59
|
-
import ILucideAlertCircle from
|
|
60
|
-
import ILucideAlertTriangle from
|
|
61
|
-
import { $Http } from
|
|
56
|
+
import ILucideActivity from "~icons/lucide/activity";
|
|
57
|
+
import ILucideClock from "~icons/lucide/clock";
|
|
58
|
+
import ILucideTrendingUp from "~icons/lucide/trending-up";
|
|
59
|
+
import ILucideAlertCircle from "~icons/lucide/alert-circle";
|
|
60
|
+
import ILucideAlertTriangle from "~icons/lucide/alert-triangle";
|
|
61
|
+
import { $Http } from "@/plugins/http";
|
|
62
62
|
|
|
63
63
|
// 组件内部数据
|
|
64
64
|
const performanceMetrics = $ref({
|
|
@@ -72,10 +72,10 @@ const performanceMetrics = $ref({
|
|
|
72
72
|
// 获取数据
|
|
73
73
|
const fetchData = async () => {
|
|
74
74
|
try {
|
|
75
|
-
const { data } = await $Http(
|
|
75
|
+
const { data } = await $Http("/addon/admin/dashboard/performanceMetrics");
|
|
76
76
|
Object.assign(performanceMetrics, data);
|
|
77
77
|
} catch (error) {
|
|
78
|
-
|
|
78
|
+
// 静默失败:不阻断页面展示
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
81
|
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script setup>
|
|
15
|
-
import { Button as TButton } from
|
|
16
|
-
import ILucideRotateCw from
|
|
15
|
+
import { Button as TButton } from "tdesign-vue-next";
|
|
16
|
+
import ILucideRotateCw from "~icons/lucide/rotate-cw";
|
|
17
17
|
|
|
18
18
|
const handleClearCache = () => {
|
|
19
|
-
|
|
19
|
+
// TODO: 接入刷新缓存接口
|
|
20
20
|
};
|
|
21
21
|
</script>
|
|
22
22
|
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
</template>
|
|
36
36
|
|
|
37
37
|
<script setup>
|
|
38
|
-
import ILucideCheckCircle from
|
|
39
|
-
import ILucideDatabase from
|
|
40
|
-
import ILucideZap from
|
|
41
|
-
import ILucideHardDrive from
|
|
42
|
-
import ILucideMail from
|
|
43
|
-
import ILucideCloud from
|
|
44
|
-
import ILucideCircle from
|
|
45
|
-
import ILucideXCircle from
|
|
46
|
-
import ILucideAlertCircle from
|
|
47
|
-
import { $Http } from
|
|
38
|
+
import ILucideCheckCircle from "~icons/lucide/check-circle";
|
|
39
|
+
import ILucideDatabase from "~icons/lucide/database";
|
|
40
|
+
import ILucideZap from "~icons/lucide/zap";
|
|
41
|
+
import ILucideHardDrive from "~icons/lucide/hard-drive";
|
|
42
|
+
import ILucideMail from "~icons/lucide/mail";
|
|
43
|
+
import ILucideCloud from "~icons/lucide/cloud";
|
|
44
|
+
import ILucideCircle from "~icons/lucide/circle";
|
|
45
|
+
import ILucideXCircle from "~icons/lucide/x-circle";
|
|
46
|
+
import ILucideAlertCircle from "~icons/lucide/alert-circle";
|
|
47
|
+
import { $Http } from "@/plugins/http";
|
|
48
48
|
|
|
49
49
|
// 组件内部数据
|
|
50
50
|
const services = $ref([]);
|
|
@@ -52,10 +52,10 @@ const services = $ref([]);
|
|
|
52
52
|
// 获取数据
|
|
53
53
|
const fetchData = async () => {
|
|
54
54
|
try {
|
|
55
|
-
const { data } = await $Http(
|
|
55
|
+
const { data } = await $Http("/addon/admin/dashboard/serviceStatus");
|
|
56
56
|
services.splice(0, services.length, ...data.services);
|
|
57
57
|
} catch (error) {
|
|
58
|
-
|
|
58
|
+
// 静默失败:不阻断页面展示
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
|
|
@@ -64,18 +64,18 @@ fetchData();
|
|
|
64
64
|
// 工具函数
|
|
65
65
|
const getStatusColor = (status) => {
|
|
66
66
|
const colors = {
|
|
67
|
-
running:
|
|
68
|
-
stopped:
|
|
69
|
-
unconfigured:
|
|
67
|
+
running: "success",
|
|
68
|
+
stopped: "error",
|
|
69
|
+
unconfigured: "warning"
|
|
70
70
|
};
|
|
71
|
-
return colors[status] ||
|
|
71
|
+
return colors[status] || "default";
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
const getStatusText = (status) => {
|
|
75
75
|
const texts = {
|
|
76
|
-
running:
|
|
77
|
-
stopped:
|
|
78
|
-
unconfigured:
|
|
76
|
+
running: "正常",
|
|
77
|
+
stopped: "停止",
|
|
78
|
+
unconfigured: "未配置"
|
|
79
79
|
};
|
|
80
80
|
return texts[status] || status;
|
|
81
81
|
};
|
|
@@ -26,19 +26,19 @@
|
|
|
26
26
|
</template>
|
|
27
27
|
|
|
28
28
|
<script setup>
|
|
29
|
-
import { Tag as TTag } from
|
|
30
|
-
import ILucideBell from
|
|
31
|
-
import ILucideInfo from
|
|
32
|
-
import ILucideCheckCircle from
|
|
33
|
-
import ILucideAlertTriangle from
|
|
34
|
-
import ILucideXCircle from
|
|
29
|
+
import { Tag as TTag } from "tdesign-vue-next";
|
|
30
|
+
import ILucideBell from "~icons/lucide/bell";
|
|
31
|
+
import ILucideInfo from "~icons/lucide/info";
|
|
32
|
+
import ILucideCheckCircle from "~icons/lucide/check-circle";
|
|
33
|
+
import ILucideAlertTriangle from "~icons/lucide/alert-triangle";
|
|
34
|
+
import ILucideXCircle from "~icons/lucide/x-circle";
|
|
35
35
|
|
|
36
36
|
// 组件内部数据
|
|
37
37
|
const notifications = $ref([
|
|
38
|
-
{ id: 1, type:
|
|
39
|
-
{ id: 2, type:
|
|
40
|
-
{ id: 3, type:
|
|
41
|
-
{ id: 4, type:
|
|
38
|
+
{ id: 1, type: "warning", title: "系统更新提醒 - v1.1.0 版本已发布", isRead: false, createdAt: Date.now() - 3600000 },
|
|
39
|
+
{ id: 2, type: "info", title: "数据备份完成 - 今日凌晨自动备份成功", isRead: true, createdAt: Date.now() - 21600000 },
|
|
40
|
+
{ id: 3, type: "error", title: "SSL证书即将过期 - 请及时更新证书", isRead: false, createdAt: Date.now() - 86400000 },
|
|
41
|
+
{ id: 4, type: "success", title: "性能优化完成 - 响应速度提升30%", isRead: true, createdAt: Date.now() - 172800000 }
|
|
42
42
|
]);
|
|
43
43
|
|
|
44
44
|
const formatTime = (timestamp) => {
|
|
@@ -51,8 +51,8 @@ const formatTime = (timestamp) => {
|
|
|
51
51
|
} else if (diff < 86400000) {
|
|
52
52
|
return `${Math.floor(diff / 3600000)}小时前`;
|
|
53
53
|
} else {
|
|
54
|
-
const month = String(date.getMonth() + 1).padStart(2,
|
|
55
|
-
const day = String(date.getDate()).padStart(2,
|
|
54
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
55
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
56
56
|
return `${month}-${day}`;
|
|
57
57
|
}
|
|
58
58
|
};
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
</template>
|
|
36
36
|
|
|
37
37
|
<script setup>
|
|
38
|
-
import ILucideInfo from
|
|
39
|
-
import ILucideMenu from
|
|
40
|
-
import ILucideWebhook from
|
|
41
|
-
import ILucideUsers from
|
|
42
|
-
import { $Http } from
|
|
38
|
+
import ILucideInfo from "~icons/lucide/info";
|
|
39
|
+
import ILucideMenu from "~icons/lucide/menu";
|
|
40
|
+
import ILucideWebhook from "~icons/lucide/webhook";
|
|
41
|
+
import ILucideUsers from "~icons/lucide/users";
|
|
42
|
+
import { $Http } from "@/plugins/http";
|
|
43
43
|
|
|
44
44
|
// 组件内部数据
|
|
45
45
|
const permissionStats = $ref({
|
|
@@ -51,10 +51,10 @@ const permissionStats = $ref({
|
|
|
51
51
|
// 获取数据
|
|
52
52
|
const fetchData = async () => {
|
|
53
53
|
try {
|
|
54
|
-
const { data } = await $Http(
|
|
54
|
+
const { data } = await $Http("/addon/admin/dashboard/systemOverview");
|
|
55
55
|
Object.assign(permissionStats, data);
|
|
56
56
|
} catch (error) {
|
|
57
|
-
|
|
57
|
+
// 静默失败:不阻断页面展示
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
</template>
|
|
40
40
|
|
|
41
41
|
<script setup>
|
|
42
|
-
import { Progress as TProgress } from
|
|
43
|
-
import ILucideActivity from
|
|
44
|
-
import ILucideCpu from
|
|
45
|
-
import ILucideHardDrive from
|
|
46
|
-
import ILucideDisc from
|
|
47
|
-
import { $Http } from
|
|
42
|
+
import { Progress as TProgress } from "tdesign-vue-next";
|
|
43
|
+
import ILucideActivity from "~icons/lucide/activity";
|
|
44
|
+
import ILucideCpu from "~icons/lucide/cpu";
|
|
45
|
+
import ILucideHardDrive from "~icons/lucide/hard-drive";
|
|
46
|
+
import ILucideDisc from "~icons/lucide/disc";
|
|
47
|
+
import { $Http } from "@/plugins/http";
|
|
48
48
|
|
|
49
49
|
// 组件内部数据
|
|
50
50
|
const systemResources = $ref({
|
|
@@ -56,10 +56,10 @@ const systemResources = $ref({
|
|
|
56
56
|
// 获取数据
|
|
57
57
|
const fetchData = async () => {
|
|
58
58
|
try {
|
|
59
|
-
const { data } = await $Http(
|
|
59
|
+
const { data } = await $Http("/addon/admin/dashboard/systemResources");
|
|
60
60
|
Object.assign(systemResources, data);
|
|
61
61
|
} catch (error) {
|
|
62
|
-
|
|
62
|
+
// 静默失败:不阻断页面展示
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
|
|
@@ -67,9 +67,9 @@ fetchData();
|
|
|
67
67
|
|
|
68
68
|
// 工具函数
|
|
69
69
|
const getProgressColor = (percentage) => {
|
|
70
|
-
if (percentage < 50) return
|
|
71
|
-
if (percentage < 80) return
|
|
72
|
-
return
|
|
70
|
+
if (percentage < 50) return "success";
|
|
71
|
+
if (percentage < 80) return "warning";
|
|
72
|
+
return "danger";
|
|
73
73
|
};
|
|
74
74
|
</script>
|
|
75
75
|
|
|
@@ -5,14 +5,16 @@
|
|
|
5
5
|
<ILucideUser />
|
|
6
6
|
</div>
|
|
7
7
|
<div class="user-basic">
|
|
8
|
-
<div class="user-name">
|
|
9
|
-
|
|
8
|
+
<div class="user-name">
|
|
9
|
+
{{ $Data.userInfo.nickname || $Data.userInfo.name || $Data.userInfo.username || "未设置" }}
|
|
10
|
+
</div>
|
|
11
|
+
<div class="user-role">{{ $Data.userInfo.role?.name || "普通用户" }}</div>
|
|
10
12
|
</div>
|
|
11
13
|
</div>
|
|
12
14
|
<div class="user-details">
|
|
13
15
|
<div class="detail-item">
|
|
14
16
|
<ILucideMail />
|
|
15
|
-
<span>{{ $Data.userInfo.email ||
|
|
17
|
+
<span>{{ $Data.userInfo.email || "未设置" }}</span>
|
|
16
18
|
</div>
|
|
17
19
|
<div v-if="$Data.userInfo.phone" class="detail-item">
|
|
18
20
|
<ILucidePhone />
|
|
@@ -37,13 +39,13 @@
|
|
|
37
39
|
</template>
|
|
38
40
|
|
|
39
41
|
<script setup>
|
|
40
|
-
import { Button as TButton, MessagePlugin } from
|
|
41
|
-
import ILucideUser from
|
|
42
|
-
import ILucideMail from
|
|
43
|
-
import ILucidePhone from
|
|
44
|
-
import ILucideClock from
|
|
45
|
-
import ILucideRotateCw from
|
|
46
|
-
import { $Http } from
|
|
42
|
+
import { Button as TButton, MessagePlugin } from "tdesign-vue-next";
|
|
43
|
+
import ILucideUser from "~icons/lucide/user";
|
|
44
|
+
import ILucideMail from "~icons/lucide/mail";
|
|
45
|
+
import ILucidePhone from "~icons/lucide/phone";
|
|
46
|
+
import ILucideClock from "~icons/lucide/clock";
|
|
47
|
+
import ILucideRotateCw from "~icons/lucide/rotate-cw";
|
|
48
|
+
import { $Http } from "@/plugins/http";
|
|
47
49
|
|
|
48
50
|
// 响应式数据
|
|
49
51
|
const $Data = $ref({
|
|
@@ -56,10 +58,10 @@ const $Method = {
|
|
|
56
58
|
// 获取数据
|
|
57
59
|
async fetchData() {
|
|
58
60
|
try {
|
|
59
|
-
const { data } = await $Http(
|
|
61
|
+
const { data } = await $Http("/addon/admin/admin/detail");
|
|
60
62
|
Object.assign($Data.userInfo, data);
|
|
61
63
|
} catch (error) {
|
|
62
|
-
|
|
64
|
+
MessagePlugin.error("获取用户信息失败");
|
|
63
65
|
}
|
|
64
66
|
},
|
|
65
67
|
|
|
@@ -67,7 +69,7 @@ const $Method = {
|
|
|
67
69
|
async handleRefreshCache() {
|
|
68
70
|
try {
|
|
69
71
|
$Data.refreshing = true;
|
|
70
|
-
const result = await $Http(
|
|
72
|
+
const result = await $Http("/addon/admin/admin/cacheRefresh");
|
|
71
73
|
|
|
72
74
|
if (result.code === 0) {
|
|
73
75
|
const { apis, menus, roles } = result.data;
|
|
@@ -83,13 +85,12 @@ const $Method = {
|
|
|
83
85
|
messages.push(`角色缓存: ${roles.count} 个`);
|
|
84
86
|
}
|
|
85
87
|
|
|
86
|
-
MessagePlugin.success(`缓存刷新成功!${messages.join(
|
|
88
|
+
MessagePlugin.success(`缓存刷新成功!${messages.join(",")}`);
|
|
87
89
|
} else {
|
|
88
|
-
MessagePlugin.warning(result.msg ||
|
|
90
|
+
MessagePlugin.warning(result.msg || "部分缓存刷新失败");
|
|
89
91
|
}
|
|
90
92
|
} catch (error) {
|
|
91
|
-
|
|
92
|
-
MessagePlugin.error('刷新缓存失败,请稍后重试');
|
|
93
|
+
MessagePlugin.error("刷新缓存失败,请稍后重试");
|
|
93
94
|
} finally {
|
|
94
95
|
$Data.refreshing = false;
|
|
95
96
|
}
|
|
@@ -97,14 +98,14 @@ const $Method = {
|
|
|
97
98
|
|
|
98
99
|
// 格式化时间
|
|
99
100
|
formatTime(timestamp) {
|
|
100
|
-
if (!timestamp) return
|
|
101
|
+
if (!timestamp) return "";
|
|
101
102
|
const date = new Date(Number(timestamp));
|
|
102
103
|
const now = new Date();
|
|
103
104
|
const diff = now - date;
|
|
104
105
|
|
|
105
106
|
// 小于1分钟
|
|
106
107
|
if (diff < 60000) {
|
|
107
|
-
return
|
|
108
|
+
return "刚刚";
|
|
108
109
|
}
|
|
109
110
|
// 小于1小时
|
|
110
111
|
if (diff < 3600000) {
|
package/views/index/index.vue
CHANGED
|
@@ -20,11 +20,18 @@
|
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
22
|
<script setup>
|
|
23
|
-
import SystemOverview from
|
|
24
|
-
import ServiceStatus from
|
|
25
|
-
import SystemResources from
|
|
26
|
-
import PerformanceMetrics from
|
|
27
|
-
import EnvironmentInfo from
|
|
23
|
+
import SystemOverview from "./components/systemOverview.vue";
|
|
24
|
+
import ServiceStatus from "./components/serviceStatus.vue";
|
|
25
|
+
import SystemResources from "./components/systemResources.vue";
|
|
26
|
+
import PerformanceMetrics from "./components/performanceMetrics.vue";
|
|
27
|
+
import EnvironmentInfo from "./components/environmentInfo.vue";
|
|
28
|
+
|
|
29
|
+
definePage({
|
|
30
|
+
meta: {
|
|
31
|
+
title: "首页",
|
|
32
|
+
order: 0
|
|
33
|
+
}
|
|
34
|
+
});
|
|
28
35
|
</script>
|
|
29
36
|
|
|
30
37
|
<style scoped lang="scss">
|
|
@@ -84,13 +84,20 @@
|
|
|
84
84
|
</template>
|
|
85
85
|
|
|
86
86
|
<script setup>
|
|
87
|
-
import { Button as TButton, Table as TTable, Tag as TTag, Pagination as TPagination, Dialog as TDialog, Form as TForm, FormItem as TFormItem, Input as TInput, Textarea as TTextarea, Space as TSpace, MessagePlugin } from
|
|
88
|
-
import ILucideRotateCw from
|
|
89
|
-
import ILucideSend from
|
|
90
|
-
import ILucideCheckCircle from
|
|
91
|
-
import DetailPanel from
|
|
92
|
-
import { $Http } from
|
|
93
|
-
import { withDefaultColumns } from
|
|
87
|
+
import { Button as TButton, Table as TTable, Tag as TTag, Pagination as TPagination, Dialog as TDialog, Form as TForm, FormItem as TFormItem, Input as TInput, Textarea as TTextarea, Space as TSpace, MessagePlugin } from "tdesign-vue-next";
|
|
88
|
+
import ILucideRotateCw from "~icons/lucide/rotate-cw";
|
|
89
|
+
import ILucideSend from "~icons/lucide/send";
|
|
90
|
+
import ILucideCheckCircle from "~icons/lucide/check-circle";
|
|
91
|
+
import DetailPanel from "@/components/DetailPanel.vue";
|
|
92
|
+
import { $Http } from "@/plugins/http";
|
|
93
|
+
import { withDefaultColumns } from "befly-vite/utils/withDefaultColumns";
|
|
94
|
+
|
|
95
|
+
definePage({
|
|
96
|
+
meta: {
|
|
97
|
+
title: "邮件日志",
|
|
98
|
+
order: 2
|
|
99
|
+
}
|
|
100
|
+
});
|
|
94
101
|
|
|
95
102
|
const sendFormRef = $ref(null);
|
|
96
103
|
|
|
@@ -99,25 +106,25 @@ const $Data = $ref({
|
|
|
99
106
|
tableData: [],
|
|
100
107
|
loading: false,
|
|
101
108
|
columns: withDefaultColumns([
|
|
102
|
-
{ colKey:
|
|
103
|
-
{ colKey:
|
|
104
|
-
{ colKey:
|
|
105
|
-
{ colKey:
|
|
106
|
-
{ colKey:
|
|
107
|
-
{ colKey:
|
|
109
|
+
{ colKey: "username", title: "发送人", fixed: "left" },
|
|
110
|
+
{ colKey: "id", title: "序号" },
|
|
111
|
+
{ colKey: "toEmail", title: "收件人" },
|
|
112
|
+
{ colKey: "subject", title: "主题" },
|
|
113
|
+
{ colKey: "sendTime", title: "发送时间" },
|
|
114
|
+
{ colKey: "sendResult", title: "发送结果" }
|
|
108
115
|
]),
|
|
109
116
|
detailFields: [
|
|
110
|
-
{ colKey:
|
|
111
|
-
{ colKey:
|
|
112
|
-
{ colKey:
|
|
113
|
-
{ colKey:
|
|
114
|
-
{ colKey:
|
|
115
|
-
{ colKey:
|
|
116
|
-
{ colKey:
|
|
117
|
-
{ colKey:
|
|
118
|
-
{ colKey:
|
|
119
|
-
{ colKey:
|
|
120
|
-
{ colKey:
|
|
117
|
+
{ colKey: "username", title: "发送人账号" },
|
|
118
|
+
{ colKey: "nickname", title: "发送人昵称" },
|
|
119
|
+
{ colKey: "toEmail", title: "收件人" },
|
|
120
|
+
{ colKey: "ccEmail", title: "抄送" },
|
|
121
|
+
{ colKey: "bccEmail", title: "密送" },
|
|
122
|
+
{ colKey: "subject", title: "主题" },
|
|
123
|
+
{ colKey: "content", title: "内容" },
|
|
124
|
+
{ colKey: "sendTime", title: "发送时间" },
|
|
125
|
+
{ colKey: "sendResult", title: "发送结果" },
|
|
126
|
+
{ colKey: "messageId", title: "消息ID" },
|
|
127
|
+
{ colKey: "failReason", title: "失败原因" }
|
|
121
128
|
],
|
|
122
129
|
pagerConfig: {
|
|
123
130
|
currentPage: 1,
|
|
@@ -129,15 +136,15 @@ const $Data = $ref({
|
|
|
129
136
|
sendDialogVisible: false,
|
|
130
137
|
sending: false,
|
|
131
138
|
sendForm: {
|
|
132
|
-
to:
|
|
133
|
-
cc:
|
|
134
|
-
subject:
|
|
135
|
-
content:
|
|
139
|
+
to: "",
|
|
140
|
+
cc: "",
|
|
141
|
+
subject: "",
|
|
142
|
+
content: ""
|
|
136
143
|
},
|
|
137
144
|
sendRules: {
|
|
138
|
-
to: [{ required: true, message:
|
|
139
|
-
subject: [{ required: true, message:
|
|
140
|
-
content: [{ required: true, message:
|
|
145
|
+
to: [{ required: true, message: "请输入收件人邮箱", trigger: "blur" }],
|
|
146
|
+
subject: [{ required: true, message: "请输入邮件主题", trigger: "blur" }],
|
|
147
|
+
content: [{ required: true, message: "请输入邮件内容", trigger: "blur" }]
|
|
141
148
|
}
|
|
142
149
|
});
|
|
143
150
|
|
|
@@ -151,7 +158,7 @@ const $Method = {
|
|
|
151
158
|
async apiEmailLogList() {
|
|
152
159
|
$Data.loading = true;
|
|
153
160
|
try {
|
|
154
|
-
const res = await $Http(
|
|
161
|
+
const res = await $Http("/addon/admin/email/logList", {
|
|
155
162
|
page: $Data.pagerConfig.currentPage,
|
|
156
163
|
limit: $Data.pagerConfig.limit
|
|
157
164
|
});
|
|
@@ -166,7 +173,7 @@ const $Method = {
|
|
|
166
173
|
$Data.activeRowKeys = [];
|
|
167
174
|
}
|
|
168
175
|
} catch (error) {
|
|
169
|
-
MessagePlugin.error(
|
|
176
|
+
MessagePlugin.error("加载数据失败");
|
|
170
177
|
} finally {
|
|
171
178
|
$Data.loading = false;
|
|
172
179
|
}
|
|
@@ -175,10 +182,10 @@ const $Method = {
|
|
|
175
182
|
// 打开发送弹框
|
|
176
183
|
openSendDialog() {
|
|
177
184
|
$Data.sendForm = {
|
|
178
|
-
to:
|
|
179
|
-
cc:
|
|
180
|
-
subject:
|
|
181
|
-
content:
|
|
185
|
+
to: "",
|
|
186
|
+
cc: "",
|
|
187
|
+
subject: "",
|
|
188
|
+
content: ""
|
|
182
189
|
};
|
|
183
190
|
$Data.sendDialogVisible = true;
|
|
184
191
|
},
|
|
@@ -190,7 +197,7 @@ const $Method = {
|
|
|
190
197
|
|
|
191
198
|
$Data.sending = true;
|
|
192
199
|
try {
|
|
193
|
-
const res = await $Http(
|
|
200
|
+
const res = await $Http("/addon/admin/email/send", {
|
|
194
201
|
to: $Data.sendForm.to,
|
|
195
202
|
subject: $Data.sendForm.subject,
|
|
196
203
|
content: $Data.sendForm.content,
|
|
@@ -199,14 +206,14 @@ const $Method = {
|
|
|
199
206
|
});
|
|
200
207
|
|
|
201
208
|
if (res.code === 0) {
|
|
202
|
-
MessagePlugin.success(
|
|
209
|
+
MessagePlugin.success("发送成功");
|
|
203
210
|
$Data.sendDialogVisible = false;
|
|
204
211
|
$Method.apiEmailLogList();
|
|
205
212
|
} else {
|
|
206
|
-
MessagePlugin.error(res.msg ||
|
|
213
|
+
MessagePlugin.error(res.msg || "发送失败");
|
|
207
214
|
}
|
|
208
215
|
} catch (error) {
|
|
209
|
-
MessagePlugin.error(
|
|
216
|
+
MessagePlugin.error("发送失败");
|
|
210
217
|
} finally {
|
|
211
218
|
$Data.sending = false;
|
|
212
219
|
}
|
|
@@ -215,14 +222,14 @@ const $Method = {
|
|
|
215
222
|
// 验证配置
|
|
216
223
|
async onVerify() {
|
|
217
224
|
try {
|
|
218
|
-
const res = await $Http(
|
|
225
|
+
const res = await $Http("/addon/admin/email/verify");
|
|
219
226
|
if (res.code === 0) {
|
|
220
|
-
MessagePlugin.success(
|
|
227
|
+
MessagePlugin.success("邮件服务配置正常");
|
|
221
228
|
} else {
|
|
222
|
-
MessagePlugin.error(res.msg ||
|
|
229
|
+
MessagePlugin.error(res.msg || "配置异常");
|
|
223
230
|
}
|
|
224
231
|
} catch (error) {
|
|
225
|
-
MessagePlugin.error(
|
|
232
|
+
MessagePlugin.error("验证失败");
|
|
226
233
|
}
|
|
227
234
|
},
|
|
228
235
|
|
|
@@ -257,14 +264,14 @@ const $Method = {
|
|
|
257
264
|
|
|
258
265
|
// 格式化时间
|
|
259
266
|
formatTime(timestamp) {
|
|
260
|
-
if (!timestamp) return
|
|
267
|
+
if (!timestamp) return "-";
|
|
261
268
|
const date = new Date(timestamp);
|
|
262
269
|
const year = date.getFullYear();
|
|
263
|
-
const month = String(date.getMonth() + 1).padStart(2,
|
|
264
|
-
const day = String(date.getDate()).padStart(2,
|
|
265
|
-
const hours = String(date.getHours()).padStart(2,
|
|
266
|
-
const minutes = String(date.getMinutes()).padStart(2,
|
|
267
|
-
const seconds = String(date.getSeconds()).padStart(2,
|
|
270
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
271
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
272
|
+
const hours = String(date.getHours()).padStart(2, "0");
|
|
273
|
+
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
274
|
+
const seconds = String(date.getSeconds()).padStart(2, "0");
|
|
268
275
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
269
276
|
}
|
|
270
277
|
};
|