befly-admin-ui 1.18.0 → 1.19.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.
@@ -252,7 +252,7 @@ const $Method = {
252
252
  }
253
253
  }
254
254
 
255
- const res = await $Http.get(listEndpoint.path, data, listEndpoint.dropValues, listEndpoint.dropKeyValue);
255
+ const res = await $Http(listEndpoint.path, data, Array.isArray(listEndpoint.dropValues) ? ["", ...listEndpoint.dropValues] : [""], listEndpoint.dropKeyValue);
256
256
 
257
257
  if (seq !== $From.requestSeq) {
258
258
  return;
@@ -406,7 +406,7 @@ const $Method = {
406
406
  }
407
407
  }
408
408
 
409
- await $Http.post(ep.path, data, ep.dropValues, ep.dropKeyValue);
409
+ await $Http(ep.path, data, ep.dropValues, ep.dropKeyValue);
410
410
 
411
411
  MessagePlugin.success("删除成功");
412
412
  destroy();
@@ -183,7 +183,7 @@ const $Method = {
183
183
  },
184
184
  fetchUserInfo: async function () {
185
185
  try {
186
- const res = await $Http.get("/core/admin/detail", {}, [""]);
186
+ const res = await $Http("/core/admin/detail", {}, [""]);
187
187
  const userInfo = res?.data && typeof res.data === "object" ? res.data : {};
188
188
 
189
189
  $Data.userInfo.nickname = userInfo.nickname || "管理员";
@@ -197,7 +197,7 @@ const $Method = {
197
197
  },
198
198
  fetchUserMenus: async function () {
199
199
  try {
200
- const { data } = await $Http.get("/core/menu/all");
200
+ const { data } = await $Http("/core/menu/all", {}, [""]);
201
201
  const lists = Array.isArray(data?.lists) ? data.lists : [];
202
202
 
203
203
  const normalizedLists = lists.map((menu) => {
@@ -341,7 +341,7 @@ const $Method = {
341
341
  const hashedPassword = await hashPassword($Data.passwordForm.password);
342
342
  const storedPassword = await hashPassword(hashedPassword);
343
343
 
344
- await $Http.post("/core/admin/update", {
344
+ await $Http("/core/admin/update", {
345
345
  id: $Data.userInfo.id,
346
346
  password: storedPassword
347
347
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "befly-admin-ui",
3
- "version": "1.18.0",
3
+ "version": "1.19.0",
4
4
  "gitHead": "071d17be177355cdd61f30659c6e4c5873f87d39",
5
5
  "private": false,
6
6
  "description": "Befly - 管理后台功能组件",
@@ -118,7 +118,7 @@ const $Method = {
118
118
  params["id"] = $Prop.rowData.id;
119
119
  }
120
120
 
121
- await $Http.post(apiUrl, params);
121
+ await $Http(apiUrl, params);
122
122
  MessagePlugin.success($Prop.actionType === "add" ? "添加成功" : "更新成功");
123
123
  $Computed.visible = false;
124
124
  $Emit("success");
@@ -70,7 +70,6 @@ const $Data = reactive({
70
70
  endpoints: {
71
71
  list: {
72
72
  path: "/core/dict/select",
73
- dropValues: [""],
74
73
  buildData: () => {
75
74
  return {
76
75
  typeCode: $Data.searchTypeCode,
@@ -108,7 +107,7 @@ const $Method = {
108
107
  },
109
108
  apiDictTypeAll: async function () {
110
109
  try {
111
- const res = await $Http.get("/core/dictType/all", {}, [""]);
110
+ const res = await $Http("/core/dictType/all", {}, [""]);
112
111
  $Data.typeList = res.data.lists || [];
113
112
  } catch (error) {
114
113
  MessagePlugin.error(error.msg || error.message || "加载数据失败");
@@ -109,7 +109,7 @@ const $Method = {
109
109
  params["id"] = $Prop.rowData.id;
110
110
  }
111
111
 
112
- await $Http.post(apiUrl, params);
112
+ await $Http(apiUrl, params);
113
113
  MessagePlugin.success($Prop.actionType === "add" ? "添加成功" : "更新成功");
114
114
  $Computed.visible = false;
115
115
  $Emit("success");
@@ -60,7 +60,7 @@ const $Data = reactive({
60
60
  endpoints: {
61
61
  list: {
62
62
  path: "/core/dictType/select",
63
- dropValues: [0, ""],
63
+ dropValues: [0],
64
64
  dropKeyValue: {
65
65
  keyword: [""]
66
66
  },
@@ -159,7 +159,7 @@ const $Method = {
159
159
  $Data.submitting = true;
160
160
  try {
161
161
  const api = $Prop.actionType === "upd" ? "/core/sysConfig/update" : "/core/sysConfig/insert";
162
- await $Http.post(api, $Data.formData);
162
+ await $Http(api, $Data.formData);
163
163
 
164
164
  MessagePlugin.success($Prop.actionType === "upd" ? "编辑成功" : "添加成功");
165
165
  $Emit("success");
@@ -91,7 +91,7 @@ const $Data = reactive({
91
91
  endpoints: {
92
92
  list: {
93
93
  path: "/core/sysConfig/select",
94
- dropValues: [0, ""],
94
+ dropValues: [0],
95
95
  dropKeyValue: {
96
96
  group: [""]
97
97
  },
@@ -92,7 +92,7 @@ const $Data = reactive({
92
92
  const $Method = {
93
93
  fetchData: async function () {
94
94
  try {
95
- const res = await $Http.get("/core/dashboard/environmentInfo", {}, [""]);
95
+ const res = await $Http("/core/dashboard/environmentInfo", {}, [""]);
96
96
  Object.assign($Data.environmentInfo, res.data);
97
97
  } catch (_error) {
98
98
  // 静默失败:不阻断页面展示
@@ -228,7 +228,7 @@ const $Method = {
228
228
  },
229
229
  fetchData: async function () {
230
230
  try {
231
- const onlineStatsRes = await $Http.get("/core/tongJi/onlineStats", {}, [""]);
231
+ const onlineStatsRes = await $Http("/core/tongJi/onlineStats", {}, [""]);
232
232
  $Data.productState.options = $Method.mapProjectRows(onlineStatsRes.data);
233
233
  } catch (_error) {
234
234
  // 静默失败:不阻断页面展示
@@ -57,7 +57,7 @@ const $Const = {
57
57
  const $Method = {
58
58
  fetchData: async function () {
59
59
  try {
60
- const res = await $Http.get("/core/dashboard/serviceStatus", {}, [""]);
60
+ const res = await $Http("/core/dashboard/serviceStatus", {}, [""]);
61
61
  const nextServices = Array.isArray(res.data?.services) ? res.data.services.filter((service) => service?.name !== "OSS存储") : [];
62
62
  $Data.services.splice(0, $Data.services.length, ...nextServices);
63
63
  } catch (_error) {
@@ -74,7 +74,7 @@ const $Data = reactive({
74
74
  const $Method = {
75
75
  fetchData: async function () {
76
76
  try {
77
- const [overviewRes, errorStatsRes] = await Promise.all([$Http.get("/core/dashboard/systemOverview", {}, [""]), $Http.get("/core/tongJi/errorStats", {}, [""])]);
77
+ const [overviewRes, errorStatsRes] = await Promise.all([$Http("/core/dashboard/systemOverview", {}, [""]), $Http("/core/tongJi/errorStats", {}, [""])]);
78
78
 
79
79
  Object.assign($Data.permissionStats, overviewRes.data);
80
80
  $Data.errorStats.trend = Array.isArray(errorStatsRes.data?.trend) ? errorStatsRes.data.trend : [];
@@ -61,7 +61,7 @@ const $Data = reactive({
61
61
  const $Method = {
62
62
  fetchData: async function () {
63
63
  try {
64
- const res = await $Http.get("/core/dashboard/systemResources", {}, [""]);
64
+ const res = await $Http("/core/dashboard/systemResources", {}, [""]);
65
65
  Object.assign($Data.systemResources, res.data);
66
66
  } catch (_error) {
67
67
  // 静默失败:不阻断页面展示
@@ -116,8 +116,7 @@ const $Data = reactive({
116
116
  ]),
117
117
  endpoints: {
118
118
  list: {
119
- path: "/core/email/logList",
120
- dropValues: [""]
119
+ path: "/core/email/logList"
121
120
  }
122
121
  },
123
122
  sendDialogVisible: false,
@@ -145,7 +144,7 @@ const $Method = {
145
144
 
146
145
  $Data.sending = true;
147
146
  try {
148
- await $Http.post("/core/email/send", {
147
+ await $Http("/core/email/send", {
149
148
  to: $Data.sendForm.to,
150
149
  subject: $Data.sendForm.subject,
151
150
  content: $Data.sendForm.content,
@@ -170,7 +169,7 @@ const $Method = {
170
169
  },
171
170
  onVerify: async function () {
172
171
  try {
173
- await $Http.post("/core/email/verify");
172
+ await $Http("/core/email/verify");
174
173
  MessagePlugin.success("邮件服务配置正常");
175
174
  } catch (error) {
176
175
  MessagePlugin.error(error.msg || error.message || "验证失败");
@@ -127,7 +127,6 @@ const $Data = reactive({
127
127
  endpoints: {
128
128
  list: {
129
129
  path: "/core/tongJi/errorList",
130
- dropValues: [""],
131
130
  dropKeyValue: {
132
131
  keyword: [""],
133
132
  errorType: [""],
@@ -58,8 +58,7 @@ const $Data = reactive({
58
58
  ]),
59
59
  endpoints: {
60
60
  list: {
61
- path: "/core/loginLog/select",
62
- dropValues: [""]
61
+ path: "/core/loginLog/select"
63
62
  }
64
63
  }
65
64
  });
@@ -79,7 +79,6 @@ const $Data = reactive({
79
79
  endpoints: {
80
80
  list: {
81
81
  path: "/core/operateLog/select",
82
- dropValues: [""],
83
82
  dropKeyValue: {
84
83
  module: [""],
85
84
  action: [""]
@@ -121,7 +121,7 @@ const $Method = {
121
121
 
122
122
  const hashedPassword = await hashPassword($Data.formData.password);
123
123
 
124
- const res = await $Http.post("/core/auth/login", {
124
+ const res = await $Http("/core/auth/login", {
125
125
  loginType: $Data.formData.loginType,
126
126
  account: $Data.formData.account,
127
127
  password: hashedPassword
@@ -123,7 +123,7 @@ const $Method = {
123
123
  },
124
124
  apiRoleLists: async function () {
125
125
  try {
126
- const result = await $Http.get("/core/role/all", {}, [""]);
126
+ const result = await $Http("/core/role/all", {}, [""]);
127
127
  const roleList = Array.isArray(result.data?.lists) ? result.data.lists : [];
128
128
  $Type.roleOptions = roleList.map((item) => {
129
129
  return {
@@ -166,7 +166,7 @@ const $Method = {
166
166
  formData.password = await hashPassword(password);
167
167
  }
168
168
 
169
- const result = await $Http.post($Computed.isUpdate ? "/core/admin/update" : "/core/admin/insert", formData);
169
+ const result = await $Http($Computed.isUpdate ? "/core/admin/update" : "/core/admin/insert", formData);
170
170
 
171
171
  MessagePlugin.success(result.msg);
172
172
  $Emit("success");
@@ -57,8 +57,7 @@ const $Data = reactive({
57
57
  ]),
58
58
  endpoints: {
59
59
  list: {
60
- path: "/core/admin/select",
61
- dropValues: [""]
60
+ path: "/core/admin/select"
62
61
  },
63
62
  delete: {
64
63
  path: "/core/admin/delete",
@@ -83,7 +83,7 @@ const $Method = {
83
83
  loadApiAll: async function () {
84
84
  $Data.loading = true;
85
85
  try {
86
- const res = await $Http.get("/core/api/all", {}, [""]);
86
+ const res = await $Http("/core/api/all", {}, [""]);
87
87
  const list = res.data?.lists || [];
88
88
  $Data.allData = list;
89
89
  $Data.tableData = list;
@@ -59,7 +59,7 @@ const $Method = {
59
59
  apiMenuList: async function () {
60
60
  $Data.loading = true;
61
61
  try {
62
- const res = await $Http.get("/core/menu/all", {}, [""]);
62
+ const res = await $Http("/core/menu/all", {}, [""]);
63
63
  const lists = Array.isArray(res?.data?.lists) ? res.data.lists : [];
64
64
 
65
65
  const treeResult = arrayToTree(lists, "path", "parentPath", "children", "sort");
@@ -100,7 +100,7 @@ const $Method = {
100
100
  },
101
101
  apiApiAll: async function () {
102
102
  try {
103
- const res = await $Http.get("/core/api/all", {}, [""]);
103
+ const res = await $Http("/core/api/all", {}, [""]);
104
104
 
105
105
  const apiMap = new Map();
106
106
  const resRecord = res && typeof res === "object" ? res : null;
@@ -159,7 +159,7 @@ const $Method = {
159
159
  if (!$Prop.rowData.id) return;
160
160
 
161
161
  try {
162
- const res = await $Http.get(
162
+ const res = await $Http(
163
163
  "/core/role/apis",
164
164
  {
165
165
  roleCode: $Prop.rowData.code
@@ -204,7 +204,7 @@ const $Method = {
204
204
  try {
205
205
  $Data.submitting = true;
206
206
 
207
- await $Http.post("/core/role/apiSave", {
207
+ await $Http("/core/role/apiSave", {
208
208
  roleCode: $Prop.rowData.code,
209
209
  apiPaths: $Data.checkedApiPaths
210
210
  });
@@ -128,7 +128,7 @@ const $Method = {
128
128
 
129
129
  $Data.submitting = true;
130
130
  const formData = $Prop.actionType === "add" ? fieldClear($Data.formData, { omitKeys: ["id", "state"] }) : $Data.formData;
131
- const res = await $Http.post($Prop.actionType === "upd" ? "/core/role/update" : "/core/role/insert", formData);
131
+ const res = await $Http($Prop.actionType === "upd" ? "/core/role/update" : "/core/role/insert", formData);
132
132
 
133
133
  MessagePlugin.success(res.msg);
134
134
  $Emit("success");
@@ -77,7 +77,7 @@ const $Method = {
77
77
  },
78
78
  apiMenuAll: async function () {
79
79
  try {
80
- const res = await $Http.get("/core/menu/all", {}, [""]);
80
+ const res = await $Http("/core/menu/all", {}, [""]);
81
81
  const lists = Array.isArray(res?.data?.lists) ? res.data.lists : [];
82
82
 
83
83
  const treeResult = arrayToTree(lists, "path", "parentPath", "children", "sort");
@@ -129,7 +129,7 @@ const $Method = {
129
129
  if (!$Prop.rowData.id) return;
130
130
 
131
131
  try {
132
- const res = await $Http.get(
132
+ const res = await $Http(
133
133
  "/core/role/menus",
134
134
  {
135
135
  roleCode: $Prop.rowData.code
@@ -171,7 +171,7 @@ const $Method = {
171
171
  try {
172
172
  $Data.submitting = true;
173
173
 
174
- await $Http.post("/core/role/menuSave", {
174
+ await $Http("/core/role/menuSave", {
175
175
  roleCode: $Prop.rowData.code,
176
176
  menuPaths: $Data.checkedMenuPaths
177
177
  });
@@ -85,8 +85,7 @@ const $Data = reactive({
85
85
  ]),
86
86
  endpoints: {
87
87
  list: {
88
- path: "/core/role/select",
89
- dropValues: [""]
88
+ path: "/core/role/select"
90
89
  },
91
90
  delete: {
92
91
  path: "/core/role/delete",
@@ -173,7 +173,6 @@ const $Data = reactive({
173
173
  endpoints: {
174
174
  list: {
175
175
  path: "/core/source/imageList",
176
- dropValues: [""],
177
176
  dropKeyValue: {
178
177
  keyword: [""]
179
178
  },