feat: add app and config
This commit is contained in:
@@ -3,13 +3,13 @@ import { useLayoutStore } from './store';
|
||||
import clsx from 'clsx';
|
||||
import { Menu, MenuItem, Tooltip } from '@mui/material';
|
||||
import { Button } from '@mui/material';
|
||||
import { IconButton } from '@kevisual/center-components/button/index.tsx';
|
||||
import { message } from '@/modules/message';
|
||||
import { DashboardOutlined, HomeOutlined, LogoutOutlined, SmileOutlined } from '@ant-design/icons';
|
||||
import SmileOutlined from '@ant-design/icons/SmileOutlined';
|
||||
import SwitcherOutlined from '@ant-design/icons/SwitcherOutlined';
|
||||
import { useMemo } from 'react';
|
||||
import { query } from '../query';
|
||||
import { query, queryLogin } from '../query';
|
||||
import { useNewNavigate } from '../navicate';
|
||||
import { Users, X } from 'lucide-react';
|
||||
import { LogOut, Map, SquareUser, Users, X } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import React from 'react';
|
||||
|
||||
@@ -27,17 +27,17 @@ export const LayoutUser = () => {
|
||||
const meun = [
|
||||
{
|
||||
title: t('Your profile'),
|
||||
icon: <HomeOutlined />,
|
||||
icon: <SquareUser size={16} />,
|
||||
link: '/user/profile',
|
||||
},
|
||||
{
|
||||
title: t('Your orgs'),
|
||||
icon: <DashboardOutlined />,
|
||||
icon: <SwitcherOutlined />,
|
||||
link: '/org/edit/list',
|
||||
},
|
||||
{
|
||||
title: t('Site Map'),
|
||||
icon: <HomeOutlined />,
|
||||
icon: <Map size={16} />,
|
||||
link: '/map',
|
||||
},
|
||||
];
|
||||
@@ -110,12 +110,17 @@ export const LayoutUser = () => {
|
||||
</div>
|
||||
<div
|
||||
className='flex items-center p-4 hover:bg-secondary hover:text-white cursor-pointer'
|
||||
onClick={() => {
|
||||
query.removeToken();
|
||||
window.open('/user/login', '_self');
|
||||
onClick={async () => {
|
||||
const res = await queryLogin.logout();
|
||||
// console.log(res);
|
||||
if (res.success) {
|
||||
window.open('/user/login', '_self');
|
||||
} else {
|
||||
message.error(res.message || 'Logout failed');
|
||||
}
|
||||
}}>
|
||||
<div className='mr-4'>
|
||||
<LogoutOutlined />
|
||||
<LogOut size={16} />
|
||||
</div>
|
||||
<div>{t('Login Out')}</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user