Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [BUG] 重复的 mock 数据 #11067

Closed
luketzh opened this issue Nov 29, 2023 · 1 comment
Closed

🐛 [BUG] 重复的 mock 数据 #11067

luketzh opened this issue Nov 29, 2023 · 1 comment

Comments

@luketzh
Copy link
Contributor

luketzh commented Nov 29, 2023

🐛 bug 描述

mock/ 文件夹下 requestRecord.mock.jsuser.ts 具有重复的数据。在运行时,会导致警告:

warn  - GET /api/rule is duplicated in mock/requestRecord.mock.js and mock/listTableList.ts
warn  - GET /api/currentUser is duplicated in mock/user.ts and mock/requestRecord.mock.js
warn  - POST /api/login/account is duplicated in mock/user.ts and mock/requestRecord.mock.js
warn  - POST /api/login/outLogin is duplicated in mock/user.ts and mock/requestRecord.mock.js

📷 复现步骤 | Recurrence steps

运行

npm start

🏞 期望结果 | Expected results

消除警告。

💻 复现代码 | Recurrence code

npm start

© 版本信息

  • Ant Design Pro 版本: 6.0.0
  • umi 版本: umi 4
  • 浏览器环境
  • 开发环境: ubuntu

🚑 其他信息

过去已有 pull request 尝试修复此问题: #10919

@chenshuai2144
Copy link
Collaborator

根据你提供的信息,警告信息显示 mock/ 文件夹下的 requestRecord.mock.jsuser.ts 存在重复的数据,导致警告出现。

要消除警告,你需要在这两个文件中删除重复的数据。可以打开这两个文件,找到重复的 mock 请求并删除一个即可。

例如,在 requestRecord.mock.js 文件中,找到以下重复的请求:

warn  - GET /api/rule is duplicated in mock/requestRecord.mock.js and mock/listTableList.ts

然后在这两个文件中删除一个重复的请求即可。

操作完成后,重新运行 npm start,警告应该会消失。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants