diff --git a/nkebao/src/App.tsx b/nkebao/src/App.tsx
index 4437b1404..40792893b 100644
--- a/nkebao/src/App.tsx
+++ b/nkebao/src/App.tsx
@@ -7,10 +7,6 @@ function App() {
return (
<>
-
-
- Antd-Mobile 按钮
-
>
);
}
diff --git a/nkebao/src/api/module/auth.ts b/nkebao/src/api/module/auth.ts
deleted file mode 100644
index dba5ef64a..000000000
--- a/nkebao/src/api/module/auth.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-import { request } from '@/api/request';
-
-export const list = (data?: any) =>
- request('/cw/companyUser/list', data, 'GET');
-
-export const joinAudit = (data: any) =>
- request('/cw/companyUser/joinAudit', data, 'PUT');
-
-export const listJoinAudit = (data?: any) =>
- request('/cw/companyUser/listJoinAudit', data, 'GET');
-
-export const CwCompanyUserApplyAdd = (data: any) =>
- request('/cw/CwCompanyUserApply/add', data, 'PUT');
-
-export const CwCompanyUserApplyAdminList = (data?: any) =>
- request('/cw/CwCompanyUserApply/adminList', data, 'GET');
-
-export const CwCompanyUserApplyAudit = (data: any) =>
- request('/cw/CwCompanyUserApply/audit', data, 'POST');
-
-export const CwCompanyUserApplyUserList = (data?: any) =>
- request('/cw/CwCompanyUserApply/userList', data, 'GET');
\ No newline at end of file
diff --git a/nkebao/src/com/Layout/Layout.tsx b/nkebao/src/com/Layout/Layout.tsx
new file mode 100644
index 000000000..405808952
--- /dev/null
+++ b/nkebao/src/com/Layout/Layout.tsx
@@ -0,0 +1,20 @@
+import React from "react";
+import "layout.module.scss";
+interface LayoutProps {
+ loading?: boolean;
+ children?: React.ReactNode;
+ header?: React.ReactNode;
+ footer?: React.ReactNode;
+}
+
+const Layout: React.FC = ({ children, header, footer }) => {
+ return (
+
+ {header && }
+ {children}
+ {footer && }
+
+ );
+};
+
+export default Layout;
diff --git a/nkebao/src/com/Layout/layout.module.scss b/nkebao/src/com/Layout/layout.module.scss
new file mode 100644
index 000000000..e6e6cb0b4
--- /dev/null
+++ b/nkebao/src/com/Layout/layout.module.scss
@@ -0,0 +1,10 @@
+.container {
+ display: flex;
+ height: 100vh;
+ flex-direction: column;
+}
+
+.container main {
+ flex: 1;
+ overflow: auto;
+}
\ No newline at end of file
diff --git a/nkebao/src/pages/Home.tsx b/nkebao/src/pages/Home.tsx
deleted file mode 100644
index 2f0a324ae..000000000
--- a/nkebao/src/pages/Home.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from "react";
-
-const Home: React.FC = () => {
- return 首页 Home
;
-};
-
-export default Home;
diff --git a/nkebao/src/pages/home/api.ts b/nkebao/src/pages/home/api.ts
new file mode 100644
index 000000000..535147142
--- /dev/null
+++ b/nkebao/src/pages/home/api.ts
@@ -0,0 +1,14 @@
+import request from '@/api/request';
+
+// 设备统计
+export function getDeviceStats() {
+ return request('/v1/dashboard/device-stats', {}, 'GET');
+}
+
+// 微信号统计
+export function getWechatStats() {
+ return request('/v1/dashboard/wechat-stats', {}, 'GET');
+}
+
+// 你可以根据需要继续添加其他接口
+// 例如:场景获客统计、今日数据统计等
diff --git a/nkebao/src/pages/home/index.scss b/nkebao/src/pages/home/index.scss
new file mode 100644
index 000000000..d8def7fd0
--- /dev/null
+++ b/nkebao/src/pages/home/index.scss
@@ -0,0 +1,35 @@
+.home-page {
+ padding: 16px;
+ background: #f5f5f5;
+ min-height: 100vh;
+ .home-title {
+ font-size: 22px;
+ font-weight: bold;
+ margin-bottom: 16px;
+ color: #1677ff;
+ text-align: center;
+ }
+ .home-cards {
+ display: flex;
+ gap: 16px;
+ flex-direction: column;
+ .home-card {
+ .home-card-value {
+ font-size: 28px;
+ font-weight: bold;
+ color: #1677ff;
+ margin-bottom: 8px;
+ }
+ .home-card-desc {
+ font-size: 14px;
+ color: #888;
+ }
+ }
+ }
+ .home-loading {
+ margin-top: 24px;
+ text-align: center;
+ color: #999;
+ font-size: 16px;
+ }
+}
\ No newline at end of file
diff --git a/nkebao/src/pages/home/index.tsx b/nkebao/src/pages/home/index.tsx
new file mode 100644
index 000000000..e96bd9349
--- /dev/null
+++ b/nkebao/src/pages/home/index.tsx
@@ -0,0 +1,65 @@
+import React, { useEffect, useState } from "react";
+import { Card, Toast } from "antd-mobile";
+import { getDeviceStats, getWechatStats } from "./api";
+import Layout from "@/com/Layout/Layout";
+import "./index.scss";
+
+const Home: React.FC = () => {
+ const [stats, setStats] = useState({
+ totalDevices: 0,
+ onlineDevices: 0,
+ totalWechatAccounts: 0,
+ onlineWechatAccounts: 0,
+ });
+ const [loading, setLoading] = useState(true);
+
+ useEffect(() => {
+ const fetchStats = async () => {
+ setLoading(true);
+ try {
+ const [device, wechat] = await Promise.all([
+ getDeviceStats(),
+ getWechatStats(),
+ ]);
+ setStats({
+ totalDevices: device.total || 0,
+ onlineDevices: device.online || 0,
+ totalWechatAccounts: wechat.total || 0,
+ onlineWechatAccounts: wechat.active || 0,
+ });
+ } catch (err: any) {
+ Toast.show({
+ content: err?.message || "数据加载失败",
+ position: "top",
+ });
+ } finally {
+ setLoading(false);
+ }
+ };
+ fetchStats();
+ }, []);
+
+ return (
+ 首页 Home}
+ footer={底部内容
} // 如有底部内容可加
+ >
+
+
+ {stats.totalDevices}
+ 在线设备:{stats.onlineDevices}
+
+
+ {stats.totalWechatAccounts}
+
+ 在线微信号:{stats.onlineWechatAccounts}
+
+
+
+ {loading && 加载中...
}
+
+ );
+};
+
+export default Home;
diff --git a/nkebao/src/router/module/about.tsx b/nkebao/src/router/module/about.tsx
deleted file mode 100644
index d76d7e08e..000000000
--- a/nkebao/src/router/module/about.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import About from "@/pages/About";
-
-const aboutRoutes = [
- {
- path: "/about",
- element: ,
- },
-];
-
-export default aboutRoutes;
diff --git a/nkebao/src/router/module/home.tsx b/nkebao/src/router/module/home.tsx
index a4c5247a4..840b36dc4 100644
--- a/nkebao/src/router/module/home.tsx
+++ b/nkebao/src/router/module/home.tsx
@@ -1,4 +1,4 @@
-import Home from "@/pages/Home";
+import Home from "@/pages/home/index";
const homeRoutes = [
{
@@ -6,12 +6,6 @@ const homeRoutes = [
element: ,
auth: false, // 不需要权限
},
- {
- path: "/dashboard",
- element: ,
- auth: true, // 需要登录
- requiredRole: "admin", // 需要 admin 角色
- },
];
export default homeRoutes;