mirror of
https://github.com/Wanxp/obsidian-douban.git
synced 2026-04-04 08:38:41 +08:00
fix login error
This commit is contained in:
parent
fa29664757
commit
1119b105ba
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user