Authored by htoooth

fix international phone

... ... @@ -30,22 +30,6 @@ let checkCode = (req, res, next) => {
};
/**
* 检查手机格式
*/
let checkMobileMiddleware = (req, res, next) => {
let mobile = +req.body.mobile;
let area = +req.body.area;
if (!_.isNumber(mobile) || !_.isNumber(area)) {
return res.json({
code: 400,
message: '手机号码格式不正确'
});
}
next();
};
/**
* 检查密码格式
*/
let checkPassword = (req, res, next) => {
... ... @@ -96,8 +80,8 @@ let checkMobile = (req, res, next) => {
let data = {
code: 400
};
let mobile = +req.body.mobile;
let area = +req.body.area;
let mobile = req.body.mobile;
let area = req.body.area;
// 判断手机号是否检查超过指定次数
let regCheckKey = 'regCheckMobileNum_' + passportHelper.makeAreaMobile(area, mobile);
... ... @@ -295,7 +279,6 @@ let success = (req, res) => {
module.exports = {
checkCode,
checkMobileMiddleware,
checkPassword,
index,
success,
... ...
... ... @@ -64,11 +64,11 @@ router.post('/autouserinfo/relateMobile', bind.relateMobile);
* 注册页面路由
*/
router.get('/reg', reg.index);
router.post('/reg/checkmobile', reg.checkMobileMiddleware, reg.checkMobile);
router.post('/reg/checkmobile', reg.checkMobile);
router.post('/reg/piccaptcha', reg.checkCode, reg.picCaptcha);
router.post('/reg/msgcaptcha', reg.checkMobileMiddleware, reg.msgCaptcha);
router.post('/reg/sendBindMsg', reg.checkMobileMiddleware, reg.checkCode, reg.sendBindMsg);
router.post('/reg/mobileregister', reg.checkMobileMiddleware, reg.checkPassword, reg.checkCode, reg.mobileRegister);
router.post('/reg/msgcaptcha', reg.msgCaptcha);
router.post('/reg/sendBindMsg', reg.checkCode, reg.sendBindMsg);
router.post('/reg/mobileregister', reg.checkPassword, reg.checkCode, reg.mobileRegister);
router.get('/reg/success', reg.success);
/**
... ...