@@ -131,7 +131,14 @@ define([ 'app/app' ], function(app) {
}
$scope.userInfo = data;
- // 增加收藏功能的代码
+ $scope.sortEnterprises = $scope.userInfo.enterprises || [];
+ if ($scope.sortEnterprises.length) {
+ $scope.sortEnterprises.sort(function (a, b) {
+ return b.lastLoginTime - a.lastLoginTime;
+ })
+ }
+
+ // 增加收藏功能的代码
$rootScope.userInfo = data;
$rootScope.brandCount = 0;
$rootScope.componentCount = 0;
@@ -57,7 +57,7 @@ define([ 'angularAMD', 'ngRoute', 'ui-bootstrap', 'ngLocal', 'common/services',
$scope.userInfo = {};
AuthenticationService.getAuthentication().success(function(data){
-
//增加收藏功能的代码
@@ -199,7 +199,7 @@
</p>-->
<div ng-if="userInfo.enterprises && userInfo.enterprises.length > 0" class="switch-enterprise-title">您可切换至以下账户:</div>
<ul class="unstyled" style="-webkit-padding-start: 0;">
- <li ng-repeat="en in userInfo.enterprises" ng-if="!en.current && userInfo.enterprises" class="switch-enterprises">
+ <li ng-repeat="en in sortEnterprises" ng-if="!en.current && userInfo.enterprises" class="switch-enterprises">
<a href="javascript:void(0)" ng-bind="en.enName" title="{{en.enName}}" ng-click="switchto(en.uu)"></a>
</li>
<!--<li ng-if="!userInfo.enterprises">