account-api.js
3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/**
* 个人中心---账户安全
* @author gaohongwei <hongwei.gao@yoho.cn>
* @date: 2016/8/30
*/
'use strict';
const api = global.yoho.API;
const getVerifyInfo = uid => {
return api.get('', {
method: 'web.passport.getUserVerifyInfo',
uid: uid
});
};
const checkEmailCode = code => {
return api.get('', {
method: 'web.passport.checkCodeValid',
code: code
});
};
const modifyVerifyEmail = code => {
return api.get('', {
method: 'web.passport.changeVerifyEmail',
code: code
});
};
const verifyPwd = (uid, password) => {
return api.get('', {
method: 'web.passport.verifyUserPwd',
uid: uid,
password: password
});
};
const checkVerifyMsg = (area, mobile, code) => {
return api.get('', {
method: 'web.passport.checkcode',
area: area,
mobile: mobile,
code: code
});
};
/**
* 邮箱身份验证--发送邮件
* @param type $email
* @param type $callback 成功后跳转链接
* @return type
*/
const sendVerifyEmailForNext = (email, callback) => {
return api.get('', {
method: 'web.passport.sendVerifyEmailInfo',
email: email,
callback: callback
});
};
/**
* 修改验证手机号
* @param type $uid
* @param type $area
* @param type $newMobile
* @return type
*/
const modifyVerifyMobile = (uid, area, newMobile) => {
return api.get('', {
method: 'web.passport.changeVerifyMobile',
uid: uid,
area: area,
newMobile: newMobile
});
};
/**
* 修改邮箱前校验
* @param type $uid
* @param type $email
*/
const checkVerifyEmail = (uid, email) => {
return api.get('', {
method: 'web.passport.checkVerifyEmail',
uid: uid,
email: email
});
};
/**
* 验证邮箱--发送邮件
* @param type $uid
* @param type $email
* @return type
*/
const sendVerifyEmail = (uid, email) => {
return api.get('', {
method: 'web.passport.verifyEmail',
uid: uid,
email: email
});
};
/**
* 修改手机号前校验
* @param type $mobile
* @param type $area
* @return type
*/
const checkVerifyMobile = (uid, mobile, area) => {
return api.get('', {
method: 'web.passport.checkVerifyMobile',
uid: uid,
mobile: mobile,
area: area
});
};
/**
* 修改密码
* @param type $uid
* @param type $newPwd
* @return type
*/
const modifyPwd = (uid, newPwd) => {
return api.get('', {
method: 'web.passport.changePwd',
uid: uid,
newPassword: newPwd
});
};
/**
* 发送验证
* @param type $uid
* @param type $mobile
* @param type $area
* @return type
*/
const sendMobileMsg = (uid, mobile, area) => {
return api.get('', {
method: 'web.passport.sendcode',
uid: uid,
mobile: mobile,
area: area
});
};
module.exports = {
getVerifyInfo,
checkEmailCode,
modifyVerifyEmail,
verifyPwd,
checkVerifyMsg,
sendVerifyEmailForNext,
checkVerifyEmail,
checkVerifyMobile,
sendVerifyEmail,
modifyVerifyMobile,
modifyPwd,
sendMobileMsg
};