Mirage“直通”不起作用

joh*_*nwj 2 javascript ember.js ember-cli-mirage

我正在尝试在此 Ember项目中对 POST 请求使用直通

this.passthrough('/thirdeye/entity?entityType=ANOMALY_FUNCTION');
Run Code Online (Sandbox Code Playgroud)

这就是调用的样子app/mirage/config.js。我收到以下错误:

Mirage: Your Ember app tried to POST '/thirdeye/entity?entityType=ANOMALY_FUNCTION',
but there was no route defined to handle this request.
Define a route that matches this path in your
mirage/config.js file. Did you forget to add your namespace?
Run Code Online (Sandbox Code Playgroud)

显然,我已将该调用添加到配置文件中,但它没有被拾取。我读到这只passthrough适用于>= jquery 2.x我的项目。

有谁知道还有什么可能导致这种情况?

joh*_*nwj 5

我发现问题是我必须这样做,this.passthrough('/thirdeye/***');因为调用有查询参数。现在可以了。