Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add ./ current fold in startup.service #2489

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/core/i18n/i18n.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class I18NService extends AlainI18nBaseService {
}

loadLangData(lang: string): Observable<NzSafeAny> {
return this.http.get(`assets/tmp/i18n/${lang}.json`);
return this.http.get(`./assets/tmp/i18n/${lang}.json`);
}

use(lang: string, data: Record<string, unknown>): void {
Expand Down
4 changes: 2 additions & 2 deletions src/app/core/startup/startup.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export class StartupService {
load(): Observable<void> {
const defaultLang = this.i18n.defaultLang;
// 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 zip(this.i18n.loadLangData(defaultLang), this.httpClient.get('assets/tmp/app-data.json')).pipe(
// this.httpClient.get('/app', { context: new HttpContext().set(ALLOW_ANONYMOUS, true) })
return zip(this.i18n.loadLangData(defaultLang), this.httpClient.get('./assets/tmp/app-data.json')).pipe(
// 接收其他拦截器后产生的异常消息
catchError(res => {
console.warn(`StartupService.load: Network request failed`, res);
Expand Down
Loading