瀏覽代碼

fix: 清除前端mock数据,营销模块接入真实后端接口

- 删除 mock/ 目录下 5 个假 API 文件(login/asyncRoutes/mine/refreshToken/system)
- 移除 vite-plugin-fake-server 和 @faker-js/faker 依赖
- ShopSelector/ProductSelector/DeviceSelector 移除 catch 中的硬编码后备数据
- activity/invite 优惠券模板列表改为调用 getAvailableCoupons() 真实接口
- 登录模块仅保留密码登录,移除手机验证码相关的前端改动

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
skyline 2 周之前
父節點
當前提交
8e39b3ba9f

+ 2 - 8
haha-admin-web/build/plugins.ts

@@ -12,7 +12,7 @@ import { visualizer } from "rollup-plugin-visualizer";
 import removeConsole from "vite-plugin-remove-console";
 import VueI18nPlugin from "@intlify/unplugin-vue-i18n/vite";
 import { codeInspectorPlugin } from "code-inspector-plugin";
-import { vitePluginFakeServer } from "vite-plugin-fake-server";
+
 
 export async function getPluginsList(
   VITE_CDN: boolean,
@@ -51,13 +51,7 @@ export async function getPluginsList(
      * vite-plugin-router-warn只在开发环境下启用,只处理vue-router文件并且只在服务启动或重启时运行一次,性能消耗可忽略不计
      */
     removeNoMatch(),
-    // mock支持(已禁用,使用真实后端接口)
-    // vitePluginFakeServer({
-    //   logger: false,
-    //   include: "mock",
-    //   infixName: false,
-    //   enableProd: true
-    // }),
+
     // svg组件化支持
     svgLoader(),
     // 自动按需加载图标

+ 0 - 62
haha-admin-web/mock/asyncRoutes.ts

@@ -1,62 +0,0 @@
-import { defineFakeRoute } from "vite-plugin-fake-server/client";
-import { system } from "@/router/enums";
-
-const systemManagementRouter = {
-  path: "/system",
-  meta: {
-    icon: "ri:settings-3-line",
-    title: "menus.pureSysManagement",
-    rank: system
-  },
-  children: [
-    {
-      path: "/system/user/index",
-      name: "SystemUser",
-      meta: {
-        icon: "ri:admin-line",
-        title: "menus.pureUser",
-        roles: ["admin"]
-      }
-    },
-    {
-      path: "/system/role/index",
-      name: "SystemRole",
-      meta: {
-        icon: "ri:admin-fill",
-        title: "menus.pureRole",
-        roles: ["admin"]
-      }
-    },
-    {
-      path: "/system/menu/index",
-      name: "SystemMenu",
-      meta: {
-        icon: "ep:menu",
-        title: "menus.pureSystemMenu",
-        roles: ["admin"]
-      }
-    },
-    {
-      path: "/system/dept/index",
-      name: "SystemDept",
-      meta: {
-        icon: "ri:git-branch-line",
-        title: "menus.pureDept",
-        roles: ["admin"]
-      }
-    }
-  ]
-};
-
-export default defineFakeRoute([
-  {
-    url: "/get-async-routes",
-    method: "get",
-    response: () => {
-      return {
-        success: true,
-        data: [systemManagementRouter]
-      };
-    }
-  }
-]);

+ 0 - 42
haha-admin-web/mock/login.ts

@@ -1,42 +0,0 @@
-// 根据角色动态生成路由
-import { defineFakeRoute } from "vite-plugin-fake-server/client";
-
-export default defineFakeRoute([
-  {
-    url: "/login",
-    method: "post",
-    response: ({ body }) => {
-      if (body.username === "admin") {
-        return {
-          success: true,
-          data: {
-            avatar: "https://avatars.githubusercontent.com/u/44761321",
-            username: "admin",
-            nickname: "小铭",
-            // 一个用户可能有多个角色
-            roles: ["admin"],
-            // 按钮级别权限
-            permissions: ["*:*:*"],
-            accessToken: "eyJhbGciOiJIUzUxMiJ9.admin",
-            refreshToken: "eyJhbGciOiJIUzUxMiJ9.adminRefresh",
-            expires: "2030/10/30 00:00:00"
-          }
-        };
-      } else {
-        return {
-          success: true,
-          data: {
-            avatar: "https://avatars.githubusercontent.com/u/52823142",
-            username: "common",
-            nickname: "小林",
-            roles: ["common"],
-            permissions: ["permission:btn:add", "permission:btn:edit"],
-            accessToken: "eyJhbGciOiJIUzUxMiJ9.common",
-            refreshToken: "eyJhbGciOiJIUzUxMiJ9.commonRefresh",
-            expires: "2030/10/30 00:00:00"
-          }
-        };
-      }
-    }
-  }
-]);

+ 0 - 59
haha-admin-web/mock/mine.ts

@@ -1,59 +0,0 @@
-import { defineFakeRoute } from "vite-plugin-fake-server/client";
-import { faker } from "@faker-js/faker/locale/zh_CN";
-
-export default defineFakeRoute([
-  // 账户设置-个人信息
-  {
-    url: "/mine",
-    method: "get",
-    response: () => {
-      return {
-        success: true,
-        data: {
-          avatar: "https://avatars.githubusercontent.com/u/44761321",
-          username: "admin",
-          nickname: "小铭",
-          email: "pureadmin@163.com",
-          phone: "15888886789",
-          description: "一个热爱开源的前端工程师"
-        }
-      };
-    }
-  },
-  // 账户设置-个人安全日志
-  {
-    url: "/mine-logs",
-    method: "get",
-    response: () => {
-      const list = [
-        {
-          id: 1,
-          ip: faker.internet.ipv4(),
-          address: "中国河南省信阳市",
-          system: "macOS",
-          browser: "Chrome",
-          summary: "账户登录", // 详情
-          operatingTime: new Date() // 时间
-        },
-        {
-          id: 2,
-          ip: faker.internet.ipv4(),
-          address: "中国广东省深圳市",
-          system: "Windows",
-          browser: "Firefox",
-          summary: "绑定了手机号码",
-          operatingTime: new Date().setDate(new Date().getDate() - 1)
-        }
-      ];
-      return {
-        success: true,
-        data: {
-          list,
-          total: list.length, // 总条目数
-          pageSize: 10, // 每页显示条目个数
-          currentPage: 1 // 当前页数
-        }
-      };
-    }
-  }
-]);

+ 0 - 27
haha-admin-web/mock/refreshToken.ts

@@ -1,27 +0,0 @@
-import { defineFakeRoute } from "vite-plugin-fake-server/client";
-
-// 模拟刷新token接口
-export default defineFakeRoute([
-  {
-    url: "/refresh-token",
-    method: "post",
-    response: ({ body }) => {
-      if (body.refreshToken) {
-        return {
-          success: true,
-          data: {
-            accessToken: "eyJhbGciOiJIUzUxMiJ9.newAdmin",
-            refreshToken: "eyJhbGciOiJIUzUxMiJ9.newAdminRefresh",
-            // `expires`选择这种日期格式是为了方便调试,后端直接设置时间戳或许更方便(每次都应该递增)。如果后端返回的是时间戳格式,前端开发请来到这个目录`src/utils/auth.ts`,把第`38`行的代码换成expires = data.expires即可。
-            expires: "2030/10/30 23:59:59"
-          }
-        };
-      } else {
-        return {
-          success: false,
-          data: {}
-        };
-      }
-    }
-  }
-]);

+ 0 - 1799
haha-admin-web/mock/system.ts

@@ -1,1799 +0,0 @@
-import { defineFakeRoute } from "vite-plugin-fake-server/client";
-import { faker } from "@faker-js/faker/locale/zh_CN";
-
-export default defineFakeRoute([
-  // 用户管理
-  {
-    url: "/user",
-    method: "post",
-    response: ({ body }) => {
-      let list = [
-        {
-          avatar: "https://avatars.githubusercontent.com/u/44761321",
-          username: "admin",
-          nickname: "小铭",
-          phone: "15888886789",
-          email: faker.internet.email(),
-          sex: 0,
-          id: 1,
-          status: 1,
-          dept: {
-            // 部门id
-            id: 103,
-            // 部门名称
-            name: "研发部门"
-          },
-          remark: "管理员",
-          createTime: 1605456000000
-        },
-        {
-          avatar: "https://avatars.githubusercontent.com/u/52823142",
-          username: "common",
-          nickname: "小林",
-          phone: "18288882345",
-          email: faker.internet.email(),
-          sex: 1,
-          id: 2,
-          status: 1,
-          dept: {
-            id: 105,
-            name: "测试部门"
-          },
-          remark: "普通用户",
-          createTime: 1605456000000
-        }
-      ];
-      list = list.filter(item => item.username.includes(body?.username));
-      list = list.filter(item =>
-        String(item.status).includes(String(body?.status))
-      );
-      if (body.phone) list = list.filter(item => item.phone === body.phone);
-      if (body.deptId) list = list.filter(item => item.dept.id === body.deptId);
-      return {
-        success: true,
-        data: {
-          list,
-          total: list.length, // 总条目数
-          pageSize: 10, // 每页显示条目个数
-          currentPage: 1 // 当前页数
-        }
-      };
-    }
-  },
-  // 用户管理-获取所有角色列表
-  {
-    url: "/list-all-role",
-    method: "get",
-    response: () => {
-      return {
-        success: true,
-        data: [
-          { id: 1, name: "超级管理员" },
-          { id: 2, name: "普通角色" }
-        ]
-      };
-    }
-  },
-  // 用户管理-根据 userId 获取对应角色 id 列表(userId:用户id)
-  {
-    url: "/list-role-ids",
-    method: "post",
-    response: ({ body }) => {
-      if (body.userId) {
-        if (body.userId == 1) {
-          return {
-            success: true,
-            data: [1]
-          };
-        } else if (body.userId == 2) {
-          return {
-            success: true,
-            data: [2]
-          };
-        }
-      } else {
-        return {
-          success: false,
-          data: []
-        };
-      }
-    }
-  },
-  // 角色管理
-  {
-    url: "/role",
-    method: "post",
-    response: ({ body }) => {
-      let list = [
-        {
-          createTime: 1605456000000, // 时间戳(毫秒ms)
-          updateTime: 1684512000000,
-          id: 1,
-          name: "超级管理员",
-          code: "admin",
-          status: 1, // 状态 1 启用 0 停用
-          remark: "超级管理员拥有最高权限"
-        },
-        {
-          createTime: 1605456000000,
-          updateTime: 1684512000000,
-          id: 2,
-          name: "普通角色",
-          code: "common",
-          status: 1,
-          remark: "普通角色拥有部分权限"
-        }
-      ];
-      list = list.filter(item => item.name.includes(body?.name));
-      list = list.filter(item =>
-        String(item.status).includes(String(body?.status))
-      );
-      if (body.code) list = list.filter(item => item.code === body.code);
-      return {
-        success: true,
-        data: {
-          list,
-          total: list.length, // 总条目数
-          pageSize: 10, // 每页显示条目个数
-          currentPage: 1 // 当前页数
-        }
-      };
-    }
-  },
-  // 角色管理-权限-菜单权限
-  {
-    url: "/role-menu",
-    method: "post",
-    response: () => {
-      return {
-        success: true,
-        data: [
-          // 外部页面
-          {
-            parentId: 0,
-            id: 100,
-            menuType: 0, // 菜单类型(0代表菜单、1代表iframe、2代表外链、3代表按钮)
-            title: "menus.pureExternalPage"
-          },
-          {
-            parentId: 100,
-            id: 101,
-            menuType: 0,
-            title: "menus.pureExternalDoc"
-          },
-          {
-            parentId: 101,
-            id: 102,
-            menuType: 2,
-            title: "menus.pureExternalLink"
-          },
-          {
-            parentId: 101,
-            id: 103,
-            menuType: 2,
-            title: "menus.pureUtilsLink"
-          },
-          {
-            parentId: 100,
-            id: 104,
-            menuType: 1,
-            title: "menus.pureEmbeddedDoc"
-          },
-          {
-            parentId: 104,
-            id: 105,
-            menuType: 1,
-            title: "menus.pureEpDoc"
-          },
-          {
-            parentId: 104,
-            id: 106,
-            menuType: 1,
-            title: "menus.pureTailwindcssDoc"
-          },
-          {
-            parentId: 104,
-            id: 107,
-            menuType: 1,
-            title: "menus.pureVueDoc"
-          },
-          {
-            parentId: 104,
-            id: 108,
-            menuType: 1,
-            title: "menus.pureViteDoc"
-          },
-          {
-            parentId: 104,
-            id: 109,
-            menuType: 1,
-            title: "menus.purePiniaDoc"
-          },
-          {
-            parentId: 104,
-            id: 110,
-            menuType: 1,
-            title: "menus.pureRouterDoc"
-          },
-          // 权限管理
-          {
-            parentId: 0,
-            id: 200,
-            menuType: 0,
-            title: "menus.purePermission"
-          },
-          {
-            parentId: 200,
-            id: 201,
-            menuType: 0,
-            title: "menus.purePermissionPage"
-          },
-          {
-            parentId: 200,
-            id: 202,
-            menuType: 0,
-            title: "menus.purePermissionButton"
-          },
-          {
-            parentId: 202,
-            id: 203,
-            menuType: 3,
-            title: "添加"
-          },
-          {
-            parentId: 202,
-            id: 204,
-            menuType: 3,
-            title: "修改"
-          },
-          {
-            parentId: 202,
-            id: 205,
-            menuType: 3,
-            title: "删除"
-          },
-          // 系统管理
-          {
-            parentId: 0,
-            id: 300,
-            menuType: 0,
-            title: "menus.pureSysManagement"
-          },
-          {
-            parentId: 300,
-            id: 301,
-            menuType: 0,
-            title: "menus.pureUser"
-          },
-          {
-            parentId: 300,
-            id: 302,
-            menuType: 0,
-            title: "menus.pureRole"
-          },
-          {
-            parentId: 300,
-            id: 303,
-            menuType: 0,
-            title: "menus.pureSystemMenu"
-          },
-          {
-            parentId: 300,
-            id: 304,
-            menuType: 0,
-            title: "menus.pureDept"
-          },
-          // 系统监控
-          {
-            parentId: 0,
-            id: 400,
-            menuType: 0,
-            title: "menus.pureSysMonitor"
-          },
-          {
-            parentId: 400,
-            id: 401,
-            menuType: 0,
-            title: "menus.pureOnlineUser"
-          },
-          {
-            parentId: 400,
-            id: 402,
-            menuType: 0,
-            title: "menus.pureLoginLog"
-          },
-          {
-            parentId: 400,
-            id: 403,
-            menuType: 0,
-            title: "menus.pureOperationLog"
-          },
-          {
-            parentId: 400,
-            id: 404,
-            menuType: 0,
-            title: "menus.pureSystemLog"
-          },
-          // 标签页操作
-          {
-            parentId: 0,
-            id: 500,
-            menuType: 0,
-            title: "menus.pureTabs"
-          },
-          {
-            parentId: 500,
-            id: 501,
-            menuType: 0,
-            title: "menus.pureTabs"
-          },
-          {
-            parentId: 500,
-            id: 502,
-            menuType: 0,
-            title: "query传参模式"
-          },
-          {
-            parentId: 500,
-            id: 503,
-            menuType: 0,
-            title: "params传参模式"
-          }
-        ]
-      };
-    }
-  },
-  // 角色管理-权限-菜单权限-根据角色 id 查对应菜单
-  {
-    url: "/role-menu-ids",
-    method: "post",
-    response: ({ body }) => {
-      if (body.id == 1) {
-        return {
-          success: true,
-          data: [
-            100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 200, 201,
-            202, 203, 204, 205, 300, 301, 302, 303, 304, 400, 401, 402, 403,
-            404, 500, 501, 502, 503
-          ]
-        };
-      } else if (body.id == 2) {
-        return {
-          success: true,
-          data: [
-            100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 404, 500,
-            501, 502, 503
-          ]
-        };
-      }
-    }
-  },
-  // 菜单管理
-  {
-    url: "/menu",
-    method: "post",
-    response: () => {
-      return {
-        success: true,
-        data: [
-          // 外部页面
-          {
-            parentId: 0,
-            id: 100,
-            menuType: 0, // 菜单类型(0代表菜单、1代表iframe、2代表外链、3代表按钮)
-            title: "menus.pureExternalPage",
-            name: "PureIframe",
-            path: "/iframe",
-            component: "",
-            rank: 7,
-            redirect: "",
-            icon: "ri:links-fill",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 100,
-            id: 101,
-            menuType: 0,
-            title: "menus.pureExternalDoc",
-            name: "PureIframeExternal",
-            path: "/iframe/external",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 101,
-            id: 102,
-            menuType: 2,
-            title: "menus.pureExternalLink",
-            name: "https://fuyu-restaurant.com/",
-            path: "/external",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 101,
-            id: 103,
-            menuType: 2,
-            title: "menus.pureUtilsLink",
-            name: "https://fuyu-restaurant.com/utils/",
-            path: "/pureUtilsLink",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 100,
-            id: 104,
-            menuType: 1,
-            title: "menus.pureEmbeddedDoc",
-            name: "PureIframeEmbedded",
-            path: "/iframe/embedded",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 104,
-            id: 105,
-            menuType: 1,
-            title: "menus.pureEpDoc",
-            name: "FrameEp",
-            path: "/iframe/ep",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "https://element-plus.org/zh-CN/",
-            frameLoading: true,
-            keepAlive: true,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 104,
-            id: 106,
-            menuType: 1,
-            title: "menus.pureTailwindcssDoc",
-            name: "FrameTailwindcss",
-            path: "/iframe/tailwindcss",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "https://tailwindcss.com/docs/installation",
-            frameLoading: true,
-            keepAlive: true,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 104,
-            id: 107,
-            menuType: 1,
-            title: "menus.pureVueDoc",
-            name: "FrameVue",
-            path: "/iframe/vue3",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "https://cn.vuejs.org/",
-            frameLoading: true,
-            keepAlive: true,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 104,
-            id: 108,
-            menuType: 1,
-            title: "menus.pureViteDoc",
-            name: "FrameVite",
-            path: "/iframe/vite",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "https://cn.vitejs.dev/",
-            frameLoading: true,
-            keepAlive: true,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 104,
-            id: 109,
-            menuType: 1,
-            title: "menus.purePiniaDoc",
-            name: "FramePinia",
-            path: "/iframe/pinia",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "https://pinia.vuejs.org/zh/index.html",
-            frameLoading: true,
-            keepAlive: true,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 104,
-            id: 110,
-            menuType: 1,
-            title: "menus.pureRouterDoc",
-            name: "FrameRouter",
-            path: "/iframe/vue-router",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "https://router.vuejs.org/zh/",
-            frameLoading: true,
-            keepAlive: true,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          // 权限管理
-          {
-            parentId: 0,
-            id: 200,
-            menuType: 0,
-            title: "menus.purePermission",
-            name: "PurePermission",
-            path: "/permission",
-            component: "",
-            rank: 9,
-            redirect: "",
-            icon: "ep:lollipop",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 200,
-            id: 201,
-            menuType: 0,
-            title: "menus.purePermissionPage",
-            name: "PermissionPage",
-            path: "/permission/page/index",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 200,
-            id: 202,
-            menuType: 0,
-            title: "menus.purePermissionButton",
-            name: "PermissionButton",
-            path: "/permission/button",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 202,
-            id: 203,
-            menuType: 0,
-            title: "menus.purePermissionButtonRouter",
-            name: "PermissionButtonRouter",
-            path: "/permission/button/router",
-            component: "permission/button/index",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 203,
-            id: 210,
-            menuType: 3,
-            title: "添加",
-            name: "",
-            path: "",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "permission:btn:add",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 203,
-            id: 211,
-            menuType: 3,
-            title: "修改",
-            name: "",
-            path: "",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "permission:btn:edit",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 203,
-            id: 212,
-            menuType: 3,
-            title: "删除",
-            name: "",
-            path: "",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "permission:btn:delete",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 202,
-            id: 204,
-            menuType: 0,
-            title: "menus.purePermissionButtonLogin",
-            name: "PermissionButtonLogin",
-            path: "/permission/button/login",
-            component: "permission/button/perms",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 204,
-            id: 220,
-            menuType: 3,
-            title: "添加",
-            name: "",
-            path: "",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "permission:btn:add",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 204,
-            id: 221,
-            menuType: 3,
-            title: "修改",
-            name: "",
-            path: "",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "permission:btn:edit",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 204,
-            id: 222,
-            menuType: 3,
-            title: "删除",
-            name: "",
-            path: "",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "permission:btn:delete",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          // 系统管理
-          {
-            parentId: 0,
-            id: 300,
-            menuType: 0,
-            title: "menus.pureSysManagement",
-            name: "PureSystem",
-            path: "/system",
-            component: "",
-            rank: 10,
-            redirect: "",
-            icon: "ri:settings-3-line",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 300,
-            id: 301,
-            menuType: 0,
-            title: "menus.pureUser",
-            name: "SystemUser",
-            path: "/system/user/index",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "ri:admin-line",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 300,
-            id: 302,
-            menuType: 0,
-            title: "menus.pureRole",
-            name: "SystemRole",
-            path: "/system/role/index",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "ri:admin-fill",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 300,
-            id: 303,
-            menuType: 0,
-            title: "menus.pureSystemMenu",
-            name: "SystemMenu",
-            path: "/system/menu/index",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "ep:menu",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 300,
-            id: 304,
-            menuType: 0,
-            title: "menus.pureDept",
-            name: "SystemDept",
-            path: "/system/dept/index",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "ri:git-branch-line",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          // 系统监控
-          {
-            parentId: 0,
-            id: 400,
-            menuType: 0,
-            title: "menus.pureSysMonitor",
-            name: "PureMonitor",
-            path: "/monitor",
-            component: "",
-            rank: 11,
-            redirect: "",
-            icon: "ep:monitor",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 400,
-            id: 401,
-            menuType: 0,
-            title: "menus.pureOnlineUser",
-            name: "OnlineUser",
-            path: "/monitor/online-user",
-            component: "monitor/online/index",
-            rank: null,
-            redirect: "",
-            icon: "ri:user-voice-line",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 400,
-            id: 402,
-            menuType: 0,
-            title: "menus.pureLoginLog",
-            name: "LoginLog",
-            path: "/monitor/login-logs",
-            component: "monitor/logs/login/index",
-            rank: null,
-            redirect: "",
-            icon: "ri:window-line",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 400,
-            id: 403,
-            menuType: 0,
-            title: "menus.pureOperationLog",
-            name: "OperationLog",
-            path: "/monitor/operation-logs",
-            component: "monitor/logs/operation/index",
-            rank: null,
-            redirect: "",
-            icon: "ri:history-fill",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 400,
-            id: 404,
-            menuType: 0,
-            title: "menus.pureSystemLog",
-            name: "SystemLog",
-            path: "/monitor/system-logs",
-            component: "monitor/logs/system/index",
-            rank: null,
-            redirect: "",
-            icon: "ri:file-search-line",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          // 标签页操作
-          {
-            parentId: 0,
-            id: 500,
-            menuType: 0,
-            title: "menus.pureTabs",
-            name: "PureTabs",
-            path: "/tabs",
-            component: "",
-            rank: 12,
-            redirect: "",
-            icon: "ri:bookmark-2-line",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 500,
-            id: 501,
-            menuType: 0,
-            title: "menus.pureTabs",
-            name: "Tabs",
-            path: "/tabs/index",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: true,
-            showParent: false
-          },
-          {
-            parentId: 500,
-            id: 502,
-            menuType: 0,
-            title: "query传参模式",
-            name: "TabQueryDetail",
-            path: "/tabs/query-detail",
-            component: "",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "/tabs/index",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: false,
-            showParent: false
-          },
-          {
-            parentId: 500,
-            id: 503,
-            menuType: 0,
-            title: "params传参模式",
-            name: "TabParamsDetail",
-            path: "/tabs/params-detail/:id",
-            component: "params-detail",
-            rank: null,
-            redirect: "",
-            icon: "",
-            extraIcon: "",
-            enterTransition: "",
-            leaveTransition: "",
-            activePath: "/tabs/index",
-            auths: "",
-            frameSrc: "",
-            frameLoading: true,
-            keepAlive: false,
-            hiddenTag: false,
-            fixedTag: false,
-            showLink: false,
-            showParent: false
-          }
-        ]
-      };
-    }
-  },
-  // 部门管理
-  {
-    url: "/dept",
-    method: "post",
-    response: () => {
-      return {
-        success: true,
-        data: [
-          {
-            name: "杭州总公司",
-            parentId: 0,
-            id: 100,
-            sort: 0,
-            phone: "15888888888",
-            principal: faker.person.firstName(),
-            email: faker.internet.email(),
-            status: 1, // 状态 1 启用 0 停用
-            type: 1, // 1 公司 2 分公司 3 部门
-            createTime: 1605456000000,
-            remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
-          },
-          {
-            name: "郑州分公司",
-            parentId: 100,
-            id: 101,
-            sort: 1,
-            phone: "15888888888",
-            principal: faker.person.firstName(),
-            email: faker.internet.email(),
-            status: 1,
-            type: 2,
-            createTime: 1605456000000,
-            remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
-          },
-          {
-            name: "研发部门",
-            parentId: 101,
-            id: 103,
-            sort: 1,
-            phone: "15888888888",
-            principal: faker.person.firstName(),
-            email: faker.internet.email(),
-            status: 1,
-            type: 3,
-            createTime: 1605456000000,
-            remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
-          },
-          {
-            name: "市场部门",
-            parentId: 102,
-            id: 108,
-            sort: 1,
-            phone: "15888888888",
-            principal: faker.person.firstName(),
-            email: faker.internet.email(),
-            status: 1,
-            type: 3,
-            createTime: 1605456000000,
-            remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
-          },
-          {
-            name: "深圳分公司",
-            parentId: 100,
-            id: 102,
-            sort: 2,
-            phone: "15888888888",
-            principal: faker.person.firstName(),
-            email: faker.internet.email(),
-            status: 1,
-            type: 2,
-            createTime: 1605456000000,
-            remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
-          },
-          {
-            name: "市场部门",
-            parentId: 101,
-            id: 104,
-            sort: 2,
-            phone: "15888888888",
-            principal: faker.person.firstName(),
-            email: faker.internet.email(),
-            status: 1,
-            type: 3,
-            createTime: 1605456000000,
-            remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
-          },
-          {
-            name: "财务部门",
-            parentId: 102,
-            id: 109,
-            sort: 2,
-            phone: "15888888888",
-            principal: faker.person.firstName(),
-            email: faker.internet.email(),
-            status: 1,
-            type: 3,
-            createTime: 1605456000000,
-            remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
-          },
-          {
-            name: "测试部门",
-            parentId: 101,
-            id: 105,
-            sort: 3,
-            phone: "15888888888",
-            principal: faker.person.firstName(),
-            email: faker.internet.email(),
-            status: 0,
-            type: 3,
-            createTime: 1605456000000,
-            remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
-          },
-          {
-            name: "财务部门",
-            parentId: 101,
-            id: 106,
-            sort: 4,
-            phone: "15888888888",
-            principal: faker.person.firstName(),
-            email: faker.internet.email(),
-            status: 1,
-            type: 3,
-            createTime: 1605456000000,
-            remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
-          },
-          {
-            name: "运维部门",
-            parentId: 101,
-            id: 107,
-            sort: 5,
-            phone: "15888888888",
-            principal: faker.person.firstName(),
-            email: faker.internet.email(),
-            status: 0,
-            type: 3,
-            createTime: 1605456000000,
-            remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息"
-          }
-        ]
-      };
-    }
-  },
-  // 在线用户
-  {
-    url: "/online-logs",
-    method: "post",
-    response: ({ body }) => {
-      let list = [
-        {
-          id: 1,
-          username: "admin",
-          ip: faker.internet.ipv4(),
-          address: "中国河南省信阳市",
-          system: "macOS",
-          browser: "Chrome",
-          loginTime: new Date()
-        },
-        {
-          id: 2,
-          username: "common",
-          ip: faker.internet.ipv4(),
-          address: "中国广东省深圳市",
-          system: "Windows",
-          browser: "Firefox",
-          loginTime: new Date()
-        }
-      ];
-      list = list.filter(item => item.username.includes(body?.username));
-      return {
-        success: true,
-        data: {
-          list,
-          total: list.length, // 总条目数
-          pageSize: 10, // 每页显示条目个数
-          currentPage: 1 // 当前页数
-        }
-      };
-    }
-  },
-  // 登录日志
-  {
-    url: "/login-logs",
-    method: "post",
-    response: ({ body }) => {
-      let list = [
-        {
-          id: 1,
-          username: "admin",
-          ip: faker.internet.ipv4(),
-          address: "中国河南省信阳市",
-          system: "macOS",
-          browser: "Chrome",
-          status: 1, // 登录状态 1 成功 0 失败
-          behavior: "账号登录",
-          loginTime: new Date()
-        },
-        {
-          id: 2,
-          username: "common",
-          ip: faker.internet.ipv4(),
-          address: "中国广东省深圳市",
-          system: "Windows",
-          browser: "Firefox",
-          status: 0,
-          behavior: "第三方登录",
-          loginTime: new Date()
-        }
-      ];
-      list = list.filter(item => item.username.includes(body?.username));
-      list = list.filter(item =>
-        String(item.status).includes(String(body?.status))
-      );
-      return {
-        success: true,
-        data: {
-          list,
-          total: list.length, // 总条目数
-          pageSize: 10, // 每页显示条目个数
-          currentPage: 1 // 当前页数
-        }
-      };
-    }
-  },
-  // 操作日志
-  {
-    url: "/operation-logs",
-    method: "post",
-    response: ({ body }) => {
-      let list = [
-        {
-          id: 1,
-          username: "admin",
-          ip: faker.internet.ipv4(),
-          address: "中国河南省信阳市",
-          system: "macOS",
-          browser: "Chrome",
-          status: 1, // 操作状态 1 成功 0 失败
-          summary: "菜单管理-添加菜单", // 操作概要
-          module: "系统管理", // 所属模块
-          operatingTime: new Date() // 操作时间
-        },
-        {
-          id: 2,
-          username: "common",
-          ip: faker.internet.ipv4(),
-          address: "中国广东省深圳市",
-          system: "Windows",
-          browser: "Firefox",
-          status: 0,
-          summary: "列表分页查询",
-          module: "在线用户",
-          operatingTime: new Date()
-        }
-      ];
-      list = list.filter(item => item.module.includes(body?.module));
-      list = list.filter(item =>
-        String(item.status).includes(String(body?.status))
-      );
-      return {
-        success: true,
-        data: {
-          list,
-          total: list.length, // 总条目数
-          pageSize: 10, // 每页显示条目个数
-          currentPage: 1 // 当前页数
-        }
-      };
-    }
-  },
-  // 系统日志
-  {
-    url: "/system-logs",
-    method: "post",
-    response: ({ body }) => {
-      let list = [
-        {
-          id: 1, // 日志ID
-          /**
-           * 日志级别
-           * 0 debug调试(最低级别的日志,用于调试和开发阶段)
-           * 1 info信息(默认级别,用于记录一般的信息)
-           * 2 warn警告(表示可能出现的问题或潜在的错误,但不会影响系统的正常运行)
-           * 3 error错误(表示发生了错误,但不会导致系统崩溃)
-           * 4 fatal致命(最高级别的日志,表示发生了严重错误,导致系统无法继续运行)
-           */
-          level: 1,
-          module: "菜单管理", // 所属模块
-          url: "/menu", // 请求接口
-          method: "post", // 请求方法
-          ip: faker.internet.ipv4(),
-          address: "中国河南省信阳市",
-          system: "macOS",
-          browser: "Chrome",
-          /**
-           * 请求耗时(单位:ms 毫秒)
-           * 正常耗时:一般认为在几百毫秒(0.1-0.5秒)范围内的请求耗时较为正常
-           * 较慢耗时:在1秒以上的耗时可以被认为是较慢的请求,但具体是否较慢还需要根据具体业务场景和性能要求来判断
-           */
-          takesTime: 10,
-          requestTime: new Date() // 请求时间
-        },
-        {
-          id: 2,
-          level: 0,
-          module: "地图",
-          url: "/get-map-info",
-          method: "get",
-          ip: faker.internet.ipv4(),
-          address: "中国广东省深圳市",
-          system: "Windows",
-          browser: "Firefox",
-          takesTime: 1200,
-          requestTime: new Date()
-        }
-      ];
-      list = list.filter(item => item.module.includes(body?.module));
-      return {
-        success: true,
-        data: {
-          list,
-          total: list.length, // 总条目数
-          pageSize: 10, // 每页显示条目个数
-          currentPage: 1 // 当前页数
-        }
-      };
-    }
-  },
-  // 系统日志-根据 id 查日志详情
-  {
-    url: "/system-logs-detail",
-    method: "post",
-    response: ({ body }) => {
-      if (body.id == 1) {
-        return {
-          id: 1,
-          level: 1,
-          module: "菜单管理",
-          url: "/menu",
-          method: "post",
-          ip: faker.internet.ipv4(),
-          address: "中国河南省信阳市",
-          system: "macOS",
-          browser: "Chrome",
-          takesTime: 10,
-          responseHeaders: {
-            traceId: "1495502411171032",
-            "Content-Type": "application/json",
-            Connection: "keep-alive",
-            "Keep-Alive": "timeout=5",
-            "Content-Length": 17019
-          },
-          responseBody: {
-            success: true,
-            data: [
-              {
-                parentId: 0,
-                id: 400,
-                menuType: 0,
-                title: "menus.pureSysMonitor",
-                name: "PureMonitor",
-                path: "/monitor",
-                component: "",
-                rank: 11,
-                redirect: "",
-                icon: "ep:monitor",
-                extraIcon: "",
-                enterTransition: "",
-                leaveTransition: "",
-                activePath: "",
-                auths: "",
-                frameSrc: "",
-                frameLoading: true,
-                keepAlive: false,
-                hiddenTag: false,
-                fixedTag: false,
-                showLink: true,
-                showParent: false
-              },
-              {
-                parentId: 400,
-                id: 401,
-                menuType: 0,
-                title: "menus.pureOnlineUser",
-                name: "OnlineUser",
-                path: "/monitor/online-user",
-                component: "monitor/online/index",
-                rank: null,
-                redirect: "",
-                icon: "ri:user-voice-line",
-                extraIcon: "",
-                enterTransition: "",
-                leaveTransition: "",
-                activePath: "",
-                auths: "",
-                frameSrc: "",
-                frameLoading: true,
-                keepAlive: false,
-                hiddenTag: false,
-                fixedTag: false,
-                showLink: true,
-                showParent: false
-              },
-              {
-                parentId: 400,
-                id: 402,
-                menuType: 0,
-                title: "menus.pureLoginLog",
-                name: "LoginLog",
-                path: "/monitor/login-logs",
-                component: "monitor/logs/login/index",
-                rank: null,
-                redirect: "",
-                icon: "ri:window-line",
-                extraIcon: "",
-                enterTransition: "",
-                leaveTransition: "",
-                activePath: "",
-                auths: "",
-                frameSrc: "",
-                frameLoading: true,
-                keepAlive: false,
-                hiddenTag: false,
-                fixedTag: false,
-                showLink: true,
-                showParent: false
-              },
-              {
-                parentId: 400,
-                id: 403,
-                menuType: 0,
-                title: "menus.pureOperationLog",
-                name: "OperationLog",
-                path: "/monitor/operation-logs",
-                component: "monitor/logs/operation/index",
-                rank: null,
-                redirect: "",
-                icon: "ri:history-fill",
-                extraIcon: "",
-                enterTransition: "",
-                leaveTransition: "",
-                activePath: "",
-                auths: "",
-                frameSrc: "",
-                frameLoading: true,
-                keepAlive: false,
-                hiddenTag: false,
-                fixedTag: false,
-                showLink: true,
-                showParent: false
-              },
-              {
-                parentId: 400,
-                id: 404,
-                menuType: 0,
-                title: "menus.pureSystemLog",
-                name: "SystemLog",
-                path: "/monitor/system-logs",
-                component: "monitor/logs/system/index",
-                rank: null,
-                redirect: "",
-                icon: "ri:file-search-line",
-                extraIcon: "",
-                enterTransition: "",
-                leaveTransition: "",
-                activePath: "",
-                auths: "",
-                frameSrc: "",
-                frameLoading: true,
-                keepAlive: false,
-                hiddenTag: false,
-                fixedTag: false,
-                showLink: true,
-                showParent: false
-              }
-            ]
-          },
-          requestHeaders: {
-            Accept: "application/json, text/plain, */*",
-            "Accept-Encoding": "gzip, deflate",
-            "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,eo;q=0.7",
-            Authorization: "Bearer eyJhbGciOiJIUzUxMiJ9.admin",
-            Connection: "keep-alive",
-            "Content-Length": 0,
-            Cookie:
-              "_ga=GA1.1.231800979.1704562367; _ga_M74ZHEQ1M1=GS1.1.1709299375.7.1.1709299476.0.0.0; Hm_lvt_6a7dac00248d3b6ad8479d7249bb29c5=1709032753,1709359575; Hm_lvt_23a157b7d0d9867f7a51e42628f052f5=1708960489,1709485849,1709879672; authorized-token={%22accessToken%22:%22eyJhbGciOiJIUzUxMiJ9.admin%22%2C%22expires%22:1919520000000}; multiple-tabs=true",
-            Host: "192.168.2.121:8848",
-            Origin: "http://192.168.2.121:8848",
-            Referer: "http://192.168.2.121:8848/",
-            "User-Agent":
-              "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",
-            "X-Requested-With": "XMLHttpRequest"
-          },
-          requestBody: {
-            title: "系统监控"
-          },
-          traceId: "1495502411171032",
-          requestTime: new Date()
-        };
-      } else if (body.id == 2) {
-        return {
-          id: 2,
-          level: 0,
-          module: "地图",
-          url: "/get-map-info?plateNumber=豫A59778U",
-          method: "get",
-          ip: faker.internet.ipv4(),
-          address: "中国广东省深圳市",
-          system: "Windows",
-          browser: "Firefox",
-          takesTime: 1200,
-          responseHeaders: {
-            traceId: "2280443117103208",
-            "Content-Type": "application/json",
-            Connection: "keep-alive",
-            "Keep-Alive": "timeout=5",
-            "Content-Length": 28693
-          },
-          responseBody: {
-            plateNumber: "豫A59778U",
-            driver: "子骞",
-            orientation: 289,
-            lng: 113.8564,
-            lat: 34.373
-          },
-          requestHeaders: {
-            Accept: "application/json, text/plain, */*",
-            "Accept-Encoding": "gzip, deflate",
-            "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,eo;q=0.7",
-            Authorization: "Bearer eyJhbGciOiJIUzUxMiJ9.admin",
-            Connection: "keep-alive",
-            "Content-Length": 0,
-            Cookie:
-              "_ga=GA1.1.231800979.1704562367; _ga_M74ZHEQ1M1=GS1.1.1709299375.7.1.1709299476.0.0.0; Hm_lvt_6a7dac00248d3b6ad8479d7249bb29c5=1709032753,1709359575; Hm_lvt_23a157b7d0d9867f7a51e42628f052f5=1708960489,1709485849,1709879672; authorized-token={%22accessToken%22:%22eyJhbGciOiJIUzUxMiJ9.admin%22%2C%22expires%22:1919520000000}; multiple-tabs=true",
-            Host: "192.168.2.121:8848",
-            Origin: "http://192.168.2.121:8848",
-            Referer: "http://192.168.2.121:8848/",
-            "User-Agent":
-              "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36",
-            "X-Requested-With": "XMLHttpRequest"
-          },
-          requestBody: null,
-          traceId: "2280443117103208",
-          requestTime: new Date()
-        };
-      }
-    }
-  }
-]);

+ 2 - 2
haha-admin-web/package.json

@@ -116,7 +116,7 @@
     "@commitlint/config-conventional": "^20.5.0",
     "@commitlint/types": "^20.5.0",
     "@eslint/js": "^10.0.1",
-    "@faker-js/faker": "^10.4.0",
+
     "@iconify/json": "^2.2.467",
     "@iconify/vue": "4.2.0",
     "@intlify/unplugin-vue-i18n": "^11.1.2",
@@ -166,7 +166,7 @@
     "vite": "^8.0.10",
     "vite-plugin-cdn-import": "^1.0.1",
     "vite-plugin-compression": "^0.5.1",
-    "vite-plugin-fake-server": "^2.2.3",
+
     "vite-plugin-remove-console": "^2.2.0",
     "vite-plugin-router-warn": "^2.0.0",
     "vite-svg-loader": "^5.1.1",

+ 16 - 6
haha-admin-web/src/views/marketing/activity/utils/hook.tsx

@@ -11,6 +11,7 @@ import {
   pauseActivity,
   resumeActivity
 } from "@/api/activity";
+import { getAvailableCoupons } from "@/api/coupon";
 import type { PaginationProps } from "@pureadmin/table";
 import { deviceDetection } from "@pureadmin/utils";
 import { onMounted, reactive, ref, toRaw } from "vue";
@@ -56,12 +57,20 @@ export function useActivity() {
   const pagination = reactive<PaginationProps>(initPagination());
 
   // ===== 优惠券模板列表(用于邀请活动选择器)=====
-  // TODO: 后续替换为 getCouponTemplateList() API 调用
-  const couponTemplateList = ref([
-    { id: 1, name: "满100减20元券", discountValue: 20 },
-    { id: 2, name: "满200减50元券", discountValue: 50 },
-    { id: 3, name: "新人专享10元券", discountValue: 10 }
-  ]);
+  const couponTemplateList = ref<{ id: number; name: string; discountValue: number }[]>([]);
+
+  async function fetchCouponTemplates() {
+    try {
+      const { data } = await getAvailableCoupons();
+      couponTemplateList.value = (data || []).map((t: any) => ({
+        id: t.id,
+        name: t.couponName,
+        discountValue: t.discountValue
+      }));
+    } catch {
+      couponTemplateList.value = [];
+    }
+  }
 
   type TagType = "success" | "primary" | "warning" | "info" | "danger";
 
@@ -992,6 +1001,7 @@ export function useActivity() {
 
   onMounted(() => {
     onSearch();
+    fetchCouponTemplates();
   });
 
   return {

+ 2 - 8
haha-admin-web/src/views/marketing/components/DeviceSelector.vue

@@ -42,14 +42,8 @@ async function fetchDevices() {
     filteredDevices.value = devices.value;
   } catch (error) {
     console.error("获取设备列表失败:", error);
-    // 模拟数据用于演示
-    devices.value = [
-      { id: 1, deviceId: "DEV001", storeName: "北京旗舰店-A01", status: 1 },
-      { id: 2, deviceId: "DEV002", storeName: "北京旗舰店-A02", status: 1 },
-      { id: 3, deviceId: "DEV003", storeName: "上海体验店-B01", status: 1 },
-      { id: 4, deviceId: "DEV004", storeName: "广州分店-C01", status: 1 }
-    ];
-    filteredDevices.value = devices.value;
+    devices.value = [];
+    filteredDevices.value = [];
   } finally {
     loading.value = false;
   }

+ 2 - 9
haha-admin-web/src/views/marketing/components/ProductSelector.vue

@@ -43,15 +43,8 @@ async function fetchProducts() {
     filteredProducts.value = products.value;
   } catch (error) {
     console.error("获取商品列表失败:", error);
-    // 模拟数据用于演示
-    products.value = [
-      { id: 1, name: "经典可乐", price: 3.5, categoryName: "饮料" },
-      { id: 2, name: "雪碧", price: 3.5, categoryName: "饮料" },
-      { id: 3, name: "芬达橙味", price: 3.5, categoryName: "饮料" },
-      { id: 4, name: "矿泉水", price: 2.0, categoryName: "饮品" },
-      { id: 5, name: "红牛功能饮料", price: 6.0, categoryName: "功能饮料" }
-    ];
-    filteredProducts.value = products.value;
+    products.value = [];
+    filteredProducts.value = [];
   } finally {
     loading.value = false;
   }

+ 2 - 8
haha-admin-web/src/views/marketing/components/ShopSelector.vue

@@ -42,14 +42,8 @@ async function fetchShops() {
     filteredShops.value = shops.value;
   } catch (error) {
     console.error("获取门店列表失败:", error);
-    // 模拟数据用于演示
-    shops.value = [
-      { id: 1, name: "北京旗舰店", address: "北京市朝阳区xxx路xxx号" },
-      { id: 2, name: "上海体验店", address: "上海市浦东新区xxx路xxx号" },
-      { id: 3, name: "广州分店", address: "广州市天河区xxx路xxx号" },
-      { id: 4, name: "深圳直营店", address: "深圳市南山区xxx路xxx号" }
-    ];
-    filteredShops.value = shops.value;
+    shops.value = [];
+    filteredShops.value = [];
   } finally {
     loading.value = false;
   }

+ 18 - 7
haha-admin-web/src/views/marketing/invite/utils/hook.tsx

@@ -12,6 +12,7 @@ import {
   pauseInviteActivity,
   resumeInviteActivity
 } from "@/api/invite";
+import { getAvailableCoupons } from "@/api/coupon";
 import type { PaginationProps } from "@pureadmin/table";
 import { deviceDetection } from "@pureadmin/utils";
 import { onMounted, reactive, ref, toRaw } from "vue";
@@ -52,13 +53,22 @@ export function useInviteActivity() {
   const dataList = ref([]);
   const pagination = reactive<PaginationProps>(initPagination());
 
-  // 优惠券模板列表(模拟数据,实际应从API获取)
-  const couponTemplateList = ref([
-    { id: 1, name: "满100减20元券", value: 20, minAmount: 100 },
-    { id: 2, name: "满200减50元券", value: 50, minAmount: 200 },
-    { id: 3, name: "新人专享10元券", value: 10, minAmount: 0 },
-    { id: 4, name: "首充赠送30元券", value: 30, minAmount: 50 }
-  ]);
+  // 优惠券模板列表(从后端API获取)
+  const couponTemplateList = ref<{ id: number; name: string; value: number; minAmount: number }[]>([]);
+
+  async function fetchCouponTemplates() {
+    try {
+      const { data } = await getAvailableCoupons();
+      couponTemplateList.value = (data || []).map((t: any) => ({
+        id: t.id,
+        name: t.couponName,
+        value: t.discountValue,
+        minAmount: t.minAmount || 0
+      }));
+    } catch {
+      couponTemplateList.value = [];
+    }
+  }
 
   type TagType = "success" | "primary" | "warning" | "info" | "danger";
 
@@ -549,6 +559,7 @@ export function useInviteActivity() {
 
   onMounted(() => {
     onSearch();
+    fetchCouponTemplates();
   });
 
   return {