mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 01:14:50 +08:00
优化登录验证、退出逻辑
This commit is contained in:
@@ -11,12 +11,15 @@ import { Link, history } from 'umi';
|
||||
import { LogoutOutlined } from '@ant-design/icons';
|
||||
import config from '@/utils/config';
|
||||
import 'codemirror/mode/shell/shell.js';
|
||||
import { request } from '@/utils/http';
|
||||
import './index.less';
|
||||
|
||||
export default function (props: any) {
|
||||
const logout = () => {
|
||||
localStorage.removeItem(config.authKey);
|
||||
history.push('/login');
|
||||
request.post(`${config.apiPrefix}logout`).then(() => {
|
||||
localStorage.removeItem(config.authKey);
|
||||
history.push('/login');
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user