This commit is contained in:
花裤衩
2020-01-08 17:19:31 +08:00
parent 088f64eecc
commit 3f38cde71d
2 changed files with 3 additions and 13 deletions

View File

@@ -57,9 +57,10 @@ export function mockXHR() {
// for mock server
const responseFake = (url, type, respond) => {
return {
url: new RegExp(`/mock${url}`),
url: new RegExp(`${process.env.VUE_APP_BASE_API}${url}`),
type: type || 'get',
response(req, res) {
console.log('request invoke:' + req.path)
res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond))
}
}