account.js
2.16 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
/**
* [个人中心]个人设置-账户安全部分
* @author: jiangmin
* @date: 2016/07/13
*/
'use strict';
const api = global.yoho.API;
/**
* 验证用户登录密码是否正确
* @param uid
* @param password
* @return type
*/
const verifyPwd = (uid, password)=> {
return api.get('', {
method: 'web.passport.verifyUserPwd',
uid: uid,
password: password
}).then(result => result);
};
/**
* 修改密码
* @param uid
* @param pwd
* @returns {*}
* @private
*/
const changePwd = (uid, pwd)=> {
return api.get('', {
method: 'web.passport.changePwd',
uid: uid,
newPassword: pwd
}).then(result => result);
};
/**
* 发送手机验证
* @param uid
* @param mobile
* @param area
*/
const sendMobileMsg = (uid, mobile, area)=> {
return api.get('', {
method: 'web.passport.sendcode',
uid: uid,
mobile: mobile,
area: area
}).then(result => result);
};
/**
* 验证短信验证码
* @param code
* @param mobile
* @param area
*/
const checkVerifyMsg = (code, mobile, area)=> {
return api.get('', {
method: 'web.passport.checkcode',
code: code,
mobile: mobile,
area: area
}).then(result => result);
};
/**
* 发送验证邮箱
* @param uid
* @param email
*/
const sendVerifyEmail = (uid, email)=> {
return api.get('', {
method: 'web.passport.verifyEmail',
uid: uid,
email: email
}).then(result => result);
};
/**
* 修改手机号前校验
* @param uid
* @param mobile
* @param area
*/
const checkVerifyMobile = (uid, mobile, area)=> {
return api.get('', {
method: 'web.passport.checkVerifyMobile',
uid: uid,
mobile: mobile,
area: area
}).then(result => result);
};
const modifyVerifyMobile = (uid, area, newMobile)=> {
return api.get('', {
method: 'web.passport.changeVerifyMobile',
uid: uid,
newMobile: newMobile,
area: area
}).then(result => result);
};
module.exports = {
verifyPwd,
changePwd,
sendMobileMsg,
checkVerifyMsg,
sendVerifyEmail,
checkVerifyMobile,
modifyVerifyMobile
};