Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Oct 31, 2023
1 parent d9ea22f commit 8f26626
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/server.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ Work in the form of the Restful API with the server application of any technolog
In NG-ALAIN, a complete front-end UI interaction to the server-side processing flow looks like this:

1. Start Angular for the first time to execute `APP_INITIALIZER`;
- Usually some APP general data is loaded before startup, such as currently authorized user data, menu data, dictionary data, configuration data, etc.
2. UI component interaction;
3. Send the request using the encapsulated [_HttpClient](/theme/http);
4. Trigger the user authentication interceptor [@delon/auth](/auth/getting-started) and add the `token` parameter uniformly;
- If there is no `token` or an expired interrupt subsequent request, jump directly to the login page;
- If there is no `token` or an expired interrupt subsequent request, jump directly to the login page;
5. Trigger the default interceptor to process the prefix and other information;
6. Get the server back;
7. Trigger the default interceptor to handle request exceptions, business exceptions, etc.
Expand Down
1 change: 1 addition & 0 deletions docs/server.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ NG-ALAIN 是一套基于 Angular 技术栈的单页面应用,我们提供的
在 NG-ALAIN 中,一个完整的前端 UI 交互到服务端处理流程是这样的:

1. 首次启动 Angular 执行 `APP_INITIALIZER`
- 通常会在启动前先加载一些APP通用数据,例如:当前已授权用户数据、菜单数据、字典数据、配置项等
2. UI 组件交互操作;
3. 使用封装的 [_HttpClient](/theme/http) 发送请求;
4. 触发用户认证拦截器 [@delon/auth](/auth/getting-started),统一加入 `token` 参数;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export class StartupService {
}
<% } else { %>
private viaHttp(): Observable<void> {
// If http request allows anonymous access, you need to add `ALLOW_ANONYMOUS`:
// this.httpClient.get('assets/tmp/app-data.json', { context: new HttpContext().set(ALLOW_ANONYMOUS, true) })
return this.httpClient.get('assets/tmp/app-data.json').pipe(
catchError((res: NzSafeAny) => {
console.warn(`StartupService.load: Network request failed`, res);
Expand Down Expand Up @@ -103,7 +105,7 @@ export class StartupService {
// }
// mock
const app: any = {
name: `ng-alain`,
name: `NG-ALAIN`,
description: `Ng-zorro admin panel front-end framework`
};
const user: any = {
Expand Down

0 comments on commit 8f26626

Please sign in to comment.