commit | author | age
|
9bcb19
|
1 |
/** |
I |
2 |
* 系统应用 |
|
3 |
* |
|
4 |
* @author yubaoshan |
|
5 |
* @date 2020/5/26 19:06 |
|
6 |
*/ |
|
7 |
import { axios } from '@/utils/request' |
|
8 |
|
|
9 |
/** |
|
10 |
* 登录 |
|
11 |
* |
|
12 |
* @author yubaoshan |
|
13 |
* @date 2020/5/26 19:06 |
|
14 |
*/ |
|
15 |
export function login (parameter) { |
|
16 |
// 密码采用sm2加密传输密码 |
|
17 |
const sm2 = require('sm-crypto').sm2 |
|
18 |
const publicKey = '04298364ec840088475eae92a591e01284d1abefcda348b47eb324bb521bb03b0b2a5bc393f6b71dabb8f15c99a0050818b56b23f31743b93df9cf8948f15ddb54' |
|
19 |
const encryptData = sm2.doEncrypt(parameter.password, publicKey, 1) |
|
20 |
parameter.password = encryptData |
|
21 |
|
|
22 |
return axios({ |
|
23 |
url: '/login', |
|
24 |
method: 'post', |
|
25 |
data: parameter |
|
26 |
}) |
|
27 |
} |
|
28 |
|
|
29 |
/** |
|
30 |
* 登出 |
|
31 |
* |
|
32 |
* @author yubaoshan |
|
33 |
* @date 2020/5/26 19:07 |
|
34 |
*/ |
|
35 |
export function logout (parameter) { |
|
36 |
return axios({ |
|
37 |
url: '/logout', |
|
38 |
method: 'get', |
|
39 |
params: parameter |
|
40 |
}) |
|
41 |
} |
|
42 |
|
|
43 |
/** |
|
44 |
* 获取登录用户信息 |
|
45 |
* |
|
46 |
* @author yubaoshan |
|
47 |
* @date 2020/5/26 19:08 |
|
48 |
*/ |
|
49 |
export function getLoginUser (parameter) { |
|
50 |
return axios({ |
|
51 |
url: '/getLoginUser', |
|
52 |
method: 'get', |
|
53 |
params: parameter |
|
54 |
}) |
|
55 |
} |
|
56 |
|
|
57 |
/** |
|
58 |
* 获取租户开关 |
|
59 |
* |
|
60 |
* @author yubaoshan |
|
61 |
* @date 2020/9/5 1:24 |
|
62 |
*/ |
|
63 |
export function getTenantOpen (parameter) { |
|
64 |
return axios({ |
|
65 |
url: '/getTenantOpen', |
|
66 |
method: 'get', |
|
67 |
params: parameter |
|
68 |
}) |
|
69 |
} |
|
70 |
|
|
71 |
/** |
|
72 |
* 获取短信验证码 |
|
73 |
* |
|
74 |
* @author yubaoshan |
|
75 |
* @date 2020/5/26 19:29 |
|
76 |
*/ |
|
77 |
export function getSmsCaptcha (parameter) { |
|
78 |
return axios({ |
|
79 |
url: '/getSmsCaptcha', |
|
80 |
method: 'get', |
|
81 |
params: parameter |
|
82 |
}) |
|
83 |
} |
|
84 |
|
|
85 |
/** |
|
86 |
* 获取验证码开关 |
|
87 |
* |
|
88 |
* @author Jax |
|
89 |
* @date 2021/1/22 00:00 |
|
90 |
*/ |
|
91 |
export function getCaptchaOpen (parameter) { |
|
92 |
return axios({ |
|
93 |
url: '/getCaptchaOpen', |
|
94 |
method: 'get', |
|
95 |
params: parameter |
|
96 |
}) |
|
97 |
} |
|
98 |
|
|
99 |
/** |
|
100 |
* 获取验证图片 以及token |
|
101 |
* |
|
102 |
* @author Jax |
|
103 |
* @date 2021/1/22 00:00 |
|
104 |
*/ |
|
105 |
export function reqGet(data) { |
|
106 |
return axios({ |
|
107 |
url: '/captcha/get', |
|
108 |
method: 'post', |
|
109 |
data |
|
110 |
}) |
|
111 |
} |
|
112 |
|
|
113 |
/** |
|
114 |
* 滑动或者点选验证 |
|
115 |
* |
|
116 |
* @author Jax |
|
117 |
* @date 2021/1/22 00:00 |
|
118 |
*/ |
|
119 |
export function reqCheck(data) { |
|
120 |
return axios({ |
|
121 |
url: '/captcha/check', |
|
122 |
method: 'post', |
|
123 |
data |
|
124 |
}) |
|
125 |
} |