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

Mock当前版本不支持Fetch吗? #205

Closed
qhanw opened this issue Jul 17, 2017 · 2 comments
Closed

Mock当前版本不支持Fetch吗? #205

qhanw opened this issue Jul 17, 2017 · 2 comments

Comments

@qhanw
Copy link

qhanw commented Jul 17, 2017

目前在react项目中使用mock,参照官方示例,并未达到拦截的效果,是因为不支持fetch吗,还是说在react中需要特别的配置,可否给出react的示列,或者明确说明是否支持fetch?

@chinesedfan
Copy link

Duplicate of #163

@zjffun
Copy link

zjffun commented Jun 15, 2019

貌似作者已经不维护了,下面是一个支持拦截 fetch 的版本 zjffun/Mock-support-intercept-fetch

使用的话:

npm install @zjffun/mockjs

fetch 的拦截还是比较好实现的,因为拦截后返回 resolve 为 response 对象(通过 Response - Web APIs | MDN 创建)的 promise 对象就行。

@qhanw qhanw closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2023
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