Commit 76228175 authored by cellee's avatar cellee

后台切换语言

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 86851cfb
...@@ -26,7 +26,10 @@ class AvatarDropdown extends React.Component<GlobalHeaderRightProps> { ...@@ -26,7 +26,10 @@ class AvatarDropdown extends React.Component<GlobalHeaderRightProps> {
// }); // });
// 清掉所有localStorage缓存 // 清掉所有localStorage缓存
localStorage.clear(); // localStorage.clear();
// 只用清掉当前账户的 localStorage
localStorage.removeItem('userInfo');
// 清掉本域名所有cookie // 清掉本域名所有cookie
let keys = document.cookie.match(/[^ =;]+(?==)/g); let keys = document.cookie.match(/[^ =;]+(?==)/g);
...@@ -43,6 +46,8 @@ class AvatarDropdown extends React.Component<GlobalHeaderRightProps> { ...@@ -43,6 +46,8 @@ class AvatarDropdown extends React.Component<GlobalHeaderRightProps> {
keys[i] + '=0;path=/;domain=ratingdog.cn;expires=' + new Date(0).toUTCString(); keys[i] + '=0;path=/;domain=ratingdog.cn;expires=' + new Date(0).toUTCString();
} }
} }
// 在返回登录页
dispatch({ dispatch({
type: 'login/logout', type: 'login/logout',
}); });
......
...@@ -8,7 +8,9 @@ const locales = ['zh-CN', 'en-US']; ...@@ -8,7 +8,9 @@ const locales = ['zh-CN', 'en-US'];
const LanguageSettings = () => { const LanguageSettings = () => {
const languageSelect = (e: any) => { const languageSelect = (e: any) => {
setLocale(locales[e.target.value]); // 无刷新切换
setLocale(locales[e.target.value], false);
setCurLang(e.target.value);
}; };
const [curLang, setCurLang] = useState(0); const [curLang, setCurLang] = useState(0);
......
...@@ -39,7 +39,6 @@ const VisitorRecord = (props: any) => { ...@@ -39,7 +39,6 @@ const VisitorRecord = (props: any) => {
{ title: 'Security Guard', dataIndex: 'securityGuardName' }, { title: 'Security Guard', dataIndex: 'securityGuardName' },
{ title: 'Number Plate', dataIndex: 'numberPlate' }, { title: 'Number Plate', dataIndex: 'numberPlate' },
// 隐藏的搜索框 // 隐藏的搜索框
{ title: 'Visitor Time', hideInTable: true, dataIndex: 'showTime', valueType: 'date' },
{ title: 'Visitor Time', dataIndex: 'updateTime', valueType: 'date' }, { title: 'Visitor Time', dataIndex: 'updateTime', valueType: 'date' },
{ title: 'Community', dataIndex: 'visitorCommunity' }, { title: 'Community', dataIndex: 'visitorCommunity' },
// { title: 'Unit', dataIndex: 'inviterAddress' }, // { title: 'Unit', dataIndex: 'inviterAddress' },
......
...@@ -39,7 +39,6 @@ const VisitorRecord = (props: any) => { ...@@ -39,7 +39,6 @@ const VisitorRecord = (props: any) => {
{ title: 'Security Guard', dataIndex: 'securityGuardName' }, { title: 'Security Guard', dataIndex: 'securityGuardName' },
{ title: 'Number Plate', dataIndex: 'numberPlate' }, { title: 'Number Plate', dataIndex: 'numberPlate' },
// 隐藏的搜索框 // 隐藏的搜索框
{ title: 'Visitor Time', hideInTable: true, dataIndex: 'showTime', valueType: 'date' },
{ title: 'Visitor Time', dataIndex: 'updateTime', valueType: 'date' }, { title: 'Visitor Time', dataIndex: 'updateTime', valueType: 'date' },
{ title: 'Community', dataIndex: 'visitorCommunity' }, { title: 'Community', dataIndex: 'visitorCommunity' },
// { title: 'Unit', dataIndex: 'inviterAddress' }, // { title: 'Unit', dataIndex: 'inviterAddress' },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment