nova-admin/mock/utils.ts
2022-08-13 00:46:42 +08:00

17 lines
290 B
TypeScript

import Mock from 'mockjs';
export function resultSuccess(data: any, { msg = 'success' } = {}) {
return Mock.mock({
code: 200,
data,
msg,
});
}
export function resultFailed(data: any, { msg = 'failed' } = {}) {
return Mock.mock({
code: 400,
data,
msg,
});
}