feat: 完善平台总后台模块
This commit is contained in:
27
frontend/platform_admin/src/mocks/setup.ts
Normal file
27
frontend/platform_admin/src/mocks/setup.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import debug from '@/utils/env';
|
||||
|
||||
export default ({ mock, setup }: { mock?: boolean; setup: () => void }) => {
|
||||
if (mock !== false && debug) setup();
|
||||
};
|
||||
|
||||
export const successResponseWrap = (data: unknown) => {
|
||||
return {
|
||||
data,
|
||||
status: 'ok',
|
||||
msg: '请求成功',
|
||||
code: 20000,
|
||||
};
|
||||
};
|
||||
|
||||
export const failResponseWrap = (
|
||||
data: unknown,
|
||||
msg: string,
|
||||
code = 50000,
|
||||
) => {
|
||||
return {
|
||||
data,
|
||||
status: 'fail',
|
||||
msg,
|
||||
code,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user