info-library 2.14.13-beta.3 → 2.14.13-beta.4
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.
- package/esm2020/layouts/main/main.component.mjs +2 -7
- package/esm2020/model/platform.model.mjs +1 -3
- package/esm2020/service/authentication.service.mjs +12 -92
- package/fesm2015/info-library.mjs +12 -99
- package/fesm2015/info-library.mjs.map +1 -1
- package/fesm2020/info-library.mjs +12 -99
- package/fesm2020/info-library.mjs.map +1 -1
- package/layouts/main/main.component.d.ts +1 -2
- package/model/platform.model.d.ts +0 -2
- package/package.json +1 -1
|
@@ -263,8 +263,6 @@ class InfoPlatformModel {
|
|
|
263
263
|
this.ModoPrime = false;
|
|
264
264
|
this.PaginaLimpa = false;
|
|
265
265
|
this.Menu = [];
|
|
266
|
-
this.AppApi = null;
|
|
267
|
-
this.LoggedUserApi = null;
|
|
268
266
|
this.ShortcutApi = null;
|
|
269
267
|
}
|
|
270
268
|
setConfig(config) {
|
|
@@ -1051,86 +1049,43 @@ class InfoAuthenticationService {
|
|
|
1051
1049
|
}
|
|
1052
1050
|
login(usuario, senha, reCaptchaToken = null, codigo2FA = null) {
|
|
1053
1051
|
this.removeSessao();
|
|
1054
|
-
return this._dataService.postNoToken(
|
|
1052
|
+
return this._dataService.postNoToken('CentroControle_Usuario', { Usuario: usuario, Senha: senha, ReCaptchaToken: reCaptchaToken, Codigo2FA: codigo2FA }, 'Autenticar')
|
|
1055
1053
|
.pipe(map((r) => {
|
|
1056
1054
|
if (r.success && r.data != null)
|
|
1057
1055
|
this._utilities.setLocalStorage(this._plataforma.TokenKey, r.data.Token);
|
|
1058
1056
|
return r;
|
|
1059
1057
|
}), catchError((e) => this.errorHandling(e)));
|
|
1060
|
-
// return this._http
|
|
1061
|
-
// .post(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/autenticar', { Usuario: usuario, Senha: senha, ReCaptchaToken: reCaptchaToken, Codigo2FA: codigo2FA })
|
|
1062
|
-
// .pipe(
|
|
1063
|
-
// map((r: any) => {
|
|
1064
|
-
// if (r.Success && r.Data != null)
|
|
1065
|
-
// this._utilities.setLocalStorage(this._plataforma.TokenKey, r.Data.Token);
|
|
1066
|
-
// return new InfoLoginModel(r.Success, r.Messages, r.Data);
|
|
1067
|
-
// }),
|
|
1068
|
-
// catchError((e: HttpErrorResponse) => this.errorHandling(e))
|
|
1069
|
-
// );
|
|
1070
1058
|
}
|
|
1071
1059
|
trocarEmpresa(usuario, empresaId) {
|
|
1072
|
-
return this._dataService.post(
|
|
1060
|
+
return this._dataService.post('CentroControle_Usuario', { EmpresaId: empresaId }, 'TrocarEmpresa')
|
|
1073
1061
|
.pipe(map((r) => {
|
|
1074
1062
|
if (r.success && r.data != null)
|
|
1075
1063
|
this._utilities.setLocalStorage(this._plataforma.TokenKey, r.data);
|
|
1076
1064
|
return r;
|
|
1077
1065
|
}), catchError((e) => this.errorHandling(e)));
|
|
1078
|
-
// this._http
|
|
1079
|
-
// .post(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/trocarempresa', { EmpresaId: empresaId }, { headers: this._dataService.getHeaderToken() })
|
|
1080
|
-
// .pipe(
|
|
1081
|
-
// map((r: any) => {
|
|
1082
|
-
// if (r.Success && r.Data != null)
|
|
1083
|
-
// this._utilities.setLocalStorage(this._plataforma.TokenKey, r.Data);
|
|
1084
|
-
// return new InfoLoginModel(r.Success, r.Messages, r.Data);
|
|
1085
|
-
// }),
|
|
1086
|
-
// catchError((e: HttpErrorResponse) => this.errorHandling(e))
|
|
1087
|
-
// );
|
|
1088
1066
|
}
|
|
1089
1067
|
trocarUnidade(usuario, empresaId, unidadeId) {
|
|
1090
|
-
return this._dataService.post(
|
|
1068
|
+
return this._dataService.post('CentroControle_Usuario', { EmpresaId: empresaId, UnidadeId: unidadeId }, 'TrocarUnidade')
|
|
1091
1069
|
.pipe(map((r) => {
|
|
1092
1070
|
if (r.success && r.data != null)
|
|
1093
1071
|
this._utilities.setLocalStorage(this._plataforma.TokenKey, r.data);
|
|
1094
1072
|
return r;
|
|
1095
1073
|
}), catchError((e) => this.errorHandling(e)));
|
|
1096
|
-
// return this._http
|
|
1097
|
-
// .post(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/trocarunidade', { EmpresaId: empresaId, UnidadeId: unidadeId }, { headers: this._dataService.getHeaderToken() })
|
|
1098
|
-
// .pipe(
|
|
1099
|
-
// map((r: any) => {
|
|
1100
|
-
// if (r.Success && r.Data != null)
|
|
1101
|
-
// this._utilities.setLocalStorage(this._plataforma.TokenKey, r.Data);
|
|
1102
|
-
// return new InfoLoginModel(r.Success, r.Messages, r.Data);
|
|
1103
|
-
// }),
|
|
1104
|
-
// catchError((e: HttpErrorResponse) => this.errorHandling(e))
|
|
1105
|
-
// );
|
|
1106
1074
|
}
|
|
1107
1075
|
clonar(usuario) {
|
|
1108
|
-
return this._dataService.post(
|
|
1076
|
+
return this._dataService.post('CentroControle_Usuario', { Usuario: usuario }, 'Clonar')
|
|
1109
1077
|
.pipe(map((r) => {
|
|
1110
1078
|
if (r.success && r.data != null)
|
|
1111
1079
|
this._utilities.setLocalStorage(this._plataforma.TokenKey, r.data);
|
|
1112
1080
|
return r;
|
|
1113
1081
|
}), catchError((e) => this.errorHandling(e)));
|
|
1114
|
-
// return this._http
|
|
1115
|
-
// .post(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/clonar', { Usuario: usuario }, { headers: this._dataService.getHeaderToken() })
|
|
1116
|
-
// .pipe(
|
|
1117
|
-
// map((r: any) => {
|
|
1118
|
-
// if (r.Success && r.Data != null)
|
|
1119
|
-
// this._utilities.setLocalStorage(this._plataforma.TokenKey, r.Data);
|
|
1120
|
-
// return new InfoLoginModel(r.Success, r.Messages, r.Data);
|
|
1121
|
-
// }),
|
|
1122
|
-
// catchError((e: HttpErrorResponse) => this.errorHandling(e))
|
|
1123
|
-
// );
|
|
1124
1082
|
}
|
|
1125
1083
|
logout() {
|
|
1126
1084
|
if (this.isLogged()) {
|
|
1127
|
-
this._dataService.post(
|
|
1085
|
+
this._dataService.post('CentroControle_Usuario', 'Logout').subscribe(r => {
|
|
1128
1086
|
this.removeSessao();
|
|
1129
1087
|
this._router.navigateByUrl('login').then(r => { location.reload(); });
|
|
1130
1088
|
});
|
|
1131
|
-
// this._http.post(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/Logout', null, { headers: this._dataService.getHeaderToken() })
|
|
1132
|
-
// .subscribe(() => {
|
|
1133
|
-
// });
|
|
1134
1089
|
}
|
|
1135
1090
|
else {
|
|
1136
1091
|
this.removeSessao();
|
|
@@ -1138,55 +1093,24 @@ class InfoAuthenticationService {
|
|
|
1138
1093
|
}
|
|
1139
1094
|
}
|
|
1140
1095
|
getPermissions(url, logAtividade = false) {
|
|
1141
|
-
return this._dataService.get(
|
|
1096
|
+
return this._dataService.get('CentroControle_Usuario', 'GetPermissao', `url=${url}&logatividade=${logAtividade.toString()}`)
|
|
1142
1097
|
.pipe(map((r) => r), catchError((e) => this.errorHandling(e)));
|
|
1143
|
-
// return this._http
|
|
1144
|
-
// .get(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/getpermissao?url=' + url + '&logatividade=' + logAtividade.toString(), { headers: this._dataService.getHeaderToken() })
|
|
1145
|
-
// .pipe(
|
|
1146
|
-
// map((r: any) => new InfoLoginModel(r.Success, r.Messages, r.Data)),
|
|
1147
|
-
// catchError((e: HttpErrorResponse) => this.errorHandling(e))
|
|
1148
|
-
// );
|
|
1149
1098
|
}
|
|
1150
1099
|
setTrocaSenha(model) {
|
|
1151
|
-
return this._dataService.post(
|
|
1100
|
+
return this._dataService.post('CentroControle_Usuario', model, 'TrocarSenha')
|
|
1152
1101
|
.pipe(map((r) => r), catchError((e) => this.errorHandling(e)));
|
|
1153
|
-
// return this._http
|
|
1154
|
-
// .post(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/TrocarSenha', model, { headers: this._dataService.getHeaderToken() })
|
|
1155
|
-
// .pipe(
|
|
1156
|
-
// map((r: any) => new InfoLoginModel(r.Success, r.Messages, r.Data)),
|
|
1157
|
-
// catchError((e: HttpErrorResponse) => this.errorHandling(e))
|
|
1158
|
-
// );
|
|
1159
1102
|
}
|
|
1160
1103
|
setRecuperarSenha(model) {
|
|
1161
|
-
return this._dataService.post(
|
|
1104
|
+
return this._dataService.post('CentroControle_Usuario', model, 'RecuperarSenha')
|
|
1162
1105
|
.pipe(map((r) => r), catchError((e) => this.errorHandling(e)));
|
|
1163
|
-
// return this._http
|
|
1164
|
-
// .post(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/RecuperarSenha', model, { headers: this._dataService.getHeaderToken() })
|
|
1165
|
-
// .pipe(
|
|
1166
|
-
// map((r: any) => new InfoLoginModel(r.Success, r.Messages, r.Data)),
|
|
1167
|
-
// catchError((e: HttpErrorResponse) => this.errorHandling(e))
|
|
1168
|
-
// );
|
|
1169
1106
|
}
|
|
1170
1107
|
setResetarSenha(model) {
|
|
1171
|
-
return this._dataService.postNoToken(
|
|
1108
|
+
return this._dataService.postNoToken('CentroControle_Usuario', model, 'ResetarSenha')
|
|
1172
1109
|
.pipe(map((r) => r), catchError((e) => this.errorHandling(e)));
|
|
1173
|
-
// return this._http
|
|
1174
|
-
// .post(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/ResetarSenha', model)
|
|
1175
|
-
// .pipe(
|
|
1176
|
-
// map((r: any) => new InfoLoginModel(r.Success, r.Messages, r.Data)),
|
|
1177
|
-
// catchError((e: HttpErrorResponse) => this.errorHandling(e))
|
|
1178
|
-
// );
|
|
1179
1110
|
}
|
|
1180
1111
|
getLoginResources() {
|
|
1181
|
-
|
|
1182
|
-
return this._dataService.getNoToken(this._plataforma.AppApi, 'GetLoginResources')
|
|
1112
|
+
return this._dataService.getNoToken('CentroControle_App', 'GetLoginResources')
|
|
1183
1113
|
.pipe(map((r) => r), catchError((e) => this.errorHandling(e)));
|
|
1184
|
-
// return this._http
|
|
1185
|
-
// .get(this._plataforma.Config.webapiUrl + this._plataforma.AppApi + '/GetLoginResources')
|
|
1186
|
-
// .pipe(
|
|
1187
|
-
// map((r: any) => new InfoLoginModel(r.Success, r.Messages, r.Data)),
|
|
1188
|
-
// catchError((e: HttpErrorResponse) => this.errorHandling(e))
|
|
1189
|
-
// );
|
|
1190
1114
|
}
|
|
1191
1115
|
hasPermission(url, keyFunction = 'view') {
|
|
1192
1116
|
if (url == '/' && keyFunction == 'view')
|
|
@@ -1239,14 +1163,8 @@ class InfoAuthenticationService {
|
|
|
1239
1163
|
}
|
|
1240
1164
|
}
|
|
1241
1165
|
validaSessao(url) {
|
|
1242
|
-
return this._dataService.get(
|
|
1166
|
+
return this._dataService.get('CentroControle_Usuario', 'ValidaSessao', `url=${url}`)
|
|
1243
1167
|
.pipe(map((r) => new InfoLoginModel(r === true, '', r)), catchError((e) => this.errorHandling(e)));
|
|
1244
|
-
// return this._http
|
|
1245
|
-
// .get(this._plataforma.Config.webapiUrl + this._plataforma.LoggedUserApi + '/validasessao?url=' + url, { headers: this._dataService.getHeaderToken() })
|
|
1246
|
-
// .pipe(
|
|
1247
|
-
// map((r: any) => new InfoLoginModel(r === true, '', r)),
|
|
1248
|
-
// catchError((e: HttpErrorResponse) => this.errorHandling(e))
|
|
1249
|
-
// );
|
|
1250
1168
|
}
|
|
1251
1169
|
removeSessao() {
|
|
1252
1170
|
Object.keys(localStorage).forEach((key) => {
|
|
@@ -8189,7 +8107,6 @@ class InfoMainComponent {
|
|
|
8189
8107
|
this.menuapi = null;
|
|
8190
8108
|
this.menumethod = 'GetMenu';
|
|
8191
8109
|
this.activemenubyurl = false;
|
|
8192
|
-
this.appapi = 'CentroControle_App';
|
|
8193
8110
|
this.loggeduserapi = null;
|
|
8194
8111
|
this.loggedusermethod = 'GetLoggedUser';
|
|
8195
8112
|
this.notificationapi = null;
|
|
@@ -8218,8 +8135,6 @@ class InfoMainComponent {
|
|
|
8218
8135
|
this._renderer.addClass(this._element.nativeElement, 'topmenu');
|
|
8219
8136
|
this._platform.Themes = this.themes;
|
|
8220
8137
|
this._platform.ShortcutApi = this.shortcutapi;
|
|
8221
|
-
this._platform.LoggedUserApi = this.loggeduserapi;
|
|
8222
|
-
this._platform.AppApi = this.appapi;
|
|
8223
8138
|
if (this._utilities.getLocalStorage(this._platform.TokenKey) == null)
|
|
8224
8139
|
this._router.navigateByUrl(this.loginurl);
|
|
8225
8140
|
else
|
|
@@ -8297,7 +8212,7 @@ class InfoMainComponent {
|
|
|
8297
8212
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.sidebar = _t.first);
|
|
8298
8213
|
} }, hostBindings: function InfoMainComponent_HostBindings(rf, ctx) { if (rf & 1) {
|
|
8299
8214
|
i0.ɵɵlistener("click", function InfoMainComponent_click_HostBindingHandler($event) { return ctx.onClick($event.target); }, false, i0.ɵɵresolveDocument);
|
|
8300
|
-
} }, inputs: { opened: "opened", version: "version", messages: "messages", enabledia: "enabledia", themes: "themes", languages: "languages", profileurl: "profileurl", loginurl: "loginurl", menuapi: "menuapi", menumethod: "menumethod", activemenubyurl: "activemenubyurl",
|
|
8215
|
+
} }, inputs: { opened: "opened", version: "version", messages: "messages", enabledia: "enabledia", themes: "themes", languages: "languages", profileurl: "profileurl", loginurl: "loginurl", menuapi: "menuapi", menumethod: "menumethod", activemenubyurl: "activemenubyurl", loggeduserapi: "loggeduserapi", loggedusermethod: "loggedusermethod", notificationapi: "notificationapi", notificationgetmethod: "notificationgetmethod", notificationpostmethod: "notificationpostmethod", notificationverifymethod: "notificationverifymethod", notificationverifyenabled: "notificationverifyenabled", fastsearchform: "fastsearchform", fastsearchformwidth: "fastsearchformwidth", fastsearchtitle: "fastsearchtitle", setthemeonchangecompany: "setthemeonchangecompany", shortcutapi: "shortcutapi" }, outputs: { ongetnotification: "ongetnotification", onverifynotification: "onverifynotification" }, ngContentSelectors: _c4, decls: 15, vars: 23, consts: [[1, "site-container", 3, "ngClass"], [3, "themes", "languages", "profileurl", "notificationapi", "notificationgetmethod", "notificationpostmethod", "notificationverifymethod", "notificationverifyenabled", "fastsearchform", "fastsearchformwidth", "fastsearchtitle", "setthemeonchangecompany", "enabledia", "onchangestate", "ongetnotification", "onverifynotification"], ["topbar", ""], [3, "api", "method", "onchangestate", 4, "ngIf"], [3, "api", "method", "activemenubyurl", "onchangestate", 4, "ngIf"], [1, "main-content"], [1, "main-content-wrap"], [1, "footer", "row"], [1, "copyright", "col-9"], ["class", "version col-3", 4, "ngIf"], [3, "messages"], [3, "api", "method", "onchangestate"], [3, "api", "method", "activemenubyurl", "onchangestate"], ["sidebar", ""], [1, "version", "col-3"]], template: function InfoMainComponent_Template(rf, ctx) { if (rf & 1) {
|
|
8301
8216
|
i0.ɵɵprojectionDef(_c2);
|
|
8302
8217
|
i0.ɵɵelementStart(0, "div", 0)(1, "info-topbar", 1, 2);
|
|
8303
8218
|
i0.ɵɵlistener("onchangestate", function InfoMainComponent_Template_info_topbar_onchangestate_1_listener() { return ctx.onChangeTopBarState(); })("ongetnotification", function InfoMainComponent_Template_info_topbar_ongetnotification_1_listener($event) { return ctx.onGetNotificationsTopBar($event); })("onverifynotification", function InfoMainComponent_Template_info_topbar_onverifynotification_1_listener($event) { return ctx.onVerifyNotificationsTopBar($event); });
|
|
@@ -8356,8 +8271,6 @@ class InfoMainComponent {
|
|
|
8356
8271
|
type: Input
|
|
8357
8272
|
}], activemenubyurl: [{
|
|
8358
8273
|
type: Input
|
|
8359
|
-
}], appapi: [{
|
|
8360
|
-
type: Input
|
|
8361
8274
|
}], loggeduserapi: [{
|
|
8362
8275
|
type: Input
|
|
8363
8276
|
}], loggedusermethod: [{
|