Skip to content

Commit

Permalink
fix(admin): 解决退出登录前端未删除 token
Browse files Browse the repository at this point in the history
  • Loading branch information
twinh committed Feb 27, 2022
1 parent 2f30409 commit 32be1fb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default class extends Component {
const {ret} = await api.post('logout');
await $.ret(ret);
if (ret.isSuc()) {
window.localStorage.removeItem('token');
history.push($.url('admin/login', {next: window.location.pathname}));
}
};
Expand Down

0 comments on commit 32be1fb

Please sign in to comment.