@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.
@@ -33,7 +33,7 @@ import { TranslateModule } from '@ngx-translate/core';
33
33
  import { DragulaService, DragulaModule } from 'ng2-dragula';
34
34
  import { MatDialogRef, MatDialog, DateAdapter, MAT_DATE_LOCALE, MatAutocompleteModule, MatButtonModule, MatButtonToggleModule, MatPaginatorModule, MatCardModule, MatCheckboxModule, MatChipsModule, MatDatepickerModule, MatGridListModule, MatIconModule, MatInputModule, MatListModule, MatMenuModule, MatProgressBarModule, MatProgressSpinnerModule, MatRadioModule, MatSelectModule, MatSidenavModule, MatSliderModule, MatSortModule, MatSlideToggleModule, MatSnackBarModule, MatTableModule, MatTabsModule, MatToolbarModule, MatTooltipModule, MatFormFieldModule, MatExpansionModule, MatStepperModule, MatDialogModule, MatNativeDateModule } from '@angular/material';
35
35
  import { ActivatedRoute, Router } from '@angular/router';
36
- import { Injectable, Component, Input, Output, EventEmitter, Directive, forwardRef, ViewChild, Inject, PLATFORM_ID, ElementRef, Pipe, ViewContainerRef, defineInjectable, NgModule, inject, HostListener } from '@angular/core';
36
+ import { Injectable, Component, Input, Output, EventEmitter, Directive, forwardRef, Inject, PLATFORM_ID, ViewChild, ElementRef, Pipe, ViewContainerRef, defineInjectable, inject, NgModule, HostListener } from '@angular/core';
37
37
  import { Http } from '@angular/http';
38
38
  import { SlimLoadingBarService } from 'ng2-slim-loading-bar';
39
39
  import { ToastrService } from 'ngx-toastr';
@@ -15976,52 +15976,80 @@ var FHGuard = /** @class */ (function () {
15976
15976
  p.sql = "SELECT_USER_ACCESS_AUTH";
15977
15977
  p.values = [];
15978
15978
  p.types = [];
15979
- _this.querys.doQuery(p).subscribe(function (data) {
15980
- if (data != null)
15981
- if (data.result_msg == "OK")
15982
- if (data.result_data.length > 0) {
15983
- console.log('canActivate 6');
15984
- _this.appService.user_roles = data.result_data[0].roles;
15985
- if (_this.appService.user_roles.length > 0)
15986
- _this.appService.user_roles = _this.appService.user_roles.substr(1);
15987
- _this.appService.user_isadmin = data.result_data[0].isadmin;
15988
- _this.appService.user = data.result_data[0].user;
15989
- if (_this.app_s.user_isadmin != null)
15990
- if (_this.app_s.user_isadmin == "1")
15991
- return true;
15992
- console.log('canActivate 7');
15993
- /** @type {?} */
15994
- var p_1 = new QParam();
15995
- p_1.sql = "SELECT_APPS_USER_ALL";
15996
- _this.appService.getState().app_enabled = new Array();
15997
- p_1.types = ['string'];
15998
- p_1.values = [_this.appService.user];
15999
- console.log('canActivate 8');
16000
- _this.querys.doQuery(p_1).subscribe(function (data) {
16001
- console.log('canActivate 9');
16002
- _this.arr_accessi = data.result_data;
16003
- for (var i = 0; i < _this.arr_accessi.length; i++) {
16004
- console.log('[' + _this.arr_accessi[i].url.split('/')[0] + ']', '-----', '[' + _this.routingDestination.split('/')[0] + ']');
16005
- if (_this.arr_accessi[i].type == 'M') {
16006
- if ('[' + _this.arr_accessi[i].url.split('/')[0] + ']' == '[' + _this.routingDestination.split('/')[0] + ']') {
16007
- resolve(true);
16008
- return;
15979
+ if (_this.appService.user == null) {
15980
+ _this.querys.doQuery(p).subscribe(function (data) {
15981
+ if (data != null)
15982
+ if (data.result_msg == "OK")
15983
+ if (data.result_data.length > 0) {
15984
+ console.log('canActivate 6');
15985
+ _this.appService.user_roles = data.result_data[0].roles;
15986
+ if (_this.appService.user_roles.length > 0)
15987
+ _this.appService.user_roles = _this.appService.user_roles.substr(1);
15988
+ _this.appService.user_isadmin = data.result_data[0].isadmin;
15989
+ _this.appService.user = data.result_data[0].username;
15990
+ if (_this.app_s.user_isadmin != null)
15991
+ if (_this.app_s.user_isadmin == "1")
15992
+ return true;
15993
+ /** @type {?} */
15994
+ var p_1 = new QParam();
15995
+ p_1.sql = "SELECT_APPS_USER_ALL";
15996
+ _this.appService.getState().app_enabled = new Array();
15997
+ p_1.types = ['string'];
15998
+ p_1.values = [_this.appService.user];
15999
+ console.log('canActivate 8');
16000
+ _this.querys.doQuery(p_1).subscribe(function (data) {
16001
+ console.log('canActivate 9');
16002
+ _this.arr_accessi = data.result_data;
16003
+ for (var i = 0; i < _this.arr_accessi.length; i++) {
16004
+ console.log('[' + _this.arr_accessi[i].url.split('/')[0] + ']', '-----', '[' + _this.routingDestination.split('/')[0] + ']');
16005
+ if (_this.arr_accessi[i].type == 'M') {
16006
+ if ('[' + _this.arr_accessi[i].url.split('/')[0] + ']' == '[' + _this.routingDestination.split('/')[0] + ']') {
16007
+ resolve(true);
16008
+ return;
16009
+ }
16009
16010
  }
16010
16011
  }
16011
- }
16012
- console.log('canActivate 11');
16013
- _this.toast.error("ACCESS DENIED [0X0001]");
16014
- resolve(false);
16012
+ console.log('canActivate 11');
16013
+ _this.toast.error("ACCESS DENIED [0X0001]");
16014
+ resolve(false);
16015
+ _this.slimLoadingBarService.complete();
16016
+ return;
16017
+ });
16018
+ }
16019
+ else {
16020
+ _this.toast.error("ACCESS DENIED [0X0002]");
16015
16021
  _this.slimLoadingBarService.complete();
16022
+ return false;
16023
+ }
16024
+ });
16025
+ }
16026
+ else {
16027
+ /** @type {?} */
16028
+ var p_2 = new QParam();
16029
+ p_2.sql = "SELECT_APPS_USER_ALL";
16030
+ _this.appService.getState().app_enabled = new Array();
16031
+ p_2.types = ['string'];
16032
+ p_2.values = [_this.appService.user];
16033
+ console.log('canActivate 8');
16034
+ _this.querys.doQuery(p_2).subscribe(function (data) {
16035
+ console.log('canActivate 9');
16036
+ _this.arr_accessi = data.result_data;
16037
+ for (var i = 0; i < _this.arr_accessi.length; i++) {
16038
+ console.log('[' + _this.arr_accessi[i].url.split('/')[0] + ']', '-----', '[' + _this.routingDestination.split('/')[0] + ']');
16039
+ if (_this.arr_accessi[i].type == 'M') {
16040
+ if ('[' + _this.arr_accessi[i].url.split('/')[0] + ']' == '[' + _this.routingDestination.split('/')[0] + ']') {
16041
+ resolve(true);
16016
16042
  return;
16017
- });
16018
- }
16019
- else {
16020
- _this.toast.error("ACCESS DENIED [0X0002]");
16021
- _this.slimLoadingBarService.complete();
16022
- return false;
16043
+ }
16023
16044
  }
16024
- });
16045
+ }
16046
+ console.log('canActivate 11');
16047
+ _this.toast.error("ACCESS DENIED [0X0001]");
16048
+ resolve(false);
16049
+ _this.slimLoadingBarService.complete();
16050
+ return;
16051
+ });
16052
+ }
16025
16053
  });
16026
16054
  console.log('canActivate 12');
16027
16055
  }