Skip to content

Commit

Permalink
修改目录状态,优化增加的问题.
Browse files Browse the repository at this point in the history
  • Loading branch information
vnobo committed Nov 6, 2023
1 parent b34d0b6 commit ddf216d
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 38 deletions.
4 changes: 2 additions & 2 deletions boot/platform/src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ spring:
username: farmer
password: q1w2e3..
pool:
max-idle-time: 10m
max-size: 32
initial-size: 16
max-idle-time: 10m
max-create-connection-time: 10s
max-validation-time: 10s
max-acquire-time: 5s
validation-query: "select version()"
sql.init:
mode: always
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.springframework.boot" version "3.2.0-RC1" apply false
id "org.springframework.boot" version "3.2.0-RC2" apply false
id 'io.spring.dependency-management' version '1.1.3' apply false
}

Expand Down
9 changes: 7 additions & 2 deletions ui/web/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Component, OnInit} from '@angular/core';
import {LoadingService} from "./core/loading.service";
import {Observable} from "rxjs";
import {debounceTime, distinctUntilChanged, Observable, tap} from "rxjs";

@Component({
selector: 'app-root',
Expand All @@ -15,7 +15,12 @@ export class AppComponent implements OnInit {
}

ngOnInit(): void {
this.loadingShow$ = this.loading.progress$;
this.loadingShow$ = this.loading.progress$
.pipe(
debounceTime(500),
distinctUntilChanged(),
tap((res) => console.log(`Loading show is: ${res}`))
);
}

}
9 changes: 1 addition & 8 deletions ui/web/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import {AppComponent} from './app.component';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {ServiceWorkerModule} from '@angular/service-worker';
import {TitleStrategy} from '@angular/router';
import {HttpClientXsrfModule} from "@angular/common/http";
import {SharedModule} from "./shared/shared.module";
import {PagesModule} from "./pages/pages.module";
import {PageTitleStrategy} from "./core/title-strategy.service";
import {CoreModule} from "./core/core.module";
import {AppRoutingModule} from "./app-routing.module";
Expand All @@ -21,14 +19,9 @@ import {AppRoutingModule} from "./app-routing.module";
registrationStrategy: 'registerWhenStable:30000'
}),
BrowserAnimationsModule,
HttpClientXsrfModule.withOptions({
cookieName: 'XSRF-TOKEN',
headerName: 'X-XSRF-TOKEN'
}),
AppRoutingModule,
CoreModule,
SharedModule,
PagesModule
SharedModule
],
providers: [
{provide: APP_ID, useValue: 'serverApp'},
Expand Down
8 changes: 6 additions & 2 deletions ui/web/src/app/core/core.module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import {NgModule, Optional, SkipSelf} from '@angular/core';
import {httpInterceptorProviders} from "./http-interceptors";
import {HttpClientModule} from "@angular/common/http";
import {HttpClientModule, HttpClientXsrfModule} from "@angular/common/http";


@NgModule({
imports: [
HttpClientModule
HttpClientModule,
HttpClientXsrfModule.withOptions({
cookieName: 'XSRF-TOKEN',
headerName: 'X-XSRF-TOKEN'
})
],
providers: [
httpInterceptorProviders
Expand Down
34 changes: 17 additions & 17 deletions ui/web/src/app/pages/index/index.component.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import {Component, OnInit} from '@angular/core';
import {MenusService} from "../../core/menus.service";
import {Menu} from "../../core/interfaces/menu";
import {Observable, of} from "rxjs";
import {Observable} from "rxjs";

@Component({
selector: 'app-welcome',
templateUrl: './index.component.html',
styleUrls: ['./index.component.scss']
selector: 'app-welcome',
templateUrl: './index.component.html',
styleUrls: ['./index.component.scss']
})
export class IndexComponent implements OnInit {

menus$: Observable<Menu[]> = of([]);
menus$: Observable<Menu[]> | undefined;

constructor(private menusService: MenusService) {
}
constructor(private menusService: MenusService) {
}

ngOnInit() {
this.initMenu();
}
ngOnInit() {
this.initMenu();
}

initMenu() {
let menuRequest: Menu = {
pcode: "0",
tenantCode: "0"
};
this.menus$ = this.menusService.getMenus(menuRequest);
}
initMenu() {
const menuRequest: Menu = {
pcode: "0",
tenantCode: "0"
};
this.menus$ = this.menusService.getMenus(menuRequest);
}
}
4 changes: 2 additions & 2 deletions ui/web/src/app/pages/pages-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {RouterModule, Routes} from '@angular/router';
import {IndexComponent} from "./index/index.component";

const routes: Routes = [
{path: 'index', component: IndexComponent, title: '欢迎主页'},
{path: '', pathMatch: 'full', redirectTo: '/index'}
{path: 'index', component: IndexComponent, title: '主页'},
{path: '', component: IndexComponent}
];

@NgModule({
Expand Down
4 changes: 2 additions & 2 deletions ui/web/src/app/pages/pages.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {SharedModule} from "../shared/shared.module";

@NgModule({
imports: [
PagesRoutingModule,
SharedModule
SharedModule,
PagesRoutingModule
],
declarations: [IndexComponent, PageNotFoundComponent],
exports: [PageNotFoundComponent]
Expand Down
7 changes: 5 additions & 2 deletions ui/web/src/app/pages/security/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Component, OnDestroy, OnInit} from '@angular/core';
import {FormBuilder, FormControl, Validators} from "@angular/forms";
import {Credentials, LoginService} from "./login.service";
import {ActivatedRoute, Router} from "@angular/router";
import {Subject, takeUntil} from "rxjs";
import {delay, Subject, takeUntil} from "rxjs";

@Component({
selector: 'app-login',
Expand Down Expand Up @@ -43,7 +43,10 @@ export class LoginComponent implements OnInit, OnDestroy {
} else {
this.loginService.clearRememberMe();
}
this.loginService.login(credentials).pipe(takeUntil(this._subject)).subscribe(() => {
this.loginService.login(credentials).pipe(
takeUntil(this._subject),
delay(2000)
).subscribe(() => {
this.router.navigate(['/index'], {relativeTo: this.route}).then();
});
}
Expand Down

0 comments on commit ddf216d

Please sign in to comment.