提交 | 用户 | age
|
7ad4ce
|
1 |
import { MockMethod } from 'vite-plugin-mock'; |
5465f0
|
2 |
import { resultSuccess, resultError } from '../_util'; |
6544f8
|
3 |
import { ResultEnum } from '../../src/enums/httpEnum'; |
7ad4ce
|
4 |
|
C |
5 |
const userInfo = { |
78d4d4
|
6 |
name: 'Vben', |
7ad4ce
|
7 |
userid: '00000001', |
46e087
|
8 |
email: 'test@gmail.com', |
7ad4ce
|
9 |
signature: '海纳百川,有容乃大', |
C |
10 |
introduction: '微笑着,努力着,欣赏着', |
|
11 |
title: '交互专家', |
46e087
|
12 |
group: '某某某事业群-某某平台部-某某技术部-UED', |
7ad4ce
|
13 |
tags: [ |
C |
14 |
{ |
|
15 |
key: '0', |
|
16 |
label: '很有想法的', |
|
17 |
}, |
|
18 |
{ |
|
19 |
key: '1', |
|
20 |
label: '专注设计', |
|
21 |
}, |
|
22 |
{ |
|
23 |
key: '2', |
|
24 |
label: '辣~', |
|
25 |
}, |
|
26 |
{ |
|
27 |
key: '3', |
|
28 |
label: '大长腿', |
|
29 |
}, |
|
30 |
{ |
|
31 |
key: '4', |
|
32 |
label: '川妹子', |
|
33 |
}, |
|
34 |
{ |
|
35 |
key: '5', |
|
36 |
label: '海纳百川', |
|
37 |
}, |
|
38 |
], |
|
39 |
notifyCount: 12, |
|
40 |
unreadCount: 11, |
|
41 |
country: 'China', |
46e087
|
42 |
address: 'Xiamen City 77', |
abb0cf
|
43 |
phone: '0592-268888888', |
7ad4ce
|
44 |
}; |
C |
45 |
|
|
46 |
export default [ |
|
47 |
{ |
ed422b
|
48 |
url: '/basic-api/account/getAccountInfo', |
7ad4ce
|
49 |
timeout: 1000, |
C |
50 |
method: 'get', |
|
51 |
response: () => { |
|
52 |
return resultSuccess(userInfo); |
|
53 |
}, |
|
54 |
}, |
5465f0
|
55 |
{ |
V |
56 |
url: '/basic-api/user/sessionTimeout', |
|
57 |
method: 'post', |
|
58 |
statusCode: 401, |
|
59 |
response: () => { |
|
60 |
return resultError(); |
|
61 |
}, |
|
62 |
}, |
6544f8
|
63 |
{ |
无 |
64 |
url: '/basic-api/user/tokenExpired', |
|
65 |
method: 'post', |
|
66 |
statusCode: 200, |
|
67 |
response: () => { |
|
68 |
return resultError('Token Expired!', { code: ResultEnum.TIMEOUT as number }); |
|
69 |
}, |
|
70 |
}, |
7ad4ce
|
71 |
] as MockMethod[]; |