Skip to content

Commit

Permalink
fix: fix i18n load and not over stream when autoAuth equals false
Browse files Browse the repository at this point in the history
  • Loading branch information
devcui committed Oct 10, 2024
1 parent 86084e1 commit 992cbd8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/bis/src/startup.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class YunzaiStartupService {
private readonly configService = inject(YunzaiConfigService);

load(param?: LoadParam): Observable<void> {
let defaultLang: string = this.settingService.layout.lang || this.i18n.defaultLang;
let defaultLang: string = this.settingService.layout.lang || this.i18n.defaultLang || 'zh-CN';
const [setTenant] = useLocalStorageTenant();
const [setUser, getUser] = useLocalStorageUser();
const [setHeader] = useLocalStorageHeader();
Expand All @@ -69,7 +69,13 @@ export class YunzaiStartupService {
return this.token(param).pipe(
mergeMap((token: NzSafeAny) => {
if (token === false) {
return this.i18n.loadLocaleData(defaultLang).pipe(mergeMap(() => EMPTY));
return this.i18n.loadLocaleData(defaultLang).pipe(
map((langData: NzSafeAny) => {
this.i18n.use(defaultLang, langData);
this.settingService.setLayout('lang', defaultLang);
}),
mergeMap(() => EMPTY)
);
}
this.configService.set('auth', {
token_send_key: 'Authorization',
Expand Down

0 comments on commit 992cbd8

Please sign in to comment.