Browse Source

修复正式环境 切换帐套跳转问题5

wangdy 8 years ago
parent
commit
7601568480

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

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

+ 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.uu)"></a>
+                        <a href="javascript:void(0)"  ng-bind="en.enName" title="{{en.enName}}" ng-click="switchto(en)"></a>
                     </li>
                     <!--<li ng-if="!userInfo.enterprises">
                         <a href="javascript:void(0)"><span ng-bind="userInfo.userName"></span><span>(个人账户)</span></a>