Compare commits

...

2 Commits

Author SHA1 Message Date
cimc-raffles
e6474c35f9
Merge 4154a42f720c15a8be6ab0618519725f3d2c6cc2 into effd1378b44dfdfab47ff46ccf1b7e6e0d4d7e66 2026-01-21 10:58:56 +00:00
username
4154a42f72 fix: mock.js request method match 2026-01-21 18:51:53 +08:00

View File

@ -137,7 +137,7 @@ export default (api) => {
return next();
}
// 请求以 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) {
return next();
}