Authored by 王水玲

Merge branch 'feature/passport' into release/4.8

@@ -58,8 +58,6 @@ const bind = { @@ -58,8 +58,6 @@ const bind = {
58 let isReg = req.query.isReg; 58 let isReg = req.query.isReg;
59 let phoneNum = req.query.phoneNum; 59 let phoneNum = req.query.phoneNum;
60 60
61 - console.log(typeof isReg);  
62 -  
63 res.render('bind/code', { 61 res.render('bind/code', {
64 backUrl: helpers.urlFormat('passport/login'), 62 backUrl: helpers.urlFormat('passport/login'),
65 showHeaderImg: true, 63 showHeaderImg: true,
@@ -198,7 +196,7 @@ const bind = { @@ -198,7 +196,7 @@ const bind = {
198 if (_.isNumber(parseInt(phoneNum, 0)) && openId && areaCode && sourceType && code) { 196 if (_.isNumber(parseInt(phoneNum, 0)) && openId && areaCode && sourceType && code) {
199 BindService.checkBindCode(areaCode, phoneNum, code).then(result => { 197 BindService.checkBindCode(areaCode, phoneNum, code).then(result => {
200 if (result && result.code && result.code === 200) { 198 if (result && result.code && result.code === 200) {
201 - return BindService.relateMobile(openId, sourceType, phoneNum, code); 199 + return BindService.relateMobile(openId, sourceType, phoneNum, areaCode);
202 } else { 200 } else {
203 return { code: 400, message: '短信验证码错误', data: '' }; 201 return { code: 400, message: '短信验证码错误', data: '' };
204 } 202 }
@@ -32,7 +32,7 @@ function doPassportCallback(openId, nickname, sourceType, req, res) { @@ -32,7 +32,7 @@ function doPassportCallback(openId, nickname, sourceType, req, res) {
32 } 32 }
33 if (openId && nickname) { 33 if (openId && nickname) {
34 return AuthHelper.signinByOpenID(nickname, openId, sourceType, shoppingKey).then((result) => { 34 return AuthHelper.signinByOpenID(nickname, openId, sourceType, shoppingKey).then((result) => {
35 - if (result.data['is_bind'] && result.data['is_bind'] === 'N') { //eslint-disable-line 35 + if (result && result.data['is_bind'] && result.data['is_bind'] === 'N') { //eslint-disable-line
36 return helpers.urlFormat('/passport/bind/index', { 36 return helpers.urlFormat('/passport/bind/index', {
37 openId: openId, 37 openId: openId,
38 sourceType: sourceType, 38 sourceType: sourceType,
@@ -115,7 +115,6 @@ $btnNext.on('touchstart', function() { @@ -115,7 +115,6 @@ $btnNext.on('touchstart', function() {
115 // message: 'xxxx', 115 // message: 'xxxx',
116 // } 116 // }
117 117
118 -  
119 if (res.code === 200) { 118 if (res.code === 200) {
120 if (res.data.isReg === 1) { 119 if (res.data.isReg === 1) {
121 dialog.showDialog({ 120 dialog.showDialog({