[feat] - add user lsit , convert to coop and lock unlock user

This commit is contained in:
2024-08-19 17:05:10 +07:00
parent 57b9371d2a
commit 3cc3d72eb5
24 changed files with 617 additions and 91 deletions

View File

@@ -7,6 +7,7 @@ import { lastValueFrom } from 'rxjs';
import { EAction, EText } from 'src/app/@config/app';
import { CathayAuthService } from 'src/app/core/service/auth/cathay-auth.service';
import { ROLE_ADMIN } from 'src/app/@config/menus';
import { SathonCathayPayService } from 'src/app/sathon-cathay-pay.service';
@Component({
@@ -27,7 +28,8 @@ export class LoginComponent implements OnInit {
private router: Router,
private appService: AppService,
private authService: AuthService,
private cathayAuthService: CathayAuthService
private cathayAuthService: CathayAuthService,
private sathonSV: SathonCathayPayService
) {
}
@@ -46,6 +48,7 @@ export class LoginComponent implements OnInit {
try {
// const result = await lastValueFrom(this.authService.login(this.dataForm));
let cathayResult: any = await lastValueFrom(this.cathayAuthService.login(this.cathayForm));
let sathonToken: any = await lastValueFrom(this.cathayAuthService.genToken());
let isAdmin = cathayResult.userName == ROLE_ADMIN ? true : false
cathayResult = {
...cathayResult,
@@ -53,6 +56,7 @@ export class LoginComponent implements OnInit {
}
this.appService.setToken(cathayResult.token.token)
this.appService.setSathonToken(sathonToken.token)
this.appService.setAuth(cathayResult);
if (isAdmin) {