From 118c2805ad93594c2db2ec2092b07d65f6e36b85 Mon Sep 17 00:00:00 2001 From: Lexcubia Date: Mon, 28 Apr 2025 10:28:17 +0800 Subject: [PATCH] =?UTF-8?q?refactor(src):=20=E9=87=8D=E5=91=BD=E5=90=8D=20?= =?UTF-8?q?mock=20=E6=96=87=E4=BB=B6=E5=A4=B9=E4=B8=BA=20mocks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 src/mock 重命名为 src/mocks - 更新 main.js 中的 mock 引入路径 - 移动 mock 相关的文件到新的文件夹中 --- .cursor/rules/cursorrules.mdc | 4 ++-- src/main.js | 2 +- src/{mock => mocks}/index.js | 0 src/{mock => mocks}/modules/chat.js | 0 src/{mock => mocks}/modules/user.js | 0 5 files changed, 3 insertions(+), 3 deletions(-) rename src/{mock => mocks}/index.js (100%) rename src/{mock => mocks}/modules/chat.js (100%) rename src/{mock => mocks}/modules/user.js (100%) diff --git a/.cursor/rules/cursorrules.mdc b/.cursor/rules/cursorrules.mdc index 2ca86de..8e64a6e 100644 --- a/.cursor/rules/cursorrules.mdc +++ b/.cursor/rules/cursorrules.mdc @@ -4,7 +4,7 @@ globs: alwaysApply: true --- --- -description: +description: globs: alwaysApply: true --- @@ -32,7 +32,7 @@ alwaysApply: true - api/ # API接口封装 - utils/ # 工具函数 - styles/ # 全局样式 - - mock/ # Mock数据 + - mocks/ # Mock数据 - App.vue # 根组件 - main.js # 入口文件 diff --git a/src/main.js b/src/main.js index 3a5aee9..4c4dce6 100644 --- a/src/main.js +++ b/src/main.js @@ -15,7 +15,7 @@ import zhCn from 'element-plus/dist/locale/zh-cn.mjs' // 在开发环境下引入mock // if (import.meta.env.VITE_APP_MOCK === 'true') { - import('@/mock') + import('@/mocks') // } const pinia = createPinia(); diff --git a/src/mock/index.js b/src/mocks/index.js similarity index 100% rename from src/mock/index.js rename to src/mocks/index.js diff --git a/src/mock/modules/chat.js b/src/mocks/modules/chat.js similarity index 100% rename from src/mock/modules/chat.js rename to src/mocks/modules/chat.js diff --git a/src/mock/modules/user.js b/src/mocks/modules/user.js similarity index 100% rename from src/mock/modules/user.js rename to src/mocks/modules/user.js