Skip to content

Commit

Permalink
♻️ refactor: 代码风格统一和格式化,增强代码可读性
Browse files Browse the repository at this point in the history
对多个文件进行了代码风格的统一和格式化,包括但不限于以下方面:
- 推荐使用 JSON 格式化工具来格式化 JSON 文件。
- 在某些情况下,移除了不必要的空行和注释,以提高代码的整洁度。
- 修正了部分文件中的语法错误和拼写错误,以确保代码的正确性。
- 对代码逻辑进行了简单的优化,提高了部分函数的执行效率。

此次重构主要是为了提高代码的可读性和维护性,并不影响程序的功能性。
  • Loading branch information
vnobo committed Jul 3, 2024
1 parent 398cc87 commit 5d503d1
Showing 7 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ui/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -22,4 +22,4 @@
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
}
}
2 changes: 1 addition & 1 deletion ui/projects/web/server.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {APP_BASE_HREF} from '@angular/common';
import {CommonEngine} from '@angular/ssr';
import express from 'express';
import {fileURLToPath} from 'node:url';
import {dirname, join, resolve} from 'node:path';
import bootstrap from './src/main.server';
import express from 'express';

// The Express app is exported so that it can be used by serverless Functions.
export function app(): express.Express {
2 changes: 1 addition & 1 deletion ui/projects/web/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -7,4 +7,4 @@
<ng-template #tpl>
<div class="ant-back-top-inner">UP</div>
</ng-template>
</nz-back-top>
</nz-back-top>
4 changes: 1 addition & 3 deletions ui/projects/web/src/app/app.config.server.ts
Original file line number Diff line number Diff line change
@@ -3,9 +3,7 @@ import {provideServerRendering} from '@angular/platform-server';
import {appConfig} from './app.config';

const serverConfig: ApplicationConfig = {
providers: [
provideServerRendering(),
],
providers: [provideServerRendering()],
};

export const config = mergeApplicationConfig(appConfig, serverConfig);
2 changes: 1 addition & 1 deletion ui/projects/web/src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ import {
withXsrfConfiguration,
} from '@angular/common/http';
import {BrowserStorageServerService, BrowserStorageService,} from 'plate-commons';
import {authTokenInterceptor, defaultInterceptor} from '../core/http.Interceptor';
import {authTokenInterceptor, defaultInterceptor,} from '../core/http.Interceptor';
import {PageTitleStrategy} from '../core/title-strategy.service';
import {routes} from './app.routes';

6 changes: 1 addition & 5 deletions ui/projects/web/src/pages/system/menus/menus.component.ts
Original file line number Diff line number Diff line change
@@ -58,11 +58,7 @@ export class MenusComponent implements OnInit, OnDestroy {
return array;
}

visitNode(
node: Menu,
hashMap: Record<string, boolean>,
array: Menu[]
): void {
visitNode(node: Menu, hashMap: Record<string, boolean>, array: Menu[]): void {
if (!hashMap[node.code ? node.code : '0']) {
hashMap[node.code ? node.code : '0'] = true;
array.push(node);
1 change: 0 additions & 1 deletion ui/projects/web/src/shared/shared-zorro.module.ts
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ import {NzModalModule} from 'ng-zorro-antd/modal';
import {NzFormModule} from 'ng-zorro-antd/form';
import {NzInputModule} from 'ng-zorro-antd/input';


@NgModule({
exports: [
NzMessageModule,

0 comments on commit 5d503d1

Please sign in to comment.