@fluxhub/fluxhub-lib 1.0.197 → 1.0.198

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13653,52 +13653,80 @@
13653
13653
  p.sql = "SELECT_USER_ACCESS_AUTH";
13654
13654
  p.values = [];
13655
13655
  p.types = [];
13656
- _this.querys.doQuery(p).subscribe(function (data) {
13657
- if (data != null)
13658
- if (data.result_msg == "OK")
13659
- if (data.result_data.length > 0) {
13660
- console.log('canActivate 6');
13661
- _this.appService.user_roles = data.result_data[0].roles;
13662
- if (_this.appService.user_roles.length > 0)
13663
- _this.appService.user_roles = _this.appService.user_roles.substr(1);
13664
- _this.appService.user_isadmin = data.result_data[0].isadmin;
13665
- _this.appService.user = data.result_data[0].user;
13666
- if (_this.app_s.user_isadmin != null)
13667
- if (_this.app_s.user_isadmin == "1")
13668
- return true;
13669
- console.log('canActivate 7');
13670
- /** @type {?} */
13671
- var p_1 = new QParam();
13672
- p_1.sql = "SELECT_APPS_USER_ALL";
13673
- _this.appService.getState().app_enabled = new Array();
13674
- p_1.types = ['string'];
13675
- p_1.values = [_this.appService.user];
13676
- console.log('canActivate 8');
13677
- _this.querys.doQuery(p_1).subscribe(function (data) {
13678
- console.log('canActivate 9');
13679
- _this.arr_accessi = data.result_data;
13680
- for (var i = 0; i < _this.arr_accessi.length; i++) {
13681
- console.log('[' + _this.arr_accessi[i].url.split('/')[0] + ']', '-----', '[' + _this.routingDestination.split('/')[0] + ']');
13682
- if (_this.arr_accessi[i].type == 'M') {
13683
- if ('[' + _this.arr_accessi[i].url.split('/')[0] + ']' == '[' + _this.routingDestination.split('/')[0] + ']') {
13684
- resolve(true);
13685
- return;
13656
+ if (_this.appService.user == null) {
13657
+ _this.querys.doQuery(p).subscribe(function (data) {
13658
+ if (data != null)
13659
+ if (data.result_msg == "OK")
13660
+ if (data.result_data.length > 0) {
13661
+ console.log('canActivate 6');
13662
+ _this.appService.user_roles = data.result_data[0].roles;
13663
+ if (_this.appService.user_roles.length > 0)
13664
+ _this.appService.user_roles = _this.appService.user_roles.substr(1);
13665
+ _this.appService.user_isadmin = data.result_data[0].isadmin;
13666
+ _this.appService.user = data.result_data[0].username;
13667
+ if (_this.app_s.user_isadmin != null)
13668
+ if (_this.app_s.user_isadmin == "1")
13669
+ return true;
13670
+ /** @type {?} */
13671
+ var p_1 = new QParam();
13672
+ p_1.sql = "SELECT_APPS_USER_ALL";
13673
+ _this.appService.getState().app_enabled = new Array();
13674
+ p_1.types = ['string'];
13675
+ p_1.values = [_this.appService.user];
13676
+ console.log('canActivate 8');
13677
+ _this.querys.doQuery(p_1).subscribe(function (data) {
13678
+ console.log('canActivate 9');
13679
+ _this.arr_accessi = data.result_data;
13680
+ for (var i = 0; i < _this.arr_accessi.length; i++) {
13681
+ console.log('[' + _this.arr_accessi[i].url.split('/')[0] + ']', '-----', '[' + _this.routingDestination.split('/')[0] + ']');
13682
+ if (_this.arr_accessi[i].type == 'M') {
13683
+ if ('[' + _this.arr_accessi[i].url.split('/')[0] + ']' == '[' + _this.routingDestination.split('/')[0] + ']') {
13684
+ resolve(true);
13685
+ return;
13686
+ }
13686
13687
  }
13687
13688
  }
13688
- }
13689
- console.log('canActivate 11');
13690
- _this.toast.error("ACCESS DENIED [0X0001]");
13691
- resolve(false);
13689
+ console.log('canActivate 11');
13690
+ _this.toast.error("ACCESS DENIED [0X0001]");
13691
+ resolve(false);
13692
+ _this.slimLoadingBarService.complete();
13693
+ return;
13694
+ });
13695
+ }
13696
+ else {
13697
+ _this.toast.error("ACCESS DENIED [0X0002]");
13692
13698
  _this.slimLoadingBarService.complete();
13699
+ return false;
13700
+ }
13701
+ });
13702
+ }
13703
+ else {
13704
+ /** @type {?} */
13705
+ var p_2 = new QParam();
13706
+ p_2.sql = "SELECT_APPS_USER_ALL";
13707
+ _this.appService.getState().app_enabled = new Array();
13708
+ p_2.types = ['string'];
13709
+ p_2.values = [_this.appService.user];
13710
+ console.log('canActivate 8');
13711
+ _this.querys.doQuery(p_2).subscribe(function (data) {
13712
+ console.log('canActivate 9');
13713
+ _this.arr_accessi = data.result_data;
13714
+ for (var i = 0; i < _this.arr_accessi.length; i++) {
13715
+ console.log('[' + _this.arr_accessi[i].url.split('/')[0] + ']', '-----', '[' + _this.routingDestination.split('/')[0] + ']');
13716
+ if (_this.arr_accessi[i].type == 'M') {
13717
+ if ('[' + _this.arr_accessi[i].url.split('/')[0] + ']' == '[' + _this.routingDestination.split('/')[0] + ']') {
13718
+ resolve(true);
13693
13719
  return;
13694
- });
13695
- }
13696
- else {
13697
- _this.toast.error("ACCESS DENIED [0X0002]");
13698
- _this.slimLoadingBarService.complete();
13699
- return false;
13720
+ }
13700
13721
  }
13701
- });
13722
+ }
13723
+ console.log('canActivate 11');
13724
+ _this.toast.error("ACCESS DENIED [0X0001]");
13725
+ resolve(false);
13726
+ _this.slimLoadingBarService.complete();
13727
+ return;
13728
+ });
13729
+ }
13702
13730
  });
13703
13731
  console.log('canActivate 12');
13704
13732
  }