提交 | 用户 | 时间
|
fd2207
|
1 |
import request from '@/utils/request' |
懒 |
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 |
repeatSubmit: false |
|
16 |
}, |
|
17 |
method: 'post', |
|
18 |
data: data |
|
19 |
}) |
|
20 |
} |
|
21 |
|
|
22 |
// 注册方法 |
|
23 |
export function register(data) { |
|
24 |
return request({ |
|
25 |
url: '/register', |
|
26 |
headers: { |
|
27 |
isToken: false |
|
28 |
}, |
|
29 |
method: 'post', |
|
30 |
data: data |
|
31 |
}) |
|
32 |
} |
|
33 |
|
|
34 |
// 获取用户详细信息 |
|
35 |
export function getInfo() { |
|
36 |
return request({ |
|
37 |
url: '/getInfo', |
|
38 |
method: 'get' |
|
39 |
}) |
|
40 |
} |
|
41 |
|
|
42 |
// 退出方法 |
|
43 |
export function logout() { |
|
44 |
return request({ |
|
45 |
url: '/logout', |
|
46 |
method: 'post' |
|
47 |
}) |
|
48 |
} |
|
49 |
|
|
50 |
// 获取验证码 |
|
51 |
export function getCodeImg() { |
|
52 |
return request({ |
|
53 |
url: '/captchaImage', |
|
54 |
headers: { |
|
55 |
isToken: false |
|
56 |
}, |
|
57 |
method: 'get', |
|
58 |
timeout: 20000 |
|
59 |
}) |
|
60 |
} |