befly-admin 4.50.0 → 4.52.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "befly-admin",
3
- "version": "4.50.0",
3
+ "version": "4.52.0",
4
4
  "gitHead": "282f7accca9c8d55956a5490c0365cce4a1ad90d",
5
5
  "private": false,
6
6
  "description": "Befly Admin - 基于 Vue3 + TDesign Vue Next 的后台管理系统",
@@ -28,10 +28,10 @@
28
28
  "preview": "bunx --bun befly-vite preview"
29
29
  },
30
30
  "dependencies": {
31
- "befly-admin-ui": "1.56.0",
32
- "befly-shared": "2.31.0",
33
- "befly-vite": "1.43.0",
34
- "pinia": "^3.0.4",
31
+ "befly-admin-ui": "1.58.0",
32
+ "befly-shared": "2.32.0",
33
+ "befly-vite": "1.44.0",
34
+ "pinia": "^4.0.1",
35
35
  "tdesign-icons-vue-next": "^0.4.6",
36
36
  "tdesign-vue-next": "^1.20.3",
37
37
  "vue": "^3.5.39",
package/src/main.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { createPinia } from "pinia";
2
+
1
3
  // 引入 TDesign 样式
2
4
  import "tdesign-vue-next/es/style/index.css";
3
5
  // 引入 adminUI 的 CSS 变量
@@ -5,15 +7,12 @@ import "befly-admin-ui/styles/variables.scss";
5
7
  import "befly-admin-ui/styles/global.scss";
6
8
  // 引入全局基础样式(reset、通用类、滚动条等)
7
9
  import "@/styles/global.scss";
8
- import { setupDailyReport } from "befly-shared/dailyReport";
9
- import { setupErrorReport } from "befly-shared/errorReport";
10
- import { createPinia } from "pinia";
11
10
  import { createApp } from "vue";
12
11
 
12
+ import { setupDailyReport } from "@/plugins/report.js";
13
+
13
14
  import App from "./App.vue";
14
- import { $Config } from "./plugins/config.js";
15
15
  import { $Router } from "./plugins/router.js";
16
- import { $Store } from "./plugins/store.js";
17
16
 
18
17
  const app = createApp(App);
19
18
 
@@ -23,25 +22,6 @@ app.use(createPinia());
23
22
  // 使用路由
24
23
  app.use($Router);
25
24
 
26
- const reportOptions = {
27
- apiPath: $Config.apiPath,
28
- clientType: "browser",
29
- getToken: () => $Store.local.get($Config.tokenName, ""),
30
- onReturn: async (payload) => payload,
31
- productName: $Config.productName,
32
- productCode: $Config.productCode,
33
- productVersion: $Config.productVersion,
34
- router: $Router
35
- };
36
-
37
- setupDailyReport(reportOptions);
38
- setupErrorReport(
39
- Object.assign(
40
- {
41
- app: app
42
- },
43
- reportOptions
44
- )
45
- );
25
+ setupDailyReport();
46
26
 
47
27
  app.mount("#app");
@@ -1,6 +1,6 @@
1
1
  import { createHttp } from "befly-shared/createHttp";
2
2
 
3
- import { $Config } from "@/plugins/config.js";
3
+ import { $Config } from "@/configs/config.js";
4
4
  import { $Router } from "@/plugins/router.js";
5
5
  import { $Store } from "@/plugins/store.js";
6
6
 
@@ -0,0 +1,36 @@
1
+ import { parseUserAgent } from "befly-shared/userAgent";
2
+
3
+ import { $Config } from "@/configs/config.js";
4
+ import { $Http } from "@/plugins/http.js";
5
+
6
+ const DAILY_REPORT_PATH = "/core/tongJi/dailyReport";
7
+ const CLIENT_ID_KEY = "befly-daily-client-id";
8
+
9
+ function getClientId() {
10
+ const storedClientId = String(globalThis.localStorage?.getItem(CLIENT_ID_KEY) || "").trim();
11
+ if (storedClientId) {
12
+ return storedClientId;
13
+ }
14
+
15
+ const clientId = `${Date.now()}-${Math.random().toString(16).slice(2)}`;
16
+ globalThis.localStorage?.setItem(CLIENT_ID_KEY, clientId);
17
+ return clientId;
18
+ }
19
+
20
+ export function setupDailyReport() {
21
+ const ua = parseUserAgent(globalThis.navigator?.userAgent);
22
+
23
+ $Http(DAILY_REPORT_PATH, {
24
+ productName: $Config.productName,
25
+ productCode: $Config.productCode,
26
+ productVersion: $Config.productVersion,
27
+ clientType: "browser",
28
+ clientId: getClientId(),
29
+ clientVersion: `${ua.browserName || ""} ${ua.browserVersion || ""}`.trim(),
30
+ os: `${ua.osName || ""} ${ua.osVersion || ""}`.trim(),
31
+ deviceId: "",
32
+ brand: ua.deviceVendor || "",
33
+ model: ua.deviceModel || "",
34
+ system: ua.osName || ""
35
+ });
36
+ }
@@ -2,7 +2,7 @@ import { Layouts } from "befly-vite";
2
2
  import { createRouter, createWebHashHistory } from "vue-router";
3
3
  import { routes } from "vue-router/auto-routes";
4
4
 
5
- import { $Config } from "@/plugins/config.js";
5
+ import { $Config } from "@/configs/config.js";
6
6
  import { $Store } from "@/plugins/store.js";
7
7
 
8
8
  // 应用自定义布局系统(同时可选注入根路径重定向)
File without changes