CN-679 feat: 集成mockjs

This commit is contained in:
chenjinsong
2022-09-05 19:25:10 +08:00
parent 716713c231
commit 1f1367f9d7
4 changed files with 36 additions and 0 deletions

33
src/mock/npm.js Normal file
View File

@@ -0,0 +1,33 @@
import Mock from 'mockjs'
const openMock = false
if (openMock) {
Mock.mock(RegExp(BASE_CONFIG.baseUrl + 'visual/panel*'), 'get', function (requestObj) {
return {
"msg": "success",
"code": 200,
"data": {
"total": 1,
"pageSize": 10,
"pages": 1,
"pageNo": 1,
"list": [
{
"id": 2,
"name": "Network & App",
"i18n": "npm.npm",
"type": 2,
"params": "",
"cby": 1,
"ctime": "2021-06-03 08:27:32",
"uby": 1,
"utime": "2021-06-03 08:28:10",
"remark": "",
"state": 1,
"buildIn": 1
}
]
}
}
})
}