1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
| import debug from './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,
| };
| };
|
|