Skip to content

Commit

Permalink
✨ feat(services): 添加了 LoadingService 和 PageTitleStrategy 服务类
Browse files Browse the repository at this point in the history
♻️ refactor(http): 重构了 http.Interceptor 增加了请求加载指示和身份验证逻辑
📝 docs(package): 更新了 package.json 中的 npm 脚本
✨ feat(component): 新增 NotFoundComponent 404 页面组件
♻️ refactor(build): 更新了构建配置中的 polyfills 和 styles 配置
♻️ refactor(routes): 更新了应用路由配置,使用新的 NotFoundComponent
♻️ refactor(configs): 调整了应用配置和路由配置中的服务引用路径
♻️ refactor(modules): 更新了 pages.module.ts 移除了 PageNotFoundComponent
  • Loading branch information
vnobo committed Jul 2, 2024
1 parent 6df5107 commit f475350
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 38 deletions.
5 changes: 2 additions & 3 deletions boot/platform/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ tasks.named("bootBuildImage") {
tags = ["${dockerPrefix}/${rootProject.name}-${project.name}:latest"]
imageName.set("${dockerPrefix}/${rootProject.name}-${project.name}:${project.version}")
environment = [
"HTTP_PROXY" : "http://127.0.0.1:65324",
"HTTPS_PROXY" : "http://127.0.0.1:65324",
"BP_JVM_VERSION" : "21",
"BP_JVM_VERSION_TYPE": "jre",
"BPE_DELIM_JAVA_TOOL_OPTIONS" : " ",
Expand Down Expand Up @@ -55,11 +53,12 @@ dependencies {

implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.boot:spring-boot-starter-oauth2-client")
implementation("org.springframework.session:spring-session-data-redis")

implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("org.springframework.boot:spring-boot-starter-validation")

implementation("org.springframework.session:spring-session-data-redis")
implementation("org.springframework.boot:spring-boot-starter-data-redis-reactive")

implementation("org.springframework.boot:spring-boot-starter-log4j2")
Expand Down
8 changes: 4 additions & 4 deletions ui/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,21 @@
"styles": [
{
"input": "bootstrap/dist/css/bootstrap.css",
"bundleName": "bootstrap-module"
"bundleName": "bootstrap"
},
{
"input": "bootstrap-icons/font/bootstrap-icons.css",
"bundleName": "icons-module"
"bundleName": "icons"
},
{
"input": "projects/web/src/styles.scss",
"bundleName": "main-module"
"bundleName": "main"
}
],
"scripts": [
{
"input": "bootstrap/dist/js/bootstrap.bundle.js",
"bundleName": "bootstrap-module"
"bundleName": "bootstrap"
}
],
"server": "projects/web/src/main.server.ts",
Expand Down
2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng lint --fix && ng serve",
"start": "ng serve",
"build": "ng lint --fix && ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
Expand Down
2 changes: 1 addition & 1 deletion ui/projects/web/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {AsyncPipe} from '@angular/common';
import {NzBackTopModule} from 'ng-zorro-antd/back-top';
import {NzSpinModule} from 'ng-zorro-antd/spin';
import {debounceTime, distinctUntilChanged, tap} from 'rxjs';
import {LoadingService} from '../core/loading.service';
import {LoadingService} from './loading.service';
import {toSignal} from '@angular/core/rxjs-interop';

@Component({
Expand Down
4 changes: 2 additions & 2 deletions ui/projects/web/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {ApplicationConfig, importProvidersFrom, provideExperimentalZonelessChang
import {provideRouter, TitleStrategy} from '@angular/router';

import {routes} from './app.routes';
import {PageTitleStrategy} from '../core/title-strategy.service';
import {PageTitleStrategy} from './title-strategy.service';
import {provideNzConfig} from 'ng-zorro-antd/core/config';
import {ngZorroConfig} from '../shared/shared-zorro.module';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
Expand All @@ -14,7 +14,7 @@ import {
withInterceptorsFromDi,
withXsrfConfiguration,
} from '@angular/common/http';
import {authTokenInterceptor, defaultInterceptor,} from '../core/http.Interceptor';
import {authTokenInterceptor, defaultInterceptor,} from './http.Interceptor';

export const appConfig: ApplicationConfig = {
providers: [
Expand Down
4 changes: 2 additions & 2 deletions ui/projects/web/src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Routes} from '@angular/router';
import {PageNotFoundComponent} from '../pages/page-not-found/page-not-found.component';
import {NotFoundComponent} from './not-found.component';

export const routes: Routes = [
{
Expand All @@ -13,5 +13,5 @@ export const routes: Routes = [
import('../core/security/security.module').then(m => m.SecurityModule),
},
{path: '', pathMatch: 'full', redirectTo: 'auth'},
{path: '**', component: PageNotFoundComponent},
{path: '**', component: NotFoundComponent},
];
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {inject} from '@angular/core';
import {HttpEvent, HttpHandlerFn, HttpRequest} from '@angular/common/http';
import {catchError, finalize, Observable, throwError, timeout} from 'rxjs';
import {AuthService} from './auth.service';
import {AuthService} from '../core/auth.service';
import {LoadingService} from './loading.service';
import {MessageService} from '../shared/message.service';
import {Router} from '@angular/router';
Expand Down
File renamed without changes.
26 changes: 26 additions & 0 deletions ui/projects/web/src/app/not-found.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import {Component} from '@angular/core';
import {NzResultModule} from 'ng-zorro-antd/result';

@Component({
selector: 'app-not-found',
standalone: true,
imports: [NzResultModule],
template: `
<nz-result
nzStatus="403"
nzSubTitle="Sorry, you are not authorized to access this page."
nzTitle="403">
<div class="" nz-result-extra>
<a href="/home" nz-button nzType="primary">Back Home</a>
</div>
</nz-result>
`,
styles: `
:host {
min-height: 100%;
min-width: 100%;
}
`,
})
export class NotFoundComponent {
}

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 2 additions & 3 deletions ui/projects/web/src/pages/pages.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {NgModule, Optional, SkipSelf} from '@angular/core';
import {PagesRoutingModule} from './pages.routes';

import {IndexComponent} from './home/index/index.component';
import {PageNotFoundComponent} from './page-not-found/page-not-found.component';
import {HomeComponent} from './home/home.component';
import {SharedModule} from '../shared/shared.module';
import {NzLayoutModule} from 'ng-zorro-antd/layout';
Expand All @@ -18,8 +17,8 @@ import {NzSliderModule} from 'ng-zorro-antd/slider';
SharedModule,
PagesRoutingModule,
],
declarations: [IndexComponent, PageNotFoundComponent, HomeComponent],
exports: [PageNotFoundComponent],
declarations: [IndexComponent, HomeComponent],
exports: [],
})
export class PagesModule {
constructor(@Optional() @SkipSelf() parentModule?: PagesModule) {
Expand Down

0 comments on commit f475350

Please sign in to comment.