huiyi-h5/mock/modules/prose.mock.ts
2024-02-10 16:25:41 +08:00

17 lines
380 B
TypeScript

// 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',
}
},
})