Authored by 王水玲

Merge branch 'feature/passport' into release/4.8

... ... @@ -6,6 +6,7 @@
const api = global.yoho.API;
const logger = global.yoho.logger;
const aes = require('./aes-pwd');
const YOHOBUY_URL = 'http://www.yohobuy.com/';
... ... @@ -17,20 +18,25 @@ const getAreaDataAsync = () => {
return api.get('', {
method: 'app.passport.getArea'
}).then(result => {
result.data = result.data.map(value => {
value.areaCode = `+${value.area}`;
if (value.areaCode === '+86') {
value.selected = true;
} else {
value.selected = false;
}
delete value.area;
return value;
});
return result;
if (result && result.code === 200) {
result.data = result.data.map(value => {
value.areaCode = `+${value.area}`;
if (value.areaCode === '+86') {
value.selected = true;
} else {
value.selected = false;
}
delete value.area;
return value;
});
return result;
} else {
logger.error('获取地区数据返回 code 不是 200');
return [];
}
});
};
... ...
... ... @@ -15,8 +15,11 @@ module.exports = {
port: 6001,
siteUrl: '//m.yohobuy.com',
domains: {
api: 'http://devapi.yoho.cn:58078/',
service: 'http://devservice.yoho.cn:58077/'
// api: 'http://devapi.yoho.cn:58078/',
// service: 'http://devservice.yoho.cn:58077/'
api: 'http://testapi.yoho.cn:28078/',
service: 'http://testservice.yoho.cn:28077/'
},
subDomains: {
host: '.m.yohobuy.com',
... ...
... ... @@ -35,13 +35,13 @@ $countrySelect.change(function() {
$btnNext.on('touchstart', function() {
var pn = trim($phoneNum.val()),
area = $countrySelect.val();
area = trim($countrySelect.val());
if ($btnNext.hasClass('disable')) {
return;
}
if (api.phoneRegx[area].test(pn)) {
if (area && pn && api.phoneRegx[area].test(pn)) {
$.ajax({
url: '/passport/back/sendcode',
type: 'POST',
... ... @@ -57,6 +57,8 @@ $btnNext.on('touchstart', function() {
}
}
});
} else if (!area) {
showErrTip('出错了,请重新刷新页面');
} else {
showErrTip('手机号格式不正确,请重新输入');
}
... ...