gohttpdUi/mock/dict/index.mock.ts

63 lines
923 B
TypeScript
Raw Normal View History

2023-05-04 14:19:31 +08:00
import config from '@/config/axios/config'
2022-04-26 15:03:48 +08:00
2023-05-04 14:19:31 +08:00
const { code } = config
2022-04-26 15:03:48 +08:00
2023-11-29 15:34:17 +08:00
const delay = 1000
2022-04-26 15:03:48 +08:00
const dictObj: Recordable = {
importance: [
{
value: 0,
label: 'tableDemo.commonly'
},
{
value: 1,
label: 'tableDemo.good'
},
{
value: 2,
label: 'tableDemo.important'
}
]
}
export default [
// 字典接口
{
2023-11-29 15:34:17 +08:00
url: '/mock/dict/list',
method: 'GET',
delay,
body: () => {
2022-04-26 15:03:48 +08:00
return {
code: code,
data: dictObj
2022-04-26 15:03:48 +08:00
}
}
},
// 获取某个字典
{
2023-11-29 15:34:17 +08:00
url: '/mock/dict/one',
method: 'GET',
delay,
body: () => {
2022-04-26 15:03:48 +08:00
return {
code: code,
data: [
{
label: 'test1',
value: 0
},
{
label: 'test2',
value: 1
},
{
label: 'test3',
value: 2
}
]
2022-04-26 15:03:48 +08:00
}
}
}
2023-11-29 15:34:17 +08:00
]