Skip to content

Commit

Permalink
fix(用户登录): 用户登录错误
Browse files Browse the repository at this point in the history
获取配置后再加载用户登录界面,由于title 节点没有找到导致报错

re #90
  • Loading branch information
Lind-pro committed Jun 28, 2020
1 parent e75f3dc commit 2963fea
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/pages/user/login2/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ const Login: React.FC<Props> = props => {
dispatch({
type: 'settings/fetchConfig',
callback: () => {
document.getElementById('title-icon')!.href = settings.titleIcon;
document.getElementById('sys-title')!.textContent = settings.title;
const title = document.getElementById('sys-title');
const icon = document.getElementById('title-icon');
if (title) {
title.textContent = settings.title;
}
if (icon) {
icon.href = settings.titleIcon;
}
setIsReady(true);
}
});
Expand Down

0 comments on commit 2963fea

Please sign in to comment.