fix: mock.js request method match

This commit is contained in:
username 2025-09-01 22:00:24 +08:00
parent effd1378b4
commit 6ae0b0a75c

View File

@ -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); const matchRequet = requestList.find((item) => req.path.search(item.url) !== -1 && req.method === (item.method || 'GET').toUpperCase());
if (!matchRequet) { if (!matchRequet) {
return next(); return next();
} }