@befly-addon/admin 1.4.2 → 1.5.0

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.
@@ -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 "@/utils/withDefaultColumns";
86
+ import { withDefaultColumns } from "../../../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 "@/utils/withDefaultColumns";
83
+ import { withDefaultColumns } from "../../../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 "@/utils/withDefaultColumns";
94
+ import { withDefaultColumns } from "../../../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 "@/utils/withDefaultColumns";
93
+ import { withDefaultColumns } from "../../../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 "@/utils/withDefaultColumns";
57
+ import { withDefaultColumns } from "../../../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 "@/utils/withDefaultColumns";
77
+ import { withDefaultColumns } from "../../../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 "../../utils/hashPassword";
73
+ import { hashPassword } from "../../../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 "@/../utils/fieldClear";
51
- import { hashPassword } from "@/../utils/hashPassword";
50
+ import { fieldClear } from "../../../../utils/fieldClear";
51
+ import { hashPassword } from "../../../../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 "@/utils/withDefaultColumns";
82
+ import { withDefaultColumns } from "../../../utils/withDefaultColumns";
83
83
 
84
84
  definePage({
85
85
  meta: {
@@ -54,9 +54,9 @@
54
54
  import { Button as TButton, Table as TTable, Tag as TTag, Input as TInput, MessagePlugin } from "tdesign-vue-next";
55
55
  import ILucideRotateCw from "~icons/lucide/rotate-cw";
56
56
  import ILucideSearch from "~icons/lucide/search";
57
- import { $Http } from "@/plugins/http";
58
- import { withDefaultColumns } from "@/utils/withDefaultColumns";
59
57
  import DetailPanel from "@/components/DetailPanel.vue";
58
+ import { $Http } from "@/plugins/http";
59
+ import { withDefaultColumns } from "../../../utils/withDefaultColumns";
60
60
 
61
61
  definePage({
62
62
  meta: {
@@ -44,8 +44,8 @@ import { Button as TButton, Table as TTable, Tag as TTag, MessagePlugin } from "
44
44
  import ILucideRotateCw from "~icons/lucide/rotate-cw";
45
45
  import DetailPanel from "@/components/DetailPanel.vue";
46
46
  import { $Http } from "@/plugins/http";
47
- import { arrayToTree } from "@/utils/arrayToTree";
48
- import { withDefaultColumns } from "@/utils/withDefaultColumns";
47
+ import { arrayToTree } from "../../../utils/arrayToTree";
48
+ import { withDefaultColumns } from "../../../utils/withDefaultColumns";
49
49
 
50
50
  definePage({
51
51
  meta: {
@@ -43,7 +43,7 @@ import {
43
43
  MessagePlugin
44
44
  } from "tdesign-vue-next";
45
45
  import { $Http } from "@/plugins/http";
46
- import { fieldClear } from "@/../utils/fieldClear";
46
+ import { fieldClear } from "../../../../utils/fieldClear";
47
47
 
48
48
  const $Prop = defineProps({
49
49
  modelValue: {
@@ -44,7 +44,7 @@
44
44
  import { Dialog as TDialog, CheckboxGroup as TCheckboxGroup, Checkbox as TCheckbox, Button as TButton, Input as TInput, MessagePlugin } from "tdesign-vue-next";
45
45
  import ILucideSearch from "~icons/lucide/search";
46
46
  import { $Http } from "@/plugins/http";
47
- import { arrayToTree } from "@/../utils/arrayToTree";
47
+ import { arrayToTree } from "../../../../utils/arrayToTree";
48
48
 
49
49
  const $Prop = defineProps({
50
50
  modelValue: {
@@ -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 "@/utils/withDefaultColumns";
105
+ import { withDefaultColumns } from "../../../utils/withDefaultColumns";
106
106
 
107
107
  definePage({
108
108
  meta: {
@@ -32,7 +32,7 @@ export default {
32
32
  await befly.redis.setObject("apis:all", apis.data.lists);
33
33
  results.apis = { success: true, count: apis.data.lists.length };
34
34
  } catch (error: any) {
35
- befly.logger.error({ err: error }, "刷新接口缓存失败");
35
+ befly.logger.error({ err: error, msg: "刷新接口缓存失败" });
36
36
  results.apis = { success: false, error: error.message };
37
37
  }
38
38
 
@@ -54,7 +54,7 @@ export default {
54
54
  childCount: childCount
55
55
  };
56
56
  } catch (error: any) {
57
- befly.logger.error({ err: error }, "刷新菜单缓存失败");
57
+ befly.logger.error({ err: error, msg: "刷新菜单缓存失败" });
58
58
  results.menus = { success: false, error: error.message };
59
59
  }
60
60
 
@@ -74,7 +74,7 @@ export default {
74
74
 
75
75
  results.roles = { success: true, count: count };
76
76
  } catch (error: any) {
77
- befly.logger.error({ err: error }, "刷新角色缓存失败");
77
+ befly.logger.error({ err: error, msg: "刷新角色缓存失败" });
78
78
  results.roles = { success: false, error: error.message };
79
79
  }
80
80
 
@@ -83,7 +83,7 @@ export default {
83
83
  await befly.cache.rebuildRoleApiPermissions();
84
84
  results.roleApiPermissions = { success: true };
85
85
  } catch (error: any) {
86
- befly.logger.error({ err: error }, "重建角色接口权限缓存失败");
86
+ befly.logger.error({ err: error, msg: "重建角色接口权限缓存失败" });
87
87
  results.roleApiPermissions = { success: false, error: error.message };
88
88
  }
89
89
 
@@ -96,7 +96,7 @@ export default {
96
96
  return befly.tool.No("部分缓存刷新失败", results);
97
97
  }
98
98
  } catch (error: any) {
99
- befly.logger.error({ err: error }, "刷新全部缓存失败");
99
+ befly.logger.error({ err: error, msg: "刷新全部缓存失败" });
100
100
  return befly.tool.No("刷新全部缓存失败", { error: error.message });
101
101
  }
102
102
  }
package/apis/api/all.ts CHANGED
@@ -21,7 +21,7 @@ export default {
21
21
 
22
22
  return befly.tool.Yes("操作成功", { lists: allApis });
23
23
  } catch (error: any) {
24
- befly.logger.error({ err: error }, "获取接口列表失败");
24
+ befly.logger.error({ err: error, msg: "获取接口列表失败" });
25
25
  return befly.tool.No("获取接口列表失败");
26
26
  }
27
27
  }
package/apis/api/list.ts CHANGED
@@ -20,7 +20,7 @@ export default {
20
20
 
21
21
  return befly.tool.Yes("操作成功", result.data);
22
22
  } catch (error: any) {
23
- befly.logger.error({ err: error }, "获取接口列表失败");
23
+ befly.logger.error({ err: error, msg: "获取接口列表失败" });
24
24
  return befly.tool.No("获取接口列表失败");
25
25
  }
26
26
  }
@@ -82,7 +82,7 @@ export default {
82
82
  return befly.tool.No("账号或密码错误");
83
83
  }
84
84
  } catch (error: any) {
85
- befly.logger.error({ err: error }, "密码验证失败");
85
+ befly.logger.error({ err: error, msg: "密码验证失败" });
86
86
  logData.failReason = "密码格式错误";
87
87
  await befly.db.insData({ table: "addon_admin_login_log", data: logData });
88
88
  return befly.tool.No("密码格式错误,请重新设置密码");
@@ -14,7 +14,7 @@ export default {
14
14
  responseTime: `${responseTime}ms`
15
15
  });
16
16
  } catch (error) {
17
- befly.logger.error({ err: error }, "数据库状态检测失败");
17
+ befly.logger.error({ err: error, msg: "数据库状态检测失败" });
18
18
  services.push({
19
19
  name: "数据库",
20
20
  status: "stopped",
@@ -34,7 +34,7 @@ export default {
34
34
  responseTime: `${responseTime}ms`
35
35
  });
36
36
  } catch (error) {
37
- befly.logger.error({ err: error }, "Redis状态检测失败");
37
+ befly.logger.error({ err: error, msg: "Redis状态检测失败" });
38
38
  services.push({
39
39
  name: "Redis",
40
40
  status: "stopped",
@@ -87,7 +87,7 @@ export default {
87
87
  befly.logger.warn("fs.statfs 不可用,无法获取磁盘信息");
88
88
  }
89
89
  } catch (error) {
90
- befly.logger.warn({ err: error }, "获取磁盘信息失败");
90
+ befly.logger.warn({ err: error, msg: "获取磁盘信息失败" });
91
91
  // 获取失败时返回 0
92
92
  diskPercentage = 0;
93
93
  diskUsed = 0;
@@ -57,7 +57,7 @@ export default {
57
57
  }
58
58
  });
59
59
  } catch (logError: any) {
60
- befly.logger.error({ err: logError }, "记录邮件日志失败");
60
+ befly.logger.error({ err: logError, msg: "记录邮件日志失败" });
61
61
  }
62
62
 
63
63
  if (result.success) {
package/apis/menu/all.ts CHANGED
@@ -51,7 +51,7 @@ export default {
51
51
  // 6. 返回一维数组(由前端构建树形结构)
52
52
  return befly.tool.Yes("获取菜单成功", { lists: authorizedMenus });
53
53
  } catch (error: any) {
54
- befly.logger.error({ err: error }, "获取用户菜单失败");
54
+ befly.logger.error({ err: error, msg: "获取用户菜单失败" });
55
55
  return befly.tool.No("获取菜单失败");
56
56
  }
57
57
  }
package/apis/menu/list.ts CHANGED
@@ -14,7 +14,7 @@ export default {
14
14
 
15
15
  return befly.tool.Yes("操作成功", { lists: menus.data.lists });
16
16
  } catch (error) {
17
- befly.logger.error({ err: error }, "获取菜单列表失败");
17
+ befly.logger.error({ err: error, msg: "获取菜单列表失败" });
18
18
  return befly.tool.No("操作失败");
19
19
  }
20
20
  }
package/apis/role/del.ts CHANGED
@@ -42,7 +42,7 @@ export default {
42
42
 
43
43
  return befly.tool.Yes("操作成功");
44
44
  } catch (error: any) {
45
- befly.logger.error({ err: error }, "删除角色失败");
45
+ befly.logger.error({ err: error, msg: "删除角色失败" });
46
46
  return befly.tool.No("操作失败");
47
47
  }
48
48
  }
package/apis/role/save.ts CHANGED
@@ -36,7 +36,7 @@ export default {
36
36
 
37
37
  return befly.tool.Yes("操作成功");
38
38
  } catch (error: any) {
39
- befly.logger.error({ err: error }, "保存用户角色失败");
39
+ befly.logger.error({ err: error, msg: "保存用户角色失败" });
40
40
  return befly.tool.No("操作失败");
41
41
  }
42
42
  }
@@ -26,7 +26,7 @@ export default {
26
26
 
27
27
  return befly.tool.Yes("操作成功");
28
28
  } catch (error) {
29
- befly.logger.error({ err: error }, "删除系统配置失败");
29
+ befly.logger.error({ err: error, msg: "删除系统配置失败" });
30
30
  return befly.tool.No("操作失败");
31
31
  }
32
32
  }
@@ -31,7 +31,7 @@ export default {
31
31
 
32
32
  return befly.tool.Yes("操作成功", { id: configId.data });
33
33
  } catch (error) {
34
- befly.logger.error({ err: error }, "添加系统配置失败");
34
+ befly.logger.error({ err: error, msg: "添加系统配置失败" });
35
35
  return befly.tool.No("操作失败");
36
36
  }
37
37
  }
@@ -46,7 +46,7 @@ export default {
46
46
 
47
47
  return befly.tool.Yes("操作成功");
48
48
  } catch (error) {
49
- befly.logger.error({ err: error }, "更新系统配置失败");
49
+ befly.logger.error({ err: error, msg: "更新系统配置失败" });
50
50
  return befly.tool.No("操作失败");
51
51
  }
52
52
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@befly-addon/admin",
3
- "version": "1.4.2",
4
- "gitHead": "2009041148b2aa264349cc4b78f5965ec2af891c",
3
+ "version": "1.5.0",
4
+ "gitHead": "340c00e4dd05b62d89d25c01922c27cb35bd99af",
5
5
  "private": false,
6
6
  "description": "Befly - 管理后台功能组件",
7
7
  "keywords": [