Skip to content

Commit

Permalink
fix(用户登录): 修复用户登录
Browse files Browse the repository at this point in the history
设置localStorage是值是undefined
  • Loading branch information
Lind-pro committed Nov 10, 2020
1 parent 944b850 commit bef4df5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/models/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ const UserModel: UserModelType = {
if (loginStorage) {
const tempLogin = JSON.parse(loginStorage);
tempLogin.permissions = response.result.permissions;
localStorage.setItem('hsweb-autz', JSON.stringify(tempLogin));
const autz = JSON.stringify(tempLogin);
autz && localStorage.setItem('hsweb-autz', autz);
} else {
localStorage.setItem('hsweb-autz', JSON.stringify(response.result));
const autz = JSON.stringify(response.result);
autz && localStorage.setItem('hsweb-autz', autz);
}
yield put({
type: 'saveCurrentUser',
Expand Down

0 comments on commit bef4df5

Please sign in to comment.