first commit

This commit is contained in:
muzi
2025-06-16 14:42:26 +08:00
commit 6f06721506
149 changed files with 56883 additions and 0 deletions

31
src/mock/setup-mock.ts Normal file
View File

@ -0,0 +1,31 @@
/*
* @Author: 田鑫
* @Date: 2023-03-05 18:59:18
* @LastEditors: 田鑫
* @LastEditTime: 2023-03-05 19:02:04
* @Description: mock设置
*/
export default ({ mock, setup }: { mock?: boolean; setup: () => void }) => {
if (mock !== false) setup();
};
export const successResponseWrap = (data: unknown) => {
return {
success: true,
msg: '请求成功',
code: 200,
data,
timestamp: new Date().getTime(),
};
};
export const failResponseWrap = (data: unknown, msg: string, code = 50000) => {
return {
data,
success: false,
msg,
code,
timestamp: new Date().getTime(),
};
};