Skip to content

Commit

Permalink
fix: 🐛 修复接口切换Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
倪俊杰 committed Nov 11, 2021
1 parent ee3105e commit b4d2ad9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ class KoaMockSwitch {
}

// 模拟数据大管家 - cache
if (!this.$cache.hasOwnProperty(mockFilePath)) {
this.$cache[mockFilePath] = {}
}
this.$cache[mockFilePath].rule = mockValueRule

ctx.body = this.$cache[mockFilePath].rule
Expand Down

0 comments on commit b4d2ad9

Please sign in to comment.