@rolatech/angular-auth 19.0.0-beta.9 → 19.1.0-beta.3
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/fesm2022/rolatech-angular-auth.mjs +106 -43
- package/fesm2022/rolatech-angular-auth.mjs.map +1 -1
- package/index.d.ts +262 -9
- package/lib/interceptors/error.interceptor.d.ts +1 -1
- package/lib/interfaces/auth.interface.d.ts +2 -0
- package/lib/services/auth-agent.service.d.ts +17 -0
- package/lib/services/auth-user.service.d.ts +40 -0
- package/lib/services/auth.service.d.ts +1 -0
- package/lib/services/index.d.ts +3 -2
- package/lib/services/storage.service.d.ts +3 -3
- package/package.json +1 -1
- package/themes/_default.scss +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, signal, computed, Injectable, inject, output, model, PLATFORM_ID, makeEnvironmentProviders } from '@angular/core';
|
|
2
|
+
import { Component, signal, computed, Injectable, inject, output, model, PLATFORM_ID, LOCALE_ID, makeEnvironmentProviders } from '@angular/core';
|
|
3
3
|
import { MatDialogRef, MAT_DIALOG_DATA, MatDialogModule, MatDialog } from '@angular/material/dialog';
|
|
4
4
|
import { APP_CONFIG, AngularCommonModule } from '@rolatech/angular-common';
|
|
5
5
|
import { SnackBarService } from '@rolatech/angular-services';
|
|
@@ -17,19 +17,19 @@ import { of, map as map$1, BehaviorSubject, catchError, throwError, NEVER } from
|
|
|
17
17
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
18
18
|
|
|
19
19
|
class ForbiddenComponent {
|
|
20
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
21
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
20
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: ForbiddenComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
21
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.3", type: ForbiddenComponent, isStandalone: true, selector: "rolatech-forbidden", ngImport: i0, template: "<div class=\"p-6 max-w-lg h-auto max-h-32\">\n <div class=\"flex flex-col\">\n <b>403.</b>\n <p>Forbidden page.</p>\n </div>\n</div>\n", styles: [""] });
|
|
22
22
|
}
|
|
23
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: ForbiddenComponent, decorators: [{
|
|
24
24
|
type: Component,
|
|
25
25
|
args: [{ selector: 'rolatech-forbidden', template: "<div class=\"p-6 max-w-lg h-auto max-h-32\">\n <div class=\"flex flex-col\">\n <b>403.</b>\n <p>Forbidden page.</p>\n </div>\n</div>\n" }]
|
|
26
26
|
}] });
|
|
27
27
|
|
|
28
28
|
class UnauthorizedComponent {
|
|
29
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
30
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
29
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UnauthorizedComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
30
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.3", type: UnauthorizedComponent, isStandalone: true, selector: "rolatech-unauthorized", ngImport: i0, template: "<div class=\"p-6 max-w-lg h-auto max-h-32\">\n <div class=\"flex flex-col\">\n <b>401.</b>\n <p>Unauthorized page.</p>\n </div>\n</div>\n", styles: [""] });
|
|
31
31
|
}
|
|
32
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: UnauthorizedComponent, decorators: [{
|
|
33
33
|
type: Component,
|
|
34
34
|
args: [{ selector: 'rolatech-unauthorized', template: "<div class=\"p-6 max-w-lg h-auto max-h-32\">\n <div class=\"flex flex-col\">\n <b>401.</b>\n <p>Unauthorized page.</p>\n </div>\n</div>\n" }]
|
|
35
35
|
}] });
|
|
@@ -75,10 +75,10 @@ class AuthStore {
|
|
|
75
75
|
return { ...state };
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
79
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
78
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AuthStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
79
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AuthStore, providedIn: 'root' });
|
|
80
80
|
}
|
|
81
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AuthStore, decorators: [{
|
|
82
82
|
type: Injectable,
|
|
83
83
|
args: [{ providedIn: 'root' }]
|
|
84
84
|
}] });
|
|
@@ -163,6 +163,16 @@ class AuthService {
|
|
|
163
163
|
return res.data;
|
|
164
164
|
}));
|
|
165
165
|
}
|
|
166
|
+
signup(data) {
|
|
167
|
+
return this.http
|
|
168
|
+
.post(`${this.environment.baseUrl}/auth/signup`, data, {
|
|
169
|
+
withCredentials: true,
|
|
170
|
+
})
|
|
171
|
+
.pipe(map((res) => {
|
|
172
|
+
this.authStore.updateAuthenticated(true);
|
|
173
|
+
return res;
|
|
174
|
+
}));
|
|
175
|
+
}
|
|
166
176
|
logout() {
|
|
167
177
|
return this.http
|
|
168
178
|
.get(`${this.environment.baseUrl}/auth/logout`, {
|
|
@@ -207,10 +217,10 @@ class AuthService {
|
|
|
207
217
|
this.authStore.updateAuthenticated(true);
|
|
208
218
|
}));
|
|
209
219
|
}
|
|
210
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
211
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
220
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
221
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AuthService, providedIn: 'root' });
|
|
212
222
|
}
|
|
213
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
223
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AuthService, decorators: [{
|
|
214
224
|
type: Injectable,
|
|
215
225
|
args: [{ providedIn: 'root' }]
|
|
216
226
|
}] });
|
|
@@ -269,10 +279,10 @@ class FaceidDetectDialogComponent {
|
|
|
269
279
|
console.error(err);
|
|
270
280
|
}
|
|
271
281
|
}
|
|
272
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
273
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
282
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: FaceidDetectDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
283
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: FaceidDetectDialogComponent, isStandalone: true, selector: "rolatech-faceid-detect-dialog", outputs: { output: "output" }, ngImport: i0, template: "<div class=\"flex flex-col p-3 max-w-[500px] mx-auto\">\n <div class=\"w-[256px] h-[256px] mx-auto flex justify-center items-center\">\n @if (loading) {\n <div>\n <rolatech-spinner></rolatech-spinner>\n </div>\n }\n <img [src]=\"qrcodeUrl\" alt />\n </div>\n</div>\n", styles: ["*{margin:0;padding:0}.normalPanel .panelContent{width:188px;height:188px}.normalPanel .wrp_code{position:relative;width:188px;height:188px;margin:0}.impowerBox .title,.normalPanel .info{display:none}.impowerBox .qrcode{margin-top:0;border:0;width:188px;height:188px}#MAXIM{content:\"veg20170418191511\"}mat-mdc-dialog-content mdc-dialog__content{padding:0}\n"], dependencies: [{ kind: "component", type: SpinnerComponent, selector: "rolatech-spinner", inputs: ["title"] }, { kind: "ngmodule", type: MatButtonModule }] });
|
|
274
284
|
}
|
|
275
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
285
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: FaceidDetectDialogComponent, decorators: [{
|
|
276
286
|
type: Component,
|
|
277
287
|
args: [{ selector: 'rolatech-faceid-detect-dialog', imports: [SpinnerComponent, MatButtonModule], template: "<div class=\"flex flex-col p-3 max-w-[500px] mx-auto\">\n <div class=\"w-[256px] h-[256px] mx-auto flex justify-center items-center\">\n @if (loading) {\n <div>\n <rolatech-spinner></rolatech-spinner>\n </div>\n }\n <img [src]=\"qrcodeUrl\" alt />\n </div>\n</div>\n", styles: ["*{margin:0;padding:0}.normalPanel .panelContent{width:188px;height:188px}.normalPanel .wrp_code{position:relative;width:188px;height:188px;margin:0}.impowerBox .title,.normalPanel .info{display:none}.impowerBox .qrcode{margin-top:0;border:0;width:188px;height:188px}#MAXIM{content:\"veg20170418191511\"}mat-mdc-dialog-content mdc-dialog__content{padding:0}\n"] }]
|
|
278
288
|
}], ctorParameters: () => [] });
|
|
@@ -301,17 +311,18 @@ class AddressComponent {
|
|
|
301
311
|
ngDoCheck() {
|
|
302
312
|
this.output.emit(this.address());
|
|
303
313
|
}
|
|
304
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
305
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
314
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AddressComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
315
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.3", type: AddressComponent, isStandalone: true, selector: "rolatech-address", inputs: { address: { classPropertyName: "address", publicName: "address", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { address: "addressChange", output: "output" }, ngImport: i0, template: "<div>\n <mat-form-field appearance=\"fill\">\n <mat-label i18n> Name </mat-label>\n <input matInput [(ngModel)]=\"address().name\" />\n </mat-form-field>\n @if (address().type === addressType.BILLING) {\n <mat-form-field appearance=\"fill\">\n <mat-label i18n> Email </mat-label>\n <input matInput [(ngModel)]=\"address().email\" />\n </mat-form-field>\n }\n <mat-form-field appearance=\"fill\">\n <mat-label i18n> Phone </mat-label>\n <input matInput [(ngModel)]=\"address().phone\" />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label i18n> province </mat-label>\n <input matInput [(ngModel)]=\"address().province\" />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label i18n> City </mat-label>\n <input matInput [(ngModel)]=\"address().city\" />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label i18n> District </mat-label>\n <input matInput [(ngModel)]=\"address().district\" />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label i18n> Street </mat-label>\n <input matInput [(ngModel)]=\"address().street\" />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label i18n> Detail </mat-label>\n <input matInput [(ngModel)]=\"address().detail\" />\n </mat-form-field>\n</div>\n", styles: ["mat-form-field{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: AngularCommonModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AngularComponentsModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }] });
|
|
306
316
|
}
|
|
307
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
317
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AddressComponent, decorators: [{
|
|
308
318
|
type: Component,
|
|
309
|
-
args: [{ selector: 'rolatech-address', imports: [AngularCommonModule, AngularComponentsModule], template: "<div>\n <mat-form-field appearance=\"fill\">\n <mat-label>
|
|
319
|
+
args: [{ selector: 'rolatech-address', imports: [AngularCommonModule, AngularComponentsModule], template: "<div>\n <mat-form-field appearance=\"fill\">\n <mat-label i18n> Name </mat-label>\n <input matInput [(ngModel)]=\"address().name\" />\n </mat-form-field>\n @if (address().type === addressType.BILLING) {\n <mat-form-field appearance=\"fill\">\n <mat-label i18n> Email </mat-label>\n <input matInput [(ngModel)]=\"address().email\" />\n </mat-form-field>\n }\n <mat-form-field appearance=\"fill\">\n <mat-label i18n> Phone </mat-label>\n <input matInput [(ngModel)]=\"address().phone\" />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label i18n> province </mat-label>\n <input matInput [(ngModel)]=\"address().province\" />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label i18n> City </mat-label>\n <input matInput [(ngModel)]=\"address().city\" />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label i18n> District </mat-label>\n <input matInput [(ngModel)]=\"address().district\" />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label i18n> Street </mat-label>\n <input matInput [(ngModel)]=\"address().street\" />\n </mat-form-field>\n <mat-form-field appearance=\"fill\">\n <mat-label i18n> Detail </mat-label>\n <input matInput [(ngModel)]=\"address().detail\" />\n </mat-form-field>\n</div>\n", styles: ["mat-form-field{width:100%}\n"] }]
|
|
310
320
|
}] });
|
|
311
321
|
|
|
312
322
|
const AuthGuard = (route, state) => {
|
|
313
323
|
const environment = inject(APP_CONFIG);
|
|
314
324
|
const platformId = inject(PLATFORM_ID);
|
|
325
|
+
const lang = inject(LOCALE_ID);
|
|
315
326
|
const authService = inject(AuthService);
|
|
316
327
|
const router = inject(Router);
|
|
317
328
|
const isContinue = state.url.includes('continue');
|
|
@@ -320,6 +331,7 @@ const AuthGuard = (route, state) => {
|
|
|
320
331
|
return of(false);
|
|
321
332
|
}
|
|
322
333
|
return authService.introspect().pipe(map$1(({ roles, authenticated }) => {
|
|
334
|
+
console.log(lang);
|
|
323
335
|
const routeRoles = route.data['roles'];
|
|
324
336
|
const passRoled = routeRoles ? roles?.some((r) => routeRoles.indexOf(r) >= 0) : true;
|
|
325
337
|
if (authenticated && !passRoled) {
|
|
@@ -328,7 +340,8 @@ const AuthGuard = (route, state) => {
|
|
|
328
340
|
}
|
|
329
341
|
if (authenticated) {
|
|
330
342
|
if (window.location.href.includes(environment.accountsUrl) && !isContinue) {
|
|
331
|
-
window.location.href = environment.myaccountUrl
|
|
343
|
+
// window.location.href = `${environment.myaccountUrl}/${lang}`;
|
|
344
|
+
window.location.href = `${environment.myaccountUrl}`;
|
|
332
345
|
}
|
|
333
346
|
if (isContinue) {
|
|
334
347
|
window.location.href = continueUrl;
|
|
@@ -336,7 +349,10 @@ const AuthGuard = (route, state) => {
|
|
|
336
349
|
}
|
|
337
350
|
else {
|
|
338
351
|
if (!isContinue) {
|
|
339
|
-
|
|
352
|
+
const decodedUrl = decodeURIComponent(window.location.href);
|
|
353
|
+
window.location.href = environment.accountsUrl + `/signin?continue=${environment.myaccountUrl}`;
|
|
354
|
+
// window.location.href = environment.accountsUrl + `/signin?continue=${window.location.href}`;
|
|
355
|
+
// window.location.href = environment.accountsUrl + `/${lang}/signin?continue=${window.location.href}`;
|
|
340
356
|
}
|
|
341
357
|
}
|
|
342
358
|
return true;
|
|
@@ -345,10 +361,10 @@ const AuthGuard = (route, state) => {
|
|
|
345
361
|
|
|
346
362
|
class AuthDialogComponent {
|
|
347
363
|
dialogRef = inject(MatDialogRef);
|
|
348
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
349
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
364
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AuthDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
365
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.0.3", type: AuthDialogComponent, isStandalone: true, selector: "rolatech-auth-dialog", ngImport: i0, template: "<p>auth-dialog works!</p>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatDialogModule }] });
|
|
350
366
|
}
|
|
351
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
367
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AuthDialogComponent, decorators: [{
|
|
352
368
|
type: Component,
|
|
353
369
|
args: [{ selector: 'rolatech-auth-dialog', imports: [CommonModule, MatDialogModule], template: "<p>auth-dialog works!</p>\n" }]
|
|
354
370
|
}] });
|
|
@@ -465,9 +481,6 @@ class AuthUserService {
|
|
|
465
481
|
sendSMSCode(countryCode, phone) {
|
|
466
482
|
return this.http.post(`${this.environment.baseUrl}/auth/users/verification/phone/start`, { countryCode, phone });
|
|
467
483
|
}
|
|
468
|
-
signup(data) {
|
|
469
|
-
return this.http.post(`${this.environment.baseUrl}/auth/users/signup`, data);
|
|
470
|
-
}
|
|
471
484
|
findByUsername(username) {
|
|
472
485
|
return this.http.get(`${this.environment.baseUrl}/auth/users/info`, {
|
|
473
486
|
params: { username },
|
|
@@ -555,10 +568,60 @@ class AuthUserService {
|
|
|
555
568
|
deleteAddressById(id) {
|
|
556
569
|
return this.http.delete(`${this.environment.baseUrl}/auth/users/addresses/${id}`, { withCredentials: true });
|
|
557
570
|
}
|
|
558
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
559
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
571
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AuthUserService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
572
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AuthUserService, providedIn: 'root' });
|
|
573
|
+
}
|
|
574
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AuthUserService, decorators: [{
|
|
575
|
+
type: Injectable,
|
|
576
|
+
args: [{
|
|
577
|
+
providedIn: 'root',
|
|
578
|
+
}]
|
|
579
|
+
}] });
|
|
580
|
+
|
|
581
|
+
class AuthAgentService {
|
|
582
|
+
environment = inject(APP_CONFIG);
|
|
583
|
+
http = inject(HttpClient);
|
|
584
|
+
baseUrl = `${this.environment.baseUrl}/auth/agents`;
|
|
585
|
+
findAllApplications(options) {
|
|
586
|
+
return this.http.get(`${this.baseUrl}/applications`, {
|
|
587
|
+
params: options,
|
|
588
|
+
withCredentials: true,
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
getApplication(id) {
|
|
592
|
+
return this.http.get(`${this.baseUrl}/applications/${id}`, {
|
|
593
|
+
withCredentials: true,
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
myApplication() {
|
|
597
|
+
return this.http.get(`${this.baseUrl}/applications/me`, {
|
|
598
|
+
withCredentials: true,
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
apply(data) {
|
|
602
|
+
return this.http.post(`${this.baseUrl}/applications`, data, {
|
|
603
|
+
withCredentials: true,
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
approve(id) {
|
|
607
|
+
return this.http.put(`${this.baseUrl}/applications/${id}/approve`, {}, {
|
|
608
|
+
withCredentials: true,
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
reject(id, data) {
|
|
612
|
+
return this.http.put(`${this.baseUrl}/applications/${id}/reject`, data, {
|
|
613
|
+
withCredentials: true,
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
findRejections(id) {
|
|
617
|
+
return this.http.get(`${this.baseUrl}/applications/${id}/rejections`, {
|
|
618
|
+
withCredentials: true,
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AuthAgentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
622
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AuthAgentService, providedIn: 'root' });
|
|
560
623
|
}
|
|
561
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
624
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AuthAgentService, decorators: [{
|
|
562
625
|
type: Injectable,
|
|
563
626
|
args: [{
|
|
564
627
|
providedIn: 'root',
|
|
@@ -577,7 +640,7 @@ class LocalStorage {
|
|
|
577
640
|
removeItem(key) { }
|
|
578
641
|
setItem(key, value) { }
|
|
579
642
|
}
|
|
580
|
-
class
|
|
643
|
+
class LocalStorageService {
|
|
581
644
|
storage;
|
|
582
645
|
platformId = inject(PLATFORM_ID);
|
|
583
646
|
constructor() {
|
|
@@ -602,10 +665,10 @@ class LocalstorageService {
|
|
|
602
665
|
setItem(key, value) {
|
|
603
666
|
return this.storage.setItem(key, value);
|
|
604
667
|
}
|
|
605
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
606
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
668
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: LocalStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
669
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: LocalStorageService, providedIn: 'root' });
|
|
607
670
|
}
|
|
608
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
671
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: LocalStorageService, decorators: [{
|
|
609
672
|
type: Injectable,
|
|
610
673
|
args: [{
|
|
611
674
|
providedIn: 'root',
|
|
@@ -653,7 +716,7 @@ class ErrorInterceptor {
|
|
|
653
716
|
}
|
|
654
717
|
/**
|
|
655
718
|
*
|
|
656
|
-
* @param error
|
|
719
|
+
* @param error SMS code sent too many
|
|
657
720
|
* @returns
|
|
658
721
|
*/
|
|
659
722
|
hand429Error(error) {
|
|
@@ -663,10 +726,10 @@ class ErrorInterceptor {
|
|
|
663
726
|
return throwError(() => new Error('系统错误'));
|
|
664
727
|
// return throwError(() => error.error);
|
|
665
728
|
}
|
|
666
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
667
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
729
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: ErrorInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
730
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: ErrorInterceptor });
|
|
668
731
|
}
|
|
669
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
732
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: ErrorInterceptor, decorators: [{
|
|
670
733
|
type: Injectable
|
|
671
734
|
}] });
|
|
672
735
|
|
|
@@ -715,10 +778,10 @@ class AuthInterceptor {
|
|
|
715
778
|
},
|
|
716
779
|
});
|
|
717
780
|
}
|
|
718
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
719
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
781
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AuthInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
782
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AuthInterceptor });
|
|
720
783
|
}
|
|
721
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
784
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImport: i0, type: AuthInterceptor, decorators: [{
|
|
722
785
|
type: Injectable
|
|
723
786
|
}], ctorParameters: () => [] });
|
|
724
787
|
|
|
@@ -759,5 +822,5 @@ const authRoutes = [
|
|
|
759
822
|
* Generated bundle index. Do not edit.
|
|
760
823
|
*/
|
|
761
824
|
|
|
762
|
-
export { AddressComponent, AuthDialogGuard, AuthGuard, AuthInterceptor, AuthService, AuthStore, AuthUserService, ErrorInterceptor, FaceidDetectDialogComponent, ForbiddenComponent,
|
|
825
|
+
export { AddressComponent, AddressType, AuthAgentService, AuthDialogGuard, AuthGuard, AuthInterceptor, AuthService, AuthStore, AuthUserService, ErrorInterceptor, FaceidDetectDialogComponent, ForbiddenComponent, LocalStorageService, PermissionGuard, RoleGuard, UnauthorizedComponent, UserStatus, authRoutes, provideAngularAuth };
|
|
763
826
|
//# sourceMappingURL=rolatech-angular-auth.mjs.map
|