Browse Source

修复本地展示卖家中心问题3

wangdy 8 years ago
parent
commit
206fb083a5

+ 5 - 4
src/main/webapp/resources/js/common/controllers/commonCtrls.js

@@ -96,11 +96,12 @@ define([ 'app/app' ], function(app) {
             };
 
 			// 切换企业
-			$scope.switchto = function(en) {
-				AuthenticationService.reSignin(en.uu).success(function(){
+			$scope.switchto = function(enUU) {
+				AuthenticationService.reSignin(enUU).success(function(){
 					//$window.location.reload();
-					if (!en.uu || en.uu == '0'){
-						if (window.location.href.contains('vendor')){
+					if (!enUU || enUU == '0'){
+						var now = window.location.href.toString();
+						if (now.indexOf('vendor') > -1){
                             location.href = './register-saler';
                             return;
 						}

+ 1 - 1
src/main/webapp/resources/view/common/site-nav.html

@@ -161,7 +161,7 @@
                 </p>
                 <ul class="unstyled" ng-show="switching" style="-webkit-padding-start: 0;">
                     <li ng-repeat="en in userInfo.enterprises" ng-if="!en.current && userInfo.enterprises" style="line-height: 30px;">
-                        <a href="javascript:void(0)"  ng-bind="en.enName" title="{{en.enName}}" ng-click="switchto(en)"></a>
+                        <a href="javascript:void(0)"  ng-bind="en.enName" title="{{en.enName}}" ng-click="switchto(en.uu)"></a>
                     </li>
                     <!--<li ng-if="!userInfo.enterprises">
                         <a href="javascript:void(0)"><span ng-bind="userInfo.userName"></span><span>(个人账户)</span></a>