Authored by 毕凯

Merge remote-tracking branch 'origin/hotfix/onlinebug' into release/6.5

@@ -27,8 +27,12 @@ function pushHistory() { @@ -27,8 +27,12 @@ function pushHistory() {
27 return false; 27 return false;
28 } 28 }
29 29
30 - window.history.replaceState(state, null, state.url);  
31 - window.history.pushState({page: pages[1]}, null, url); 30 + try {
  31 + window.history.replaceState(state, null, state.url);
  32 + window.history.pushState({page: pages[1]}, null, url);
  33 + } catch (e) {
  34 + return;
  35 + }
32 } 36 }
33 37
34 if (/micromessenger/i.test(navigator.userAgent) && 38 if (/micromessenger/i.test(navigator.userAgent) &&
@@ -6,6 +6,7 @@ const showErrTip = tip.show; @@ -6,6 +6,7 @@ const showErrTip = tip.show;
6 const api = require('../api'); 6 const api = require('../api');
7 const trim = $.trim; 7 const trim = $.trim;
8 const Validate = require('plugin/validata'); 8 const Validate = require('plugin/validata');
  9 +const cookie = require('yoho-cookie');
9 const validate = new Validate($captcha, { 10 const validate = new Validate($captcha, {
10 useREM: { 11 useREM: {
11 rootFontSize: 40, 12 rootFontSize: 40,
@@ -136,9 +137,11 @@ class Login { @@ -136,9 +137,11 @@ class Login {
136 location.href = res.href; 137 location.href = res.href;
137 this.view.loginBtn.text('登录成功'); 138 this.view.loginBtn.text('登录成功');
138 } else if (data.code === 4189) { 139 } else if (data.code === 4189) {
139 - localStorage.loginJumpUrl = $('#account').val();  
140 - localStorage.loginJump = 'true';  
141 - location.href = data.url; 140 + cookie.set('_loginJumpUrl', $('input[name=username]').val());
  141 + showErrTip('您的账号存在安全隐患需要进行身份验证');
  142 + setTimeout(() => {
  143 + location.href = data.url;
  144 + }, 2500);
142 } else if (data.code === 510 || data.code === 50004) { 145 } else if (data.code === 510 || data.code === 50004) {
143 location.href = data.url; 146 location.href = data.url;
144 } else { 147 } else {
@@ -20,6 +20,7 @@ let $account = $('#account'), @@ -20,6 +20,7 @@ let $account = $('#account'),
20 20
21 let api = require('../api'); 21 let api = require('../api');
22 let tip = require('plugin/tip'); 22 let tip = require('plugin/tip');
  23 +let cookie = require('yoho-cookie');
23 24
24 let trim = $.trim; 25 let trim = $.trim;
25 let showErrTip = tip.show; 26 let showErrTip = tip.show;
@@ -97,9 +98,11 @@ function loginAuth(params, acc) { @@ -97,9 +98,11 @@ function loginAuth(params, acc) {
97 location.href = res.href; 98 location.href = res.href;
98 $loginBtn.text('登录成功'); 99 $loginBtn.text('登录成功');
99 } else if (data.code === 4189) { 100 } else if (data.code === 4189) {
100 - localStorage.loginJumpUrl = $('#account').val();  
101 - localStorage.loginJump = 'true';  
102 - location.href = data.url; 101 + cookie.set('_loginJumpUrl', $('input[name=username]').val());
  102 + showErrTip('您的账号存在安全隐患需要进行身份验证');
  103 + setTimeout(() => {
  104 + location.href = data.url;
  105 + }, 2500);
103 } else if (data.code === 510 || data.code === 50004) { 106 } else if (data.code === 510 || data.code === 50004) {
104 location.href = data.url; 107 location.href = data.url;
105 } else { 108 } else {
@@ -174,10 +174,3 @@ page = { @@ -174,10 +174,3 @@ page = {
174 $(function() { 174 $(function() {
175 page.init(); 175 page.init();
176 }); 176 });
177 -  
178 -// 多次登录失败跳短信认证填充手机号  
179 -if (localStorage.loginJump) {  
180 - $('.sms-login .title').text('身份验证');  
181 - $('.sms-login-msg').before('<p class="sms-login-msg">您的账号存在安全隐患需要进行身份验证</p>');  
182 - localStorage.removeItem('loginJump');  
183 -}  
@@ -17,6 +17,7 @@ tip = require('plugin/tip'); @@ -17,6 +17,7 @@ tip = require('plugin/tip');
17 api = require('./api'); 17 api = require('./api');
18 checkPoint = require('./smslogin/check-point'); 18 checkPoint = require('./smslogin/check-point');
19 19
  20 +let cookie = require('yoho-cookie');
20 21
21 // 图片验证码 22 // 图片验证码
22 let Validate = require('plugin/validata'); 23 let Validate = require('plugin/validata');
@@ -149,5 +150,5 @@ $(function() { @@ -149,5 +150,5 @@ $(function() {
149 }); 150 });
150 151
151 // 多次登录失败跳短信认证填充手机号 152 // 多次登录失败跳短信认证填充手机号
152 -$('#phone-num').val(localStorage.loginJumpUrl);  
153 -localStorage.removeItem('loginJumpUrl'); 153 +$('#phone-num').val(cookie.get('_loginJumpUrl'));
  154 +cookie.remove('_loginJumpUrl');
@@ -5,6 +5,7 @@ import checkPoint from './check-point'; @@ -5,6 +5,7 @@ import checkPoint from './check-point';
5 import Page from 'yoho-page'; 5 import Page from 'yoho-page';
6 import Validate from 'plugin/validata'; 6 import Validate from 'plugin/validata';
7 const $captcha = $('#js-img-check'); 7 const $captcha = $('#js-img-check');
  8 +const cookie = require('yoho-cookie');
8 const validate = new Validate($captcha, { 9 const validate = new Validate($captcha, {
9 useREM: { 10 useREM: {
10 rootFontSize: 40, 11 rootFontSize: 40,
@@ -42,16 +43,19 @@ class SmsLoginNew extends Page { @@ -42,16 +43,19 @@ class SmsLoginNew extends Page {
42 this.selector.getVerifyCodeBtn.data('oneClick', false); 43 this.selector.getVerifyCodeBtn.data('oneClick', false);
43 44
44 45
45 - // 多次登录失败跳短信认证填充手机号  
46 - this.selector.mobileInput.val(localStorage.loginJumpUrl);  
47 - localStorage.removeItem('loginJumpUrl');  
48 -  
49 if (window.queryString && window.queryString.area && window.queryString.mobile) { 46 if (window.queryString && window.queryString.area && window.queryString.mobile) {
50 this.selector.countryCodeSelector.val('+' + window.queryString.area); 47 this.selector.countryCodeSelector.val('+' + window.queryString.area);
51 this.selector.mobileInput.val(window.queryString.mobile); 48 this.selector.mobileInput.val(window.queryString.mobile);
52 this.selector.mobileInput.trigger('input'); 49 this.selector.mobileInput.trigger('input');
53 } 50 }
54 51
  52 + // 多次登录失败跳短信认证填充手机号
  53 + if (cookie.get('_loginJumpUrl')) {
  54 + this.selector.mobileInput.val(cookie.get('_loginJumpUrl'));
  55 + this.selector.mobileInput.trigger('input');
  56 + this.selector.getVerifyCodeBtn.click();
  57 + cookie.remove('_loginJumpUrl');
  58 + }
55 } 59 }
56 60
57 /** 61 /**
@@ -193,6 +197,11 @@ class SmsLoginNew extends Page { @@ -193,6 +197,11 @@ class SmsLoginNew extends Page {
193 let areaCode = this.selector.countryCodeSelector.val(); 197 let areaCode = this.selector.countryCodeSelector.val();
194 let phone = $.trim(this.selector.mobileInput.val()); 198 let phone = $.trim(this.selector.mobileInput.val());
195 199
  200 + if (cookie.get('_loginJumpUrl')) {
  201 + this.countDown();
  202 + return;
  203 + }
  204 +
196 validate.getResults().then(result => { 205 validate.getResults().then(result => {
197 let params = { 206 let params = {
198 area: areaCode.replace('+', ''), 207 area: areaCode.replace('+', ''),
@@ -71,7 +71,7 @@ module.exports = function() { @@ -71,7 +71,7 @@ module.exports = function() {
71 } 71 }
72 }); 72 });
73 73
74 - wx.ready(function() { 74 + typeof wx !== 'undefined' && wx.ready(function() {
75 let shareTitle = $('#shareTitle').val(); 75 let shareTitle = $('#shareTitle').val();
76 let shareImg = $('#shareImg').val(); 76 let shareImg = $('#shareImg').val();
77 let shareDesc = $('#shareDesc').val(); 77 let shareDesc = $('#shareDesc').val();
@@ -1016,6 +1016,8 @@ $listNav.on('touchend touchcancel', function(e) { @@ -1016,6 +1016,8 @@ $listNav.on('touchend touchcancel', function(e) {
1016 navType = 'sale'; 1016 navType = 'sale';
1017 } else if ($this.hasClass('popularity')) { 1017 } else if ($this.hasClass('popularity')) {
1018 navType = 'popularity'; 1018 navType = 'popularity';
  1019 + } else {
  1020 + navType = 'default';
1019 } 1021 }
1020 1022
1021 nav = navInfo[navType]; 1023 nav = navInfo[navType];