From ccea7ae26afb541c3fcd350cc88c7d7c5cec0223 Mon Sep 17 00:00:00 2001 From: ozermzn Date: Sat, 31 Dec 2022 03:22:16 +0300 Subject: [PATCH] When the login button is clicked, the button will be disabled and the loading icon will appear in front of it and then redirect to the login page. --- .../apps/dev-app/src/app/app.module.ts | 4 +-- .../dev-app/src/app/home/home.component.html | 18 ++++++++-- .../dev-app/src/app/home/home.component.ts | 8 ++++- .../appsettings.json | 2 +- .../appsettings.json | 34 +++++++++---------- 5 files changed, 43 insertions(+), 23 deletions(-) diff --git a/npm/ng-packs/apps/dev-app/src/app/app.module.ts b/npm/ng-packs/apps/dev-app/src/app/app.module.ts index c3a0cd68c5..52ebd38362 100644 --- a/npm/ng-packs/apps/dev-app/src/app/app.module.ts +++ b/npm/ng-packs/apps/dev-app/src/app/app.module.ts @@ -14,7 +14,7 @@ import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { APP_ROUTE_PROVIDER } from './route.provider'; import { FeatureManagementModule } from '@abp/ng.feature-management'; -// import { AbpOAuthModule } from '@abp/ng.oauth'; +import { AbpOAuthModule } from '@abp/ng.oauth'; @NgModule({ imports: [ @@ -27,7 +27,7 @@ import { FeatureManagementModule } from '@abp/ng.feature-management'; sendNullsAsQueryParam: false, skipGetAppConfiguration: false, }), - // AbpOAuthModule.forRoot(), + AbpOAuthModule.forRoot(), ThemeSharedModule.forRoot(), AccountConfigModule.forRoot(), IdentityConfigModule.forRoot(), diff --git a/npm/ng-packs/apps/dev-app/src/app/home/home.component.html b/npm/ng-packs/apps/dev-app/src/app/home/home.component.html index 677ee2e37f..1302cfa018 100644 --- a/npm/ng-packs/apps/dev-app/src/app/home/home.component.html +++ b/npm/ng-packs/apps/dev-app/src/app/home/home.component.html @@ -10,9 +10,23 @@

{{ '::LongWelcomeMessage' | abpLocalization }}

- {{ 'AbpAccount::Login' | abpLocalization }} + {{ 'AbpAccount::Login' | abpLocalization }} +
+ Loading... +
+

Let's improve your application!

diff --git a/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts b/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts index c48187728c..c2df395a0e 100644 --- a/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts +++ b/npm/ng-packs/apps/dev-app/src/app/home/home.component.ts @@ -1,12 +1,14 @@ import { AuthService } from '@abp/ng.core'; import { Component } from '@angular/core'; import { OAuthService } from 'angular-oauth2-oidc'; +import { timeInterval } from 'rxjs'; @Component({ selector: 'app-home', templateUrl: './home.component.html', }) export class HomeComponent { + isLog: boolean = false; get hasLoggedIn(): boolean { return this.authService.isAuthenticated; } @@ -14,6 +16,10 @@ export class HomeComponent { constructor(private authService: AuthService) {} login() { - this.authService.navigateToLogin(); + this.isLog = true; + setTimeout(data => { + this.authService.navigateToLogin(); + this.isLog = false; + }, 1000); } } diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json index 0602764acb..7087adeeb9 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.DbMigrator/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=MyProjectName;Trusted_Connection=True;TrustServerCertificate=True" + "Default": "Server=özer\\OZER;Database=MyProjectName;Trusted_Connection=True;TrustServerCertificate=True" }, "OpenIddict": { "Applications": { diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json index f46c93101c..6a03e588a2 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.HostWithIds/appsettings.json @@ -1,19 +1,19 @@ { - "App": { - "SelfUrl": "https://localhost:44305", - "ClientUrl": "http://localhost:4200", - "CorsOrigins": "https://*.MyProjectName.com,http://localhost:4200,https://localhost:44307", - "RedirectAllowedUrls": "http://localhost:4200,https://localhost:44307" - }, - "ConnectionStrings": { - "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=MyProjectName;Trusted_Connection=True;TrustServerCertificate=True" - }, - "AuthServer": { - "Authority": "https://localhost:44305", - "RequireHttpsMetadata": "false", - "SwaggerClientId": "MyProjectName_Swagger" - }, - "StringEncryption": { - "DefaultPassPhrase": "gsKnGZ041HLL4IM8" - } + "App": { + "SelfUrl": "https://localhost:44305", + "ClientUrl": "http://localhost:4200", + "CorsOrigins": "https://*.MyProjectName.com,http://localhost:4200,https://localhost:44307", + "RedirectAllowedUrls": "http://localhost:4200,https://localhost:44307" + }, + "ConnectionStrings": { + "Default": "Server=özer\\OZER;Database=MyProjectName;Trusted_Connection=True;TrustServerCertificate=True" + }, + "AuthServer": { + "Authority": "https://localhost:44305", + "RequireHttpsMetadata": "false", + "SwaggerClientId": "MyProjectName_Swagger" + }, + "StringEncryption": { + "DefaultPassPhrase": "gsKnGZ041HLL4IM8" + } }