feat: Add dynamic route

This commit is contained in:
kailong321200875
2022-02-19 20:34:44 +08:00
parent d5b6e2a777
commit 9d926b2760
15 changed files with 851 additions and 66 deletions

View File

@@ -26,6 +26,30 @@ const List: {
]
export default [
// 列表接口
{
url: '/user/list',
method: 'get',
response: ({ query }) => {
const { username, pageIndex, pageSize } = query
const mockList = List.filter((item) => {
if (username && item.username.indexOf(username) < 0) return false
return true
})
const pageList = mockList.filter(
(_, index) => index < pageSize * pageIndex && index >= pageSize * (pageIndex - 1)
)
return {
code: result_code,
data: {
total: mockList.length,
list: pageList
}
}
}
},
// 登录接口
{
url: '/user/login',