nova-admin/mock/utils.ts
2023-03-27 18:01:46 +08:00

17 lines
299 B
TypeScript

import Mock from 'mockjs'
export function resultSuccess(data: any, msg?: string) {
return Mock.mock({
code: 200,
data,
msg: msg || 'success',
})
}
export function resultFailed(data: any, msg?: string) {
return Mock.mock({
code: 500,
data,
msg: msg || 'failed',
})
}