Merge branch 'master' into feature/shop
Showing
18 changed files
with
118 additions
and
42 deletions
@@ -17,6 +17,7 @@ const helpers = global.yoho.helpers; | @@ -17,6 +17,7 @@ const helpers = global.yoho.helpers; | ||
17 | const _ = require('lodash'); | 17 | const _ = require('lodash'); |
18 | const co = require('bluebird').coroutine; | 18 | const co = require('bluebird').coroutine; |
19 | const logger = global.yoho.logger; | 19 | const logger = global.yoho.logger; |
20 | +const stringProcess = require(`${global.utils}/string-process`); | ||
20 | 21 | ||
21 | // 支付方式 | 22 | // 支付方式 |
22 | const payments = { | 23 | const payments = { |
@@ -55,7 +56,7 @@ const _getOthersBuy2 = (param) => { | @@ -55,7 +56,7 @@ const _getOthersBuy2 = (param) => { | ||
55 | 56 | ||
56 | // 订单信息 | 57 | // 订单信息 |
57 | const _getOtherDetail = (param) => { | 58 | const _getOtherDetail = (param) => { |
58 | - if (!param.uid || !param.orderCode) { | 59 | + if (!param.uid || !param.orderCode || !stringProcess.isNumeric(param.orderCode)) { |
59 | return Promise.resolve({}); | 60 | return Promise.resolve({}); |
60 | } | 61 | } |
61 | 62 |
@@ -8,12 +8,14 @@ | @@ -8,12 +8,14 @@ | ||
8 | const installmentModel = require('../models/installment'); | 8 | const installmentModel = require('../models/installment'); |
9 | const _ = require('lodash'); | 9 | const _ = require('lodash'); |
10 | const helpers = global.yoho.helpers; | 10 | const helpers = global.yoho.helpers; |
11 | +const logger = global.yoho.logger; | ||
11 | 12 | ||
12 | // 服务器报错页面 | 13 | // 服务器报错页面 |
13 | const _serverCrash = (res, params, err, next) => { | 14 | const _serverCrash = (res, params, err, next) => { |
14 | if (err && err.code === 401) { | 15 | if (err && err.code === 401) { |
15 | return next(err); | 16 | return next(err); |
16 | } | 17 | } |
18 | + logger.error(err); | ||
17 | params.title = params.title || '有货分期'; | 19 | params.title = params.title || '有货分期'; |
18 | res.render('installment/server-crash', params); | 20 | res.render('installment/server-crash', params); |
19 | }; | 21 | }; |
@@ -12,6 +12,7 @@ const helpers = global.yoho.helpers; | @@ -12,6 +12,7 @@ const helpers = global.yoho.helpers; | ||
12 | const api = global.yoho.API; | 12 | const api = global.yoho.API; |
13 | const serviceAPI = global.yoho.ServiceAPI; | 13 | const serviceAPI = global.yoho.ServiceAPI; |
14 | const logger = global.yoho.logger; | 14 | const logger = global.yoho.logger; |
15 | +const stringProcess = require(`${global.utils}/string-process`); | ||
15 | const API_TIMEOUT = 10000; | 16 | const API_TIMEOUT = 10000; |
16 | const codeContent = { | 17 | const codeContent = { |
17 | openN: '0876085ff46bed27f1a1eb6ee8b68987', | 18 | openN: '0876085ff46bed27f1a1eb6ee8b68987', |
@@ -423,6 +424,10 @@ const getBankCards = (uid) => { | @@ -423,6 +424,10 @@ const getBankCards = (uid) => { | ||
423 | const getInstallmentOrderDetail = (params) => { | 424 | const getInstallmentOrderDetail = (params) => { |
424 | const method = 'app.SpaceOrders.installDetail'; | 425 | const method = 'app.SpaceOrders.installDetail'; |
425 | 426 | ||
427 | + if (!params.uid || !params.orderCode || !stringProcess.isNumeric(params.orderCode)) { | ||
428 | + return Promise.resolve({}); | ||
429 | + } | ||
430 | + | ||
426 | return api.get('', { | 431 | return api.get('', { |
427 | method: method, | 432 | method: method, |
428 | uid: params.uid, | 433 | uid: params.uid, |
@@ -10,6 +10,7 @@ const _ = require('lodash'); | @@ -10,6 +10,7 @@ const _ = require('lodash'); | ||
10 | const helpers = global.yoho.helpers; | 10 | const helpers = global.yoho.helpers; |
11 | const camelCase = global.yoho.camelCase; | 11 | const camelCase = global.yoho.camelCase; |
12 | const logger = global.yoho.logger; | 12 | const logger = global.yoho.logger; |
13 | +const stringProcess = require(`${global.utils}/string-process`); | ||
13 | 14 | ||
14 | const CODE_LOGISTIC_BANNER = '1fc9b2484fcd559049f2f7e0db313f20'; // 物流详情banner资源码 | 15 | const CODE_LOGISTIC_BANNER = '1fc9b2484fcd559049f2f7e0db313f20'; // 物流详情banner资源码 |
15 | 16 | ||
@@ -143,6 +144,10 @@ const _getOrderStatus = (order, showLogistics) => { | @@ -143,6 +144,10 @@ const _getOrderStatus = (order, showLogistics) => { | ||
143 | 144 | ||
144 | const orderDetailData = (uid, orderCode) => { | 145 | const orderDetailData = (uid, orderCode) => { |
145 | 146 | ||
147 | + if (!uid || !orderCode || !stringProcess.isNumeric(orderCode)) { | ||
148 | + return Promise.resolve({}); | ||
149 | + } | ||
150 | + | ||
146 | return api.get('', { | 151 | return api.get('', { |
147 | method: 'app.SpaceOrders.detail', | 152 | method: 'app.SpaceOrders.detail', |
148 | uid: uid, | 153 | uid: uid, |
@@ -237,6 +237,8 @@ const sendCodeToMobileAPI = (req, res, next) => { | @@ -237,6 +237,8 @@ const sendCodeToMobileAPI = (req, res, next) => { | ||
237 | _.set(req.session, 'backupCaptch.timeout', Date.now() + 5 * 60 * 1000); | 237 | _.set(req.session, 'backupCaptch.timeout', Date.now() + 5 * 60 * 1000); |
238 | } | 238 | } |
239 | 239 | ||
240 | + req.session.backupCaptchStep2 = true; // 允许跳到第二步 | ||
241 | + | ||
240 | return res.json({ | 242 | return res.json({ |
241 | code: 200, | 243 | code: 200, |
242 | data: helpers.urlFormat('/passport/back/mobilecode', { | 244 | data: helpers.urlFormat('/passport/back/mobilecode', { |
@@ -286,14 +288,17 @@ const verifyCodeByMobileAPI = (req, res, next) => { | @@ -286,14 +288,17 @@ const verifyCodeByMobileAPI = (req, res, next) => { | ||
286 | 288 | ||
287 | service.validateMobileCodeAsync(phoneNum, code, areaCode) | 289 | service.validateMobileCodeAsync(phoneNum, code, areaCode) |
288 | .then(result => { | 290 | .then(result => { |
289 | - if (result.code === 200) { | 291 | + if (result.code === 200 && result.data) { |
292 | + req.session.backcode = { | ||
293 | + phoneNum: phoneNum, | ||
294 | + token: result.data.token, | ||
295 | + areaCode: areaCode, | ||
296 | + code: code | ||
297 | + }; | ||
298 | + | ||
290 | res.json({ | 299 | res.json({ |
291 | code: 200, | 300 | code: 200, |
292 | - data: helpers.urlFormat('/passport/back/backcode', { | ||
293 | - phoneNum: phoneNum, | ||
294 | - token: result.data.token, | ||
295 | - areaCode: areaCode | ||
296 | - }) | 301 | + data: helpers.urlFormat('/passport/back/backcode') |
297 | }); | 302 | }); |
298 | } else { | 303 | } else { |
299 | res.json({ | 304 | res.json({ |
@@ -309,16 +314,15 @@ const verifyCodeByMobileAPI = (req, res, next) => { | @@ -309,16 +314,15 @@ const verifyCodeByMobileAPI = (req, res, next) => { | ||
309 | * 找回密码页面,设置新密码页面-手机 | 314 | * 找回密码页面,设置新密码页面-手机 |
310 | */ | 315 | */ |
311 | const setNewPasswordByMobilePage = (req, res) => { | 316 | const setNewPasswordByMobilePage = (req, res) => { |
312 | - let phoneNum = req.query.phoneNum || ''; | ||
313 | - let token = req.query.token || ''; | ||
314 | - let areaCode = req.query.areaCode || '86'; | ||
315 | - let code = req.query.code || ''; | 317 | + let backcode = req.session.backcode; |
316 | 318 | ||
317 | - if (!(code || (token && helpers.verifyMobile(phoneNum)))) { | 319 | + if (!backcode || !(backcode.code || (backcode.token && helpers.verifyMobile(backcode.phoneNum)))) { |
318 | res.redirect(400); | 320 | res.redirect(400); |
319 | return; | 321 | return; |
320 | } | 322 | } |
321 | 323 | ||
324 | + req.session.backcode = null; | ||
325 | + | ||
322 | res.render('back/new-password', Object.assign({ | 326 | res.render('back/new-password', Object.assign({ |
323 | module: 'passport', | 327 | module: 'passport', |
324 | page: 'back-new-password', | 328 | page: 'back-new-password', |
@@ -328,10 +332,10 @@ const setNewPasswordByMobilePage = (req, res) => { | @@ -328,10 +332,10 @@ const setNewPasswordByMobilePage = (req, res) => { | ||
328 | headerText: '找回密码', | 332 | headerText: '找回密码', |
329 | isPassportPage: true, | 333 | isPassportPage: true, |
330 | backNewPwd: true, | 334 | backNewPwd: true, |
331 | - phoneNum: phoneNum, | ||
332 | - token: token, | ||
333 | - areaCode: areaCode, | ||
334 | - code: code | 335 | + phoneNum: backcode.phoneNum, |
336 | + token: backcode.token, | ||
337 | + areaCode: backcode.areaCode, | ||
338 | + code: backcode.code | ||
335 | })); | 339 | })); |
336 | }; | 340 | }; |
337 | 341 | ||
@@ -361,6 +365,20 @@ const setNewPasswordByMobileAPI = (req, res, next) => { | @@ -361,6 +365,20 @@ const setNewPasswordByMobileAPI = (req, res, next) => { | ||
361 | .catch(next); | 365 | .catch(next); |
362 | }; | 366 | }; |
363 | 367 | ||
368 | +/** | ||
369 | + * 直接调用发短信接口的情况 | ||
370 | + */ | ||
371 | +const verifySmsAllow = (req, res, next) => { | ||
372 | + if (_.get(req, 'session.backupCaptch.verifyResult')) { | ||
373 | + return next(); | ||
374 | + } else { | ||
375 | + return res.json({ | ||
376 | + code: 400, | ||
377 | + message: '非法请求' | ||
378 | + }); | ||
379 | + } | ||
380 | +}; | ||
381 | + | ||
364 | module.exports = { | 382 | module.exports = { |
365 | indexEmailPage, | 383 | indexEmailPage, |
366 | sendCodeToEmailAPI, | 384 | sendCodeToEmailAPI, |
@@ -373,5 +391,6 @@ module.exports = { | @@ -373,5 +391,6 @@ module.exports = { | ||
373 | verifyCodeByMobileAPI, | 391 | verifyCodeByMobileAPI, |
374 | setNewPasswordByMobilePage, | 392 | setNewPasswordByMobilePage, |
375 | setNewPasswordByMobileAPI, | 393 | setNewPasswordByMobileAPI, |
376 | - generateCodeImg | 394 | + generateCodeImg, |
395 | + verifySmsAllow | ||
377 | }; | 396 | }; |
@@ -38,6 +38,7 @@ exports.imgCheck = (req, res, next) => { | @@ -38,6 +38,7 @@ exports.imgCheck = (req, res, next) => { | ||
38 | }, ''); | 38 | }, ''); |
39 | 39 | ||
40 | req.session.captcha = codeStr; | 40 | req.session.captcha = codeStr; |
41 | + req.session.captchaTimeout = new Date().getTime() + 1000 * 60; | ||
41 | req.session.captchaSrc = result.data.verifiedGraphicCode; | 42 | req.session.captchaSrc = result.data.verifiedGraphicCode; |
42 | 43 | ||
43 | return request(`${result.data.verifiedGraphicCode}?imageView2/0/format/jpg/q/70|watermark/2/text/${uuid.v4()}/fontsize/120/dissolve/10`).pipe(res); // eslint-disable-line | 44 | return request(`${result.data.verifiedGraphicCode}?imageView2/0/format/jpg/q/70|watermark/2/text/${uuid.v4()}/fontsize/120/dissolve/10`).pipe(res); // eslint-disable-line |
@@ -52,6 +53,18 @@ exports.imgCheck = (req, res, next) => { | @@ -52,6 +53,18 @@ exports.imgCheck = (req, res, next) => { | ||
52 | exports.validate = (req, res, next) => { | 53 | exports.validate = (req, res, next) => { |
53 | let captchaInput = req.body.captcha; | 54 | let captchaInput = req.body.captcha; |
54 | let captchaCode = _.get(req.session, 'captcha'); | 55 | let captchaCode = _.get(req.session, 'captcha'); |
56 | + let captchaTimeout = _.get(req.session, 'captchaTimeout'); | ||
57 | + | ||
58 | + if (new Date().getTime() > captchaTimeout) { | ||
59 | + _.set(req.session, 'captchaValidCount', 5); | ||
60 | + req.session.captcha = null; | ||
61 | + return res.json({ | ||
62 | + code: 400, | ||
63 | + message: '验证码超时,请重试', | ||
64 | + changeCaptcha: true, | ||
65 | + captchaShow: true | ||
66 | + }); | ||
67 | + } | ||
55 | 68 | ||
56 | let errorCount = _.get(req.session, 'captchaValidCount'); // 初始1次 + 后续4次, 同一个验证码 共5次 | 69 | let errorCount = _.get(req.session, 'captchaValidCount'); // 初始1次 + 后续4次, 同一个验证码 共5次 |
57 | 70 |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | * @Author: Targaryen | 2 | * @Author: Targaryen |
3 | * @Date: 2017-04-13 10:21:07 | 3 | * @Date: 2017-04-13 10:21:07 |
4 | * @Last Modified by: Targaryen | 4 | * @Last Modified by: Targaryen |
5 | - * @Last Modified time: 2017-04-20 18:33:48 | 5 | + * @Last Modified time: 2017-04-24 10:52:08 |
6 | */ | 6 | */ |
7 | 7 | ||
8 | /* ******************** | 8 | /* ******************** |
@@ -49,9 +49,9 @@ const passwordResetPage = (req, res) => { | @@ -49,9 +49,9 @@ const passwordResetPage = (req, res) => { | ||
49 | */ | 49 | */ |
50 | const passwordReset = (req, res, next) => { | 50 | const passwordReset = (req, res, next) => { |
51 | let passwordWeakObj = req.session.passwordWeak; | 51 | let passwordWeakObj = req.session.passwordWeak; |
52 | - let uid = req.user && req.user.uid || passwordWeakObj.uid; | 52 | + let uid = (req.user && req.user.uid) || (passwordWeakObj && passwordWeakObj.uid); |
53 | 53 | ||
54 | - if (!uid || !passwordWeakObj.token) { | 54 | + if (!uid || !passwordWeakObj || !passwordWeakObj.token) { |
55 | return res.json({ | 55 | return res.json({ |
56 | code: 400, | 56 | code: 400, |
57 | massage: '非法请求' | 57 | massage: '非法请求' |
@@ -134,6 +134,7 @@ router.get('/passport/back/mobile', validateCode.load, back.indexMobilePage);// | @@ -134,6 +134,7 @@ router.get('/passport/back/mobile', validateCode.load, back.indexMobilePage);// | ||
134 | router.get('/passport/back/mobilecode', back.verifyCodeByMobilePage);// 输入手机验证码页面 | 134 | router.get('/passport/back/mobilecode', back.verifyCodeByMobilePage);// 输入手机验证码页面 |
135 | router.get('/passport/back/generatecodeimg.png', back.generateCodeImg);// 生成图片验证码 | 135 | router.get('/passport/back/generatecodeimg.png', back.generateCodeImg);// 生成图片验证码 |
136 | router.post('/passport/back/sendcode', validateCode.check, back.sendCodeToMobileAPI);// 发送手机验证码 | 136 | router.post('/passport/back/sendcode', validateCode.check, back.sendCodeToMobileAPI);// 发送手机验证码 |
137 | +router.post('/passport/back/sendcodeagain', back.verifySmsAllow, back.sendCodeToMobileAPI);// 重新发送手机验证码 | ||
137 | router.post('/passport/back/verifycode', back.verifyCodeByMobileAPI);// 校验手机验证码 | 138 | router.post('/passport/back/verifycode', back.verifyCodeByMobileAPI);// 校验手机验证码 |
138 | 139 | ||
139 | router.get('/passport/back/backcode', back.setNewPasswordByMobilePage);// 设置新密码页面 | 140 | router.get('/passport/back/backcode', back.setNewPasswordByMobilePage);// 设置新密码页面 |
@@ -221,7 +221,7 @@ const shop = { | @@ -221,7 +221,7 @@ const shop = { | ||
221 | } | 221 | } |
222 | 222 | ||
223 | /* 红人店铺直接跳转 */ | 223 | /* 红人店铺直接跳转 */ |
224 | - if (shopInfoResult.is_red_shop) { | 224 | + if (shopInfoResult && shopInfoResult.is_red_shop) { |
225 | shop.redShop(req, res, next); | 225 | shop.redShop(req, res, next); |
226 | return false; | 226 | return false; |
227 | } | 227 | } |
@@ -7,11 +7,17 @@ | @@ -7,11 +7,17 @@ | ||
7 | 7 | ||
8 | const newsaleModel = require('../models/newsale'); | 8 | const newsaleModel = require('../models/newsale'); |
9 | const headerModel = require('../../../doraemon/models/header'); | 9 | const headerModel = require('../../../doraemon/models/header'); |
10 | + | ||
11 | +let yhchannels = { | ||
12 | + '1,3': 1, | ||
13 | + '2,3': 2 | ||
14 | +}; | ||
15 | + | ||
10 | let channels = { | 16 | let channels = { |
11 | - boys: '1,3', | ||
12 | - girl: '2,3', | ||
13 | - kids: '1,2,3', | ||
14 | - lifestyle: '1,2,3' | 17 | + boys: 1, |
18 | + girls: 2, | ||
19 | + kids: 3, | ||
20 | + lifestyle: 4 | ||
15 | }; | 21 | }; |
16 | 22 | ||
17 | const index = (req, res, next) => { | 23 | const index = (req, res, next) => { |
@@ -56,10 +62,10 @@ const selectHotrank = (req, res, next) => { | @@ -56,10 +62,10 @@ const selectHotrank = (req, res, next) => { | ||
56 | let limit = 50; | 62 | let limit = 50; |
57 | let page = req.query.page || 1; | 63 | let page = req.query.page || 1; |
58 | let notab = req.query.notab || 0; | 64 | let notab = req.query.notab || 0; |
59 | - let yhChannel = req.query.yh_channel || 1; | ||
60 | - let gender = req.query.gender || req.cookies._Channel && channels[req.cookies._Channel] || '1,3'; | 65 | + let yhChannel = (req.query.gender && yhchannels[req.query.gender]) || |
66 | + (req.cookies._Channel && channels[req.cookies._Channel]) || 1; | ||
61 | 67 | ||
62 | - newsaleModel.selectHotrank(yhChannel, gender, sort, tab_id, limit, page, notab).then((result) => { | 68 | + newsaleModel.selectHotrank(yhChannel, sort, tab_id, limit, page, notab).then((result) => { |
63 | 69 | ||
64 | res.render('newsale/hotlist', { | 70 | res.render('newsale/hotlist', { |
65 | layout: false, | 71 | layout: false, |
@@ -11,6 +11,7 @@ const helpers = global.yoho.helpers; | @@ -11,6 +11,7 @@ const helpers = global.yoho.helpers; | ||
11 | const api = global.yoho.API; | 11 | const api = global.yoho.API; |
12 | const searchModel = require('./search'); | 12 | const searchModel = require('./search'); |
13 | const productProcess = require(`${utils}/product-process`); | 13 | const productProcess = require(`${utils}/product-process`); |
14 | +const stringProcess = require(`${global.utils}/string-process`); | ||
14 | 15 | ||
15 | /** | 16 | /** |
16 | * 频道 | 17 | * 频道 |
@@ -122,14 +123,22 @@ const _getShopDecorator = (shopId) => { | @@ -122,14 +123,22 @@ const _getShopDecorator = (shopId) => { | ||
122 | * @return array | 123 | * @return array |
123 | */ | 124 | */ |
124 | const _getShopInfo = (shopId, uid) => { | 125 | const _getShopInfo = (shopId, uid) => { |
125 | - if (uid === 'undefined') { | ||
126 | - uid = 0; | ||
127 | - } | ||
128 | - return api.get('', { | 126 | + let finalParams = { |
129 | method: 'app.shops.getIntro', | 127 | method: 'app.shops.getIntro', |
130 | shop_id: shopId, | 128 | shop_id: shopId, |
131 | - uid: uid || 0 | ||
132 | - }, {code: 200}).then((result) => { | 129 | + }; |
130 | + | ||
131 | + if (!shopId || !stringProcess.isNumeric(shopId)) { | ||
132 | + return Promise.resolve({}); | ||
133 | + } | ||
134 | + | ||
135 | + if (uid && uid !== 'undefined') { | ||
136 | + Object.assign(finalParams, { | ||
137 | + uid: uid | ||
138 | + }); | ||
139 | + } | ||
140 | + | ||
141 | + return api.get('', finalParams, {code: 200}).then((result) => { | ||
133 | return result && result.data; | 142 | return result && result.data; |
134 | }); | 143 | }); |
135 | }; | 144 | }; |
@@ -144,6 +153,10 @@ const getShopIntro = (shopId, uid) => { | @@ -144,6 +153,10 @@ const getShopIntro = (shopId, uid) => { | ||
144 | shop_id: shopId | 153 | shop_id: shopId |
145 | }; | 154 | }; |
146 | 155 | ||
156 | + if (!shopId || !stringProcess.isNumeric(shopId)) { | ||
157 | + return Promise.resolve({}); | ||
158 | + } | ||
159 | + | ||
147 | if (uid && uid !== 'undefined') { | 160 | if (uid && uid !== 'undefined') { |
148 | params.uid = uid; | 161 | params.uid = uid; |
149 | } | 162 | } |
@@ -40,10 +40,9 @@ const getHotRank = (codeKey) => { | @@ -40,10 +40,9 @@ const getHotRank = (codeKey) => { | ||
40 | }); | 40 | }); |
41 | }; | 41 | }; |
42 | 42 | ||
43 | -const selectHotrank = (yhChannel, gender, sort, tabId, limit, page, notab) => { | 43 | +const selectHotrank = (yhChannel, sort, tabId, limit, page, notab) => { |
44 | let param = { | 44 | let param = { |
45 | method: 'app.search.top', | 45 | method: 'app.search.top', |
46 | - gender: gender, | ||
47 | yh_channel: yhChannel, | 46 | yh_channel: yhChannel, |
48 | page: page, | 47 | page: page, |
49 | limit: limit | 48 | limit: limit |
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | 5 | ||
6 | const api = global.yoho.API; | 6 | const api = global.yoho.API; |
7 | const singleAPI = global.yoho.SingleAPI; | 7 | const singleAPI = global.yoho.SingleAPI; |
8 | +const stringProcess = require(`${global.utils}/string-process`); | ||
8 | 9 | ||
9 | /** | 10 | /** |
10 | * 频道 | 11 | * 频道 |
@@ -41,6 +42,10 @@ exports.getIntro = shopId => { | @@ -41,6 +42,10 @@ exports.getIntro = shopId => { | ||
41 | shop_id: shopId | 42 | shop_id: shopId |
42 | }; | 43 | }; |
43 | 44 | ||
45 | + if (!shopId || !stringProcess.isNumeric(shopId)) { | ||
46 | + return Promise.resolve({}); | ||
47 | + } | ||
48 | + | ||
44 | return api.get('', params, {cache: true, code: 200}); | 49 | return api.get('', params, {cache: true, code: 200}); |
45 | }; | 50 | }; |
46 | 51 |
@@ -14,8 +14,8 @@ const domains = { | @@ -14,8 +14,8 @@ const domains = { | ||
14 | liveApi: 'http://testapi.live.yohops.com:9999/', | 14 | liveApi: 'http://testapi.live.yohops.com:9999/', |
15 | singleApi: 'http://api-test3.yohops.com:9999/', | 15 | singleApi: 'http://api-test3.yohops.com:9999/', |
16 | 16 | ||
17 | - api: 'http://api.yoho.cn/', | ||
18 | - service: 'http://service.yoho.cn/', | 17 | + api: 'http://api-test3.yohops.com:9999/', |
18 | + service: 'http://service-test3.yohops.com:9999/', | ||
19 | global: 'http://api-global.yohobuy.com', | 19 | global: 'http://api-global.yohobuy.com', |
20 | 20 | ||
21 | // liveApi: 'http://api.live.yoho.cn/', | 21 | // liveApi: 'http://api.live.yoho.cn/', |
@@ -118,7 +118,7 @@ module.exports = function(useInRegister, useForBind, useForRelate) { | @@ -118,7 +118,7 @@ module.exports = function(useInRegister, useForBind, useForRelate) { | ||
118 | 118 | ||
119 | $.ajax({ | 119 | $.ajax({ |
120 | type: 'POST', | 120 | type: 'POST', |
121 | - url: (useForBind || useForRelate) ? '/passport/bind/sendBindMsg' : '/passport/' + urlMid + '/sendcode', | 121 | + url: (useForBind || useForRelate) ? '/passport/bind/sendBindMsg' : '/passport/' + urlMid + '/sendcodeagain', |
122 | data: { | 122 | data: { |
123 | phoneNum: phoneNum, | 123 | phoneNum: phoneNum, |
124 | areaCode: areaCode | 124 | areaCode: areaCode |
@@ -6,6 +6,9 @@ | @@ -6,6 +6,9 @@ | ||
6 | let $ = require('yoho-jquery'), | 6 | let $ = require('yoho-jquery'), |
7 | ImgCheck = require('plugin/img-check'), | 7 | ImgCheck = require('plugin/img-check'), |
8 | tip = require('plugin/tip'); | 8 | tip = require('plugin/tip'); |
9 | + | ||
10 | +let loading = require('plugin/loading'); | ||
11 | + | ||
9 | const validType = { | 12 | const validType = { |
10 | IMG_CHECK: 1, | 13 | IMG_CHECK: 1, |
11 | GEETEST: 2 | 14 | GEETEST: 2 |
@@ -94,7 +97,9 @@ class Validate { | @@ -94,7 +97,9 @@ class Validate { | ||
94 | } | 97 | } |
95 | return Promise.resolve({captcha}); | 98 | return Promise.resolve({captcha}); |
96 | } else { | 99 | } else { |
100 | + loading.showLoadingMask(); | ||
97 | return new Promise((resolve) => { | 101 | return new Promise((resolve) => { |
102 | + loading.hideLoadingMask(); | ||
98 | this.$container.removeClass('hide'); | 103 | this.$container.removeClass('hide'); |
99 | this.captchaObj.onSuccess(() => { | 104 | this.captchaObj.onSuccess(() => { |
100 | resolve(this.captchaObj.getValidate()); | 105 | resolve(this.captchaObj.getValidate()); |
1 | let $ = require('yoho-jquery'), | 1 | let $ = require('yoho-jquery'), |
2 | Swiper = require('yoho-swiper'), | 2 | Swiper = require('yoho-swiper'), |
3 | lazyLoad = require('yoho-jquery-lazyload'), | 3 | lazyLoad = require('yoho-jquery-lazyload'), |
4 | - loading = require('plugin/loading'); | 4 | + loading = require('plugin/loading'), |
5 | + qs = require('yoho-qs'); | ||
5 | 6 | ||
6 | let page = 1, | 7 | let page = 1, |
7 | winH, | 8 | winH, |
@@ -34,7 +35,8 @@ function hotrank(pageIndex, sortIndex, tabId, noTab) { | @@ -34,7 +35,8 @@ function hotrank(pageIndex, sortIndex, tabId, noTab) { | ||
34 | data: { | 35 | data: { |
35 | page: pageIndex, | 36 | page: pageIndex, |
36 | tab_id: tabId, | 37 | tab_id: tabId, |
37 | - notab: noTab | 38 | + notab: noTab, |
39 | + gender: qs.gender | ||
38 | }, | 40 | }, |
39 | success: function(data) { | 41 | success: function(data) { |
40 | if (data === ' ') { | 42 | if (data === ' ') { |
-
Please register or login to post a comment