Skip to content

Commit

Permalink
♻️ refactor(配置): 更新了 Angular 环境配置文件和代理配置以支持开发环境,同时对 http.Interceptor.…
Browse files Browse the repository at this point in the history
…ts 进行了微小的格式调整
  • Loading branch information
vnobo committed Jul 3, 2024
1 parent 5ebe3d0 commit 398cc87
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 28 deletions.
8 changes: 7 additions & 1 deletion ui/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,13 @@
"development": {
"optimization": false,
"extractLicenses": false,
"sourceMap": true
"sourceMap": true,
"fileReplacements": [
{
"replace": "projects/web/src/environments/environment.ts",
"with": "projects/web/src/environments/environment.development.ts"
}
]
}
},
"defaultConfiguration": "production"
Expand Down
6 changes: 0 additions & 6 deletions ui/projects/web/environments/environment.prod.ts

This file was deleted.

19 changes: 0 additions & 19 deletions ui/projects/web/environments/environment.ts

This file was deleted.

2 changes: 1 addition & 1 deletion ui/proxy.conf.json → ui/projects/web/proxy.conf.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"/api": {
"target": "http://localhost:8081",
"target": "http://localhost:8080",
"secure": false,
"pathRewrite": {
"^/api": ""
Expand Down
2 changes: 1 addition & 1 deletion ui/projects/web/src/core/http.Interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {AuthService} from './auth.service';
import {LoadingService} from './loading.service';
import {MessageService} from '../shared/message.service';
import {Router} from '@angular/router';
import {environment} from '../../environments/environment';
import {environment} from '../environments/environment';

export function defaultInterceptor(
req: HttpRequest<unknown>,
Expand Down
4 changes: 4 additions & 0 deletions ui/projects/web/src/environments/environment.development.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const environment = {
production: false,
host: '/api',
};
4 changes: 4 additions & 0 deletions ui/projects/web/src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const environment = {
production: true,
host: '',
};

0 comments on commit 398cc87

Please sign in to comment.