Browse Source

登录修改

master
xingyongchun 2 years ago
parent
commit
72ac21836c
  1. 4
      web/client/src/layout/containers/layout/index.js

4
web/client/src/layout/containers/layout/index.js

@ -48,10 +48,10 @@ function LayoutContainer(props) {
// 根据登录验证,如果尚未登录,则不可跳转/article // 根据登录验证,如果尚未登录,则不可跳转/article
useEffect(() => { useEffect(() => {
const { pathname } = location; const { pathname } = location;
const rightList = ['/brief']; const rightList = ['/article'];
if (rightList.every((path) => pathname.indexOf(path) == -1)) { if (rightList.every((path) => pathname.indexOf(path) == -1)) {
if (!sessionStorage.getItem("user")) { if (!sessionStorage.getItem("user")) {
dispatch(push("/brief")); dispatch(push("/article"));
} }
} }

Loading…
Cancel
Save