Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: 退出登录后tagViewList未清空 #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/views/layout/Header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { connect } from "react-redux";
import { Icon, Menu, Dropdown, Modal, Layout, Avatar } from "antd";
import { Link } from "react-router-dom";
import { logout, getUserInfo } from "@/store/actions";
import { emptyTaglist } from "@/store/actions";
import FullScreen from "@/components/FullScreen";
import Settings from "@/components/Settings";
import Hamburger from "@/components/Hamburger";
Expand All @@ -19,6 +20,7 @@ const LayoutHeader = (props) => {
getUserInfo,
showSettings,
fixedHeader,
emptyTaglist,
} = props;
token && getUserInfo(token);
const handleLogout = (token) => {
Expand All @@ -28,6 +30,7 @@ const LayoutHeader = (props) => {
okText: "确定",
cancelText: "取消",
onOk: () => {
emptyTaglist()
logout(token);
},
});
Expand Down Expand Up @@ -111,6 +114,7 @@ const mapStateToProps = (state) => {
...state.app,
...state.user,
...state.settings,
...state.tagsView,
};
};
export default connect(mapStateToProps, { logout, getUserInfo })(LayoutHeader);
export default connect(mapStateToProps, { logout, getUserInfo, emptyTaglist })(LayoutHeader);