Browse Source

如果账户安全等级不够,则不跳至开店申请页面

yangc 7 years ago
parent
commit
d49b355f1f
1 changed files with 8 additions and 3 deletions
  1. 8 3
      src/main/webapp/resources/js/vendor/app.js

+ 8 - 3
src/main/webapp/resources/js/vendor/app.js

@@ -639,10 +639,9 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 		}
 	});
 
-	app.run(['$rootScope', '$state', '$q', 'BaseService', 'StoreInfo', '$location', function($rootScope, $state, $q, BaseService, StoreInfo, $location) {
+	app.run(['$rootScope', '$state', '$q', 'BaseService', 'StoreInfo', '$location', 'AuthenticationService', 'toaster', function($rootScope, $state, $q, BaseService, StoreInfo, $location, AuthenticationService, toaster) {
 		$rootScope.rootPath = BaseService.getRootPath();
 		$rootScope.page = 'vendor';// 导航栏状态,'个人中心'状态激活
-
 		var getToStateName = function () {
 			if ($rootScope.store && (!$rootScope.store.status || $rootScope.store.status === 'OPENED')) {
 				return 'vendor_store_maintain';
@@ -690,7 +689,13 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 			}
 
 			if ($rootScope.applyStatus === 'NONE' && $location.$$path === '/index') {
-				$state.go('vendor_store_apply');
+                AuthenticationService.getAuthentication().success(function (data) {
+                    if (!(!data.pwdEnable || !data.haveUserQuestion||!data.emailValidCode || data.emailValidCode != 2)) {
+                        $state.go('vendor_store_apply');
+                    }
+                }).error(function (error) {
+                    toaster.pop('error', '获取登录信息失败');
+                })
 			}
 
 			$rootScope.$on('$stateChangeStart', function (event, toState) {