mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2026-06-04 00:28:24 +08:00
fix: mock.js request method match
This commit is contained in:
parent
6ae0b0a75c
commit
4154a42f72
@ -137,7 +137,7 @@ export default (api) => {
|
|||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
// 请求以 cgiMock.prefix 开头,匹配处理
|
// 请求以 cgiMock.prefix 开头,匹配处理
|
||||||
const matchRequet = requestList.find((item) => req.path.search(item.url) !== -1 && req.method === (item.method || 'GET').toUpperCase());
|
const matchRequet = requestList.find((item) => req.path.search(item.url) !== -1 && (item.method ? req.method === item.method.toUpperCase() : true));
|
||||||
if (!matchRequet) {
|
if (!matchRequet) {
|
||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user