Authored by htoooth

fix login

@@ -266,7 +266,7 @@ let mobileRegister = (req, res, next) => { @@ -266,7 +266,7 @@ let mobileRegister = (req, res, next) => {
266 } 266 }
267 267
268 /* 手机注册: 调用注册接口*/ 268 /* 手机注册: 调用注册接口*/
269 - let regResult = yield regService.regMobileAes(area, mobile, password, cookie.getShoppingKey(req)); 269 + let regResult = yield regService.regMobileAes(area, mobile, password, code, cookie.getShoppingKey(req));
270 270
271 if (!regResult.code || regResult.code !== 200) { 271 if (!regResult.code || regResult.code !== 200) {
272 data.message = '注册失败'; 272 data.message = '注册失败';
@@ -30,27 +30,13 @@ let validMobileCode = (area, mobile, code) => { @@ -30,27 +30,13 @@ let validMobileCode = (area, mobile, code) => {
30 return api.post('', params); 30 return api.post('', params);
31 }; 31 };
32 32
33 -let regMobile = (area, mobile, password, shoppingKey)=> {  
34 - let params = {  
35 - method: 'app.passport.register',  
36 - area: area,  
37 - profile: mobile,  
38 - password: password  
39 - };  
40 -  
41 - if (shoppingKey) {  
42 - params.shopping_key = shoppingKey;  
43 - }  
44 -  
45 - return api.post('', params);  
46 -};  
47 -  
48 -let regMobileAes = (area, mobile, password, shoppingKey)=> { 33 +let regMobileAes = (area, mobile, password, code, shoppingKey)=> {
49 let params = { 34 let params = {
50 method: 'app.passport.registerAES', 35 method: 'app.passport.registerAES',
51 area: area, 36 area: area,
52 profile: mobile, 37 profile: mobile,
53 - password: aes.aesPwd(password) 38 + password: aes.aesPwd(password),
  39 + verifyCode: code
54 }; 40 };
55 41
56 if (shoppingKey) { 42 if (shoppingKey) {
@@ -63,6 +49,5 @@ let regMobileAes = (area, mobile, password, shoppingKey)=> { @@ -63,6 +49,5 @@ let regMobileAes = (area, mobile, password, shoppingKey)=> {
63 module.exports = { 49 module.exports = {
64 sendCodeToMobile, 50 sendCodeToMobile,
65 validMobileCode, 51 validMobileCode,
66 - regMobile,  
67 regMobileAes 52 regMobileAes
68 }; 53 };
@@ -76,8 +76,8 @@ function setLoginStatus(data) { @@ -76,8 +76,8 @@ function setLoginStatus(data) {
76 '<a href="//www.yohobuy.com/logout.html">[退出]</a>'; 76 '<a href="//www.yohobuy.com/logout.html">[退出]</a>';
77 } else { 77 } else {
78 loginHtml = '<span>Hi~</span>&nbsp;' + 78 loginHtml = '<span>Hi~</span>&nbsp;' +
79 - '<a href="//www.yohobuy.com/signin.html?refer="' + window.location.href + '>[请登录]</a>&nbsp;' +  
80 - '<a href="//www.yohobuy.com/reg.html"' + window.location.href + '>[免费注册]</a>'; 79 + '<a href="//www.yohobuy.com/signin.html">[请登录]</a>&nbsp;' +
  80 + '<a href="//www.yohobuy.com/reg.html">[免费注册]</a>';
81 } 81 }
82 $('.header-tool li').eq(0).html(loginHtml); 82 $('.header-tool li').eq(0).html(loginHtml);
83 } 83 }