diff --git a/web/client/src/layout/components/sider/index.js b/web/client/src/layout/components/sider/index.js index a52a750..16376ef 100644 --- a/web/client/src/layout/components/sider/index.js +++ b/web/client/src/layout/components/sider/index.js @@ -12,7 +12,7 @@ const Sider = (props) => { useEffect(() => { let jumpurlObj = JumpUrls.find(s => s.url == pathname && selectedKeys != s.keys) if (jumpurlObj) { - localStorage.setItem('zhongding_selected_sider', JSON.stringify([jumpurlObj.keys])) + localStorage.setItem('governmentDataResourceCenter_selected_sider', JSON.stringify([jumpurlObj.keys])) setSelectedKeys(jumpurlObj.keys) } }, [pathname]) @@ -36,11 +36,11 @@ const Sider = (props) => { let selectedKeys = [] let openKeys = [] - const lastSelectedKeys = localStorage.getItem('zhongding_selected_sider') + const lastSelectedKeys = localStorage.getItem('governmentDataResourceCenter_selected_sider') if (lastSelectedKeys) { selectedKeys = JSON.parse(lastSelectedKeys) } - const lastOpenKeys = localStorage.getItem('zhongding_open_sider') + const lastOpenKeys = localStorage.getItem('governmentDataResourceCenter_open_sider') if (lastOpenKeys) { openKeys = JSON.parse(lastOpenKeys) } @@ -60,9 +60,9 @@ const Sider = (props) => { } } } - localStorage.setItem('zhongding_selected_sider', JSON.stringify(selectedKeys)) + localStorage.setItem('governmentDataResourceCenter_selected_sider', JSON.stringify(selectedKeys)) setSelectedKeys(selectedKeys) - localStorage.setItem('zhongding_open_sider', JSON.stringify(openKeys)) + localStorage.setItem('governmentDataResourceCenter_open_sider', JSON.stringify(openKeys)) setOpenKeys(openKeys) }, []) @@ -75,11 +75,11 @@ const Sider = (props) => { onSelect={(e) => { const { selectedKeys } = e; setSelectedKeys(selectedKeys) - localStorage.setItem('zhongding_selected_sider', JSON.stringify(selectedKeys)) + localStorage.setItem('governmentDataResourceCenter_selected_sider', JSON.stringify(selectedKeys)) }} onOpenChange={(openKeys) => { setOpenKeys(openKeys) - localStorage.setItem('zhongding_open_sider', JSON.stringify(openKeys)) + localStorage.setItem('governmentDataResourceCenter_open_sider', JSON.stringify(openKeys)) }} > {items} diff --git a/web/client/src/layout/containers/layout/index.js b/web/client/src/layout/containers/layout/index.js index 4e84c16..25a75e3 100644 --- a/web/client/src/layout/containers/layout/index.js +++ b/web/client/src/layout/containers/layout/index.js @@ -102,7 +102,7 @@ const LayoutContainer = props => {
-
+
{children}
diff --git a/web/client/src/sections/auth/actions/auth.js b/web/client/src/sections/auth/actions/auth.js index 39a61fd..1733d08 100644 --- a/web/client/src/sections/auth/actions/auth.js +++ b/web/client/src/sections/auth/actions/auth.js @@ -4,7 +4,7 @@ import { ApiTable } from '$utils' import { Request } from '@peace/utils' export const INIT_AUTH = 'INIT_AUTH'; -export function initAuth () { +export function initAuth() { const user = JSON.parse(sessionStorage.getItem('user')) || {}; return { type: INIT_AUTH, @@ -17,7 +17,7 @@ export function initAuth () { export const REQUEST_LOGIN = 'REQUEST_LOGIN'; export const LOGIN_SUCCESS = 'LOGIN_SUCCESS'; export const LOGIN_ERROR = 'LOGIN_ERROR'; -export function login ({ username, password, phone, code }) { +export function login({ username, password, phone, code }) { return dispatch => { dispatch({ type: REQUEST_LOGIN }); @@ -41,10 +41,12 @@ export function login ({ username, password, phone, code }) { } export const LOGOUT = 'LOGOUT'; -export function logout (user) { +export function logout(user) { const token = user.token; const url = ApiTable.logout; sessionStorage.removeItem('user'); + localStorage.removeItem('governmentDataResourceCenter_selected_sider') + localStorage.removeItem('governmentDataResourceCenter_open_sider') Request.put(url, { token: token }); diff --git a/web/client/src/sections/auth/containers/login.js b/web/client/src/sections/auth/containers/login.js index c131417..1753745 100644 --- a/web/client/src/sections/auth/containers/login.js +++ b/web/client/src/sections/auth/containers/login.js @@ -28,7 +28,9 @@ const Login = props => { const codCountDownRef = useRef(0) useEffect(() => { - + sessionStorage.removeItem('user'); + localStorage.removeItem('governmentDataResourceCenter_selected_sider') + localStorage.removeItem('governmentDataResourceCenter_open_sider') }, [])