fix login error

This commit is contained in:
wanxp 2023-05-25 00:06:44 +08:00
parent fa29664757
commit 1119b105ba
2 changed files with 4 additions and 0 deletions

@ -186,6 +186,7 @@ export function constructLoginCookieSettingsUI(containerEl: HTMLElement, parentC
const user:User = await manager.plugin.userComponent.loginCookie(manager.getCookieTemp())
if (!user || !user.id) {
log.notice(i18nHelper.getMessage('100137'))
return;
}
constructDoubanTokenSettingsUI(parentContainerEl, manager);
});

@ -116,6 +116,9 @@ export default class UserComponent {
if (userUrl && userUrl.indexOf('people/') > 0) {
id = userUrl.substring(userUrl.lastIndexOf('people/') + 7, userUrl.lastIndexOf('/'));
}
if (!id) {
return new User();
}
return {
id: id,
name: name,