Skip to content
New issue

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

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

Already on GitHub? # to your account

mock拦截不了method为get的请求 #2462

Closed
ch11ry opened this issue Jul 16, 2019 · 3 comments
Closed

mock拦截不了method为get的请求 #2462

ch11ry opened this issue Jul 16, 2019 · 3 comments
Assignees

Comments

@ch11ry
Copy link

ch11ry commented Jul 16, 2019

问题描述

1.mock -> index.js对get方法进行拦截:
1

2.在chrome的console使用fetch进行请求:
1
2

3.没有得到预期的结果。

@ClarkXia
Copy link
Collaborator

看下proxy的相关配置

@ch11ry
Copy link
Author

ch11ry commented Jul 16, 2019

看下proxy的相关配置

�项目中没有配置proxy

@ch11ry
Copy link
Author

ch11ry commented Jul 17, 2019

在ice.config.js中配置了以下信息,导致了get没有被正常拦截:

devServer: {
    historyApiFallback: {
      rewrites: [{
        from: /.*/,
        to: '/index.html',
      }],
    },
  },

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

No branches or pull requests

3 participants