Skip to content

🧐[问题 | question] 如何修改调试Mock #11446

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

Open
KaiZheng2020 opened this issue Mar 18, 2025 · 2 comments
Open

🧐[问题 | question] 如何修改调试Mock #11446

KaiZheng2020 opened this issue Mar 18, 2025 · 2 comments

Comments

@KaiZheng2020
Copy link

Mock 修改不起作用呢,另外console.log也无法打印信息。请教一下如何修改Mock数据,还有如何调试,万分感谢。

@986823307
Copy link

最新版本5.2.0
经查看umijs文档后,将package.json中命令行“start:dev”的MOCK=none去掉即可开启mock

@youngjuning
Copy link

youngjuning commented May 13, 2025

app.tsx 文件中的 baseURL 注释掉,或者根据 isDev 判断:

/**
 * @name request 配置,可以配置错误处理
 * 它基于 axios 和 ahooks 的 useRequest 提供了一套统一的网络请求和错误处理方案。
 * @doc https://umijs.org/docs/max/request#配置
 */
export const request: RequestConfig = {
  baseURL: isDev ? '' : 'https://proapi.azurewebsites.net',
  ...errorConfig,
};

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

3 participants