提交 | 用户 | 时间
|
a57dc2
|
1 |
import request from '@/utils/request' |
W |
2 |
|
|
3 |
// 登录方法 |
|
4 |
export function login(username, password, code, uuid) { |
|
5 |
const data = { |
|
6 |
username, |
|
7 |
password, |
|
8 |
code, |
|
9 |
uuid |
|
10 |
} |
|
11 |
return request({ |
|
12 |
url: '/login', |
|
13 |
headers: { |
|
14 |
isToken: false |
|
15 |
}, |
|
16 |
method: 'post', |
|
17 |
data: data |
|
18 |
}) |
|
19 |
} |
|
20 |
|
|
21 |
// 注册方法 |
|
22 |
export function register(data) { |
|
23 |
return request({ |
|
24 |
url: '/register', |
|
25 |
headers: { |
|
26 |
isToken: false |
|
27 |
}, |
|
28 |
method: 'post', |
|
29 |
data: data |
|
30 |
}) |
|
31 |
} |
|
32 |
|
|
33 |
// 获取用户详细信息 |
|
34 |
export function getInfo() { |
|
35 |
return request({ |
|
36 |
url: '/getInfo', |
|
37 |
method: 'get' |
|
38 |
}) |
|
39 |
} |
|
40 |
|
|
41 |
// 退出方法 |
|
42 |
export function logout() { |
|
43 |
return request({ |
|
44 |
url: '/logout', |
|
45 |
method: 'post' |
|
46 |
}) |
|
47 |
} |
|
48 |
|
|
49 |
// 获取验证码 |
|
50 |
export function getCodeImg() { |
|
51 |
return request({ |
|
52 |
url: '/captchaImage', |
|
53 |
headers: { |
|
54 |
isToken: false |
|
55 |
}, |
|
56 |
method: 'get', |
|
57 |
timeout: 20000 |
|
58 |
}) |
|
59 |
} |
|
60 |
|
|
61 |
// 短信验证码 |
|
62 |
export function getCodeSms() { |
|
63 |
return request({ |
|
64 |
url: '/captchaSms', |
|
65 |
headers: { |
|
66 |
isToken: false |
|
67 |
}, |
|
68 |
method: 'get', |
|
69 |
timeout: 20000 |
|
70 |
}) |
|
71 |
} |