huiyi-h5/mock/modules/prose.mock.ts

17 lines
380 B
TypeScript
Raw Permalink Normal View History

2024-02-10 08:25:41 +00:00
// https://github.com/pengzhanbo/vite-plugin-mock-dev-server
import { defineMock } from 'vite-plugin-mock-dev-server'
import proses from '../data'
export default defineMock({
url: '/api/project/prose',
delay: 100,
body: () => {
const prose = proses.value[Math.floor(Math.random() * 8)]
return {
code: 0,
data: prose,
msg: 'success',
}
},
})