更改租户时重新加载整个页面的原因是什么?
What is the reason behind reloading the entire page when changing tenants?
我想知道在更改租户时重新加载整个登录页面的原因:
save(): void {
if (!this.tenancyName) {
abp.multiTenancy.setTenantIdCookie(undefined);
this.close();
location.reload();
return;
}
}
然后在重新加载时,在app-session.service.ts:
中调用了init()
函数
init(): Promise<boolean> {
return new Promise<boolean>((resolve, reject) => {
this._sessionService.getCurrentLoginInformations().toPromise().then((result: GetCurrentLoginInformationsOutput) => {
this._application = result.application;
this._user = result.user;
this._tenant = result.tenant;
resolve(true);
}, (err) => {
reject(err);
});
});
}
这对我来说没有意义,因为在 GetCurrentLoginInformationsOutput
函数中,当前本地会话正在使用各种 API 访问令牌进行更新,然后在用户成功登录时再次更新这些访问令牌。
目前,我更改了交换租户背后的逻辑,并删除了 location.reload()
部分。其背后的原因是为了加快应用程序的响应时间。
我最大的问题是,如果不调用重新加载页面部分,我是否会丢失任何有价值的信息,应用程序是否会正常运行?
租户可能有不同的语言和其他设置。重新加载页面会重置状态等
but if I update those settings after login, doesn't the reload page part seem redundant?
着陆页也需要一些设置(例如语言)。
我想知道在更改租户时重新加载整个登录页面的原因:
save(): void {
if (!this.tenancyName) {
abp.multiTenancy.setTenantIdCookie(undefined);
this.close();
location.reload();
return;
}
}
然后在重新加载时,在app-session.service.ts:
中调用了init()
函数
init(): Promise<boolean> {
return new Promise<boolean>((resolve, reject) => {
this._sessionService.getCurrentLoginInformations().toPromise().then((result: GetCurrentLoginInformationsOutput) => {
this._application = result.application;
this._user = result.user;
this._tenant = result.tenant;
resolve(true);
}, (err) => {
reject(err);
});
});
}
这对我来说没有意义,因为在 GetCurrentLoginInformationsOutput
函数中,当前本地会话正在使用各种 API 访问令牌进行更新,然后在用户成功登录时再次更新这些访问令牌。
目前,我更改了交换租户背后的逻辑,并删除了 location.reload()
部分。其背后的原因是为了加快应用程序的响应时间。
我最大的问题是,如果不调用重新加载页面部分,我是否会丢失任何有价值的信息,应用程序是否会正常运行?
租户可能有不同的语言和其他设置。重新加载页面会重置状态等
but if I update those settings after login, doesn't the reload page part seem redundant?
着陆页也需要一些设置(例如语言)。