fix: 修复请求缺少/api不走fake的问题

This commit is contained in:
xiaojunnuo@126.com 2020-09-01 17:17:40 +08:00
parent d505583b35
commit 02d6db3beb
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ const apiList = req(require.context('../', true, /mock\.js$/))
apiList.forEach(apiFile => { apiList.forEach(apiFile => {
for (const item of apiFile) { for (const item of apiFile) {
mock mock
.onAny(new RegExp('^' + item.path)) .onAny(new RegExp('^/api' + item.path))
.reply(config => { .reply(config => {
console.log('------------fake request start -------------') console.log('------------fake request start -------------')
console.log('request:', config) console.log('request:', config)