Authored by ccbikai

整理代码

@@ -59,11 +59,11 @@ class Auth { @@ -59,11 +59,11 @@ class Auth {
59 domain: 'yohobuy.com' 59 domain: 'yohobuy.com'
60 }); 60 });
61 } 61 }
62 - req.session._TOKEN = token; // esline-disable-line  
63 - req.session._LOGIN_UID = uid; // esline-disable-line 62 + req.session._TOKEN = token;
  63 + req.session._LOGIN_UID = uid;
64 res.cookie('_TOKEN', token, { 64 res.cookie('_TOKEN', token, {
65 domain: 'yohobuy.com' 65 domain: 'yohobuy.com'
66 - }); // esline-disable-line 66 + });
67 }); 67 });
68 } 68 }
69 } 69 }
@@ -16,7 +16,7 @@ const ALIPAY_URL = 'https://mapi.alipay.com/gateway.do'; @@ -16,7 +16,7 @@ const ALIPAY_URL = 'https://mapi.alipay.com/gateway.do';
16 16
17 const defaultOptions = { 17 const defaultOptions = {
18 service: 'alipay.auth.authorize', 18 service: 'alipay.auth.authorize',
19 - _input_charset: 'utf-8', // esline-disable-line 19 + _input_charset: 'utf-8',
20 sign_type: 'MD5', 20 sign_type: 'MD5',
21 target_service: 'user.auth.quick.login' 21 target_service: 'user.auth.quick.login'
22 }; 22 };
@@ -95,7 +95,7 @@ class RegService { @@ -95,7 +95,7 @@ class RegService {
95 }; 95 };
96 96
97 if (shoppingKey) { 97 if (shoppingKey) {
98 - params.shopping_key = shoppingKey; // esline-disable-line 98 + params.shopping_key = shoppingKey;
99 } 99 }
100 100
101 return api.post('', params); 101 return api.post('', params);
@@ -286,6 +286,9 @@ exports.verifyMobile = (phone) => { @@ -286,6 +286,9 @@ exports.verifyMobile = (phone) => {
286 return /^1[3|4|5|8|7][0-9]{9}$/.test(phone); 286 return /^1[3|4|5|8|7][0-9]{9}$/.test(phone);
287 }; 287 };
288 288
  289 +/**
  290 + * 验证密码规则
  291 + */
289 exports.verifyPassword = (password) => { 292 exports.verifyPassword = (password) => {
290 if (!password) { 293 if (!password) {
291 return false; 294 return false;