Authored by 王水玲
Committed by yyq

解决pc头部登录信息闪动的问题

@@ -25,6 +25,7 @@ var isen = true; @@ -25,6 +25,7 @@ var isen = true;
25 var loopdurationtime = 500; 25 var loopdurationtime = 500;
26 var globaltimeout; 26 var globaltimeout;
27 var onetimeoout; 27 var onetimeoout;
  28 +var $loginBox = $('#loginBox');
28 /** 29 /**
29 * banner和地址的映射 30 * banner和地址的映射
30 * @type {Object} 31 * @type {Object}
@@ -1413,6 +1414,8 @@ function actionLoginState(_data) { @@ -1413,6 +1414,8 @@ function actionLoginState(_data) {
1413 random: Math.random() 1414 random: Math.random()
1414 }; 1415 };
1415 1416
  1417 + $boxObj.html('').show();
  1418 +
1416 1419
1417 loginInfoCombine = handlebars.compile(loginHtml); 1420 loginInfoCombine = handlebars.compile(loginHtml);
1418 if (typeof info === 'undefined' || info === null) { 1421 if (typeof info === 'undefined' || info === null) {
@@ -1516,9 +1519,8 @@ function actionVipInfo(_data) { @@ -1516,9 +1519,8 @@ function actionVipInfo(_data) {
1516 * @return {[type]} [description] 1519 * @return {[type]} [description]
1517 */ 1520 */
1518 function actionLoginInfo() { 1521 function actionLoginInfo() {
1519 -  
1520 - $.getData('http://www.yohobuy.com/common/passport', '', function(_data) {  
1521 - if (_data.result !== -1) { 1522 + $.getData('http://web.dev.yohobuy.com/common/passport', '', function(_data) {
  1523 + if (_data && _data.result !== -1) {
1522 actionLoginState(_data); // 更改登录状态 1524 actionLoginState(_data); // 更改登录状态
1523 actionVipInfo(_data); //获得vip; 1525 actionVipInfo(_data); //获得vip;
1524 } else { 1526 } else {
@@ -1527,6 +1529,7 @@ function actionLoginInfo() { @@ -1527,6 +1529,7 @@ function actionLoginInfo() {
1527 domain: '.yohobuy.com', 1529 domain: '.yohobuy.com',
1528 expires: -1 1530 expires: -1
1529 }); 1531 });
  1532 + $loginBox.show();
1530 } 1533 }
1531 }); 1534 });
1532 } 1535 }
@@ -46,6 +46,10 @@ @@ -46,6 +46,10 @@
46 position: relative; 46 position: relative;
47 } 47 }
48 48
  49 + #loginBox {
  50 + display: none;
  51 + }
  52 +
49 .leftpart { 53 .leftpart {
50 position: relative; 54 position: relative;
51 padding-left: 5px; 55 padding-left: 5px;
@@ -275,6 +275,8 @@ class CommonController extends WebAction @@ -275,6 +275,8 @@ class CommonController extends WebAction
275 } 275 }
276 $userInfo['data']['result'] = 1; 276 $userInfo['data']['result'] = 1;
277 $this->helpJsonCallbackResult($callback, 200,'User info', $userInfo['data']); 277 $this->helpJsonCallbackResult($callback, 200,'User info', $userInfo['data']);
  278 + } else {
  279 + $this->helpJsonCallbackResult($callback, 403,'User info', '');
278 } 280 }
279 } 281 }
280 282