mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
移动退出登录位置
This commit is contained in:
parent
b92daedea2
commit
8d21401f88
|
@ -80,4 +80,5 @@ export default {
|
||||||
contentWidth: 'Fixed',
|
contentWidth: 'Fixed',
|
||||||
splitMenus: false,
|
splitMenus: false,
|
||||||
logo: '/images/qinglong.png',
|
logo: '/images/qinglong.png',
|
||||||
|
siderWidth: 180,
|
||||||
} as any;
|
} as any;
|
||||||
|
|
|
@ -9,13 +9,6 @@
|
||||||
url('../assets/fonts/SourceCodePro-Regular.ttf') format('truetype');
|
url('../assets/fonts/SourceCodePro-Regular.ttf') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
// body {
|
|
||||||
// height: 100%;
|
|
||||||
// overflow-y: hidden;
|
|
||||||
// // background-color: rgb(248, 248, 248);
|
|
||||||
// width: 100% !important;
|
|
||||||
// }
|
|
||||||
|
|
||||||
.log-modal {
|
.log-modal {
|
||||||
.ant-modal {
|
.ant-modal {
|
||||||
padding-bottom: 0 !important;
|
padding-bottom: 0 !important;
|
||||||
|
@ -129,7 +122,7 @@
|
||||||
.ant-pro-grid-content.wide {
|
.ant-pro-grid-content.wide {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
.ant-pro-grid-content-children {
|
.ant-pro-grid-content-children {
|
||||||
height: calc(100% - 48px);
|
height: calc(100% - 36px);
|
||||||
> div,
|
> div,
|
||||||
.log-container,
|
.log-container,
|
||||||
.react-codemirror2,
|
.react-codemirror2,
|
||||||
|
@ -159,8 +152,8 @@
|
||||||
|
|
||||||
.ant-layout-content.ant-pro-basicLayout-content.ant-pro-basicLayout-has-header {
|
.ant-layout-content.ant-pro-basicLayout-content.ant-pro-basicLayout-has-header {
|
||||||
margin-bottom: 0 !important;
|
margin-bottom: 0 !important;
|
||||||
min-height: calc(100vh - 72px);
|
min-height: calc(100vh - 66px);
|
||||||
min-height: calc(100vh - var(--vh-offset, 0px) - 72px);
|
min-height: calc(100vh - var(--vh-offset, 0px) - 66px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.Resizer {
|
.Resizer {
|
||||||
|
@ -252,3 +245,40 @@
|
||||||
opacity: 0.5 !important;
|
opacity: 0.5 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ant-pro-page-container-children-content {
|
||||||
|
margin: 18px 18px 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-pro-basicLayout-content {
|
||||||
|
margin: 18px;
|
||||||
|
.ant-pro-page-container {
|
||||||
|
margin: -18px -18px -18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-menu-item.ant-pro-sider-collapsed-button {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-menu-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
color: rgba(0, 0, 0, 0.85);
|
||||||
|
|
||||||
|
.side-menu-collapse-button:hover {
|
||||||
|
color: #1890ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-menu-user-wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.side-menu-user-drop-menu {
|
||||||
|
.ant-dropdown-menu-item:hover {
|
||||||
|
color: #1890ff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -8,14 +8,19 @@ import {
|
||||||
} from 'darkreader';
|
} from 'darkreader';
|
||||||
import defaultProps from './defaultProps';
|
import defaultProps from './defaultProps';
|
||||||
import { Link, history } from 'umi';
|
import { Link, history } from 'umi';
|
||||||
import { LogoutOutlined } from '@ant-design/icons';
|
import {
|
||||||
|
LogoutOutlined,
|
||||||
|
MenuFoldOutlined,
|
||||||
|
MenuUnfoldOutlined,
|
||||||
|
UserOutlined,
|
||||||
|
} from '@ant-design/icons';
|
||||||
import config from '@/utils/config';
|
import config from '@/utils/config';
|
||||||
import { request } from '@/utils/http';
|
import { request } from '@/utils/http';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
import vhCheck from 'vh-check';
|
import vhCheck from 'vh-check';
|
||||||
import { version, changeLogLink, changeLog } from '../version';
|
import { version, changeLogLink, changeLog } from '../version';
|
||||||
import { useCtx, useTheme } from '@/utils/hooks';
|
import { useCtx, useTheme } from '@/utils/hooks';
|
||||||
import { message, Badge, Modal } from 'antd';
|
import { message, Badge, Modal, Avatar, Dropdown, Menu, Popover } from 'antd';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import SockJS from 'sockjs-client';
|
import SockJS from 'sockjs-client';
|
||||||
|
|
||||||
|
@ -27,6 +32,7 @@ export default function (props: any) {
|
||||||
const [systemInfo, setSystemInfo] = useState<{ isInitialized: boolean }>();
|
const [systemInfo, setSystemInfo] = useState<{ isInitialized: boolean }>();
|
||||||
const ws = useRef<any>(null);
|
const ws = useRef<any>(null);
|
||||||
const [socketMessage, setSocketMessage] = useState<any>();
|
const [socketMessage, setSocketMessage] = useState<any>();
|
||||||
|
const [collapsed, setCollapsed] = useState(false);
|
||||||
|
|
||||||
const logout = () => {
|
const logout = () => {
|
||||||
request.post(`${config.apiPrefix}logout`).then(() => {
|
request.post(`${config.apiPrefix}logout`).then(() => {
|
||||||
|
@ -184,6 +190,14 @@ export default function (props: any) {
|
||||||
!navigator.userAgent.includes('Chrome');
|
!navigator.userAgent.includes('Chrome');
|
||||||
const isQQBrowser = navigator.userAgent.includes('QQBrowser');
|
const isQQBrowser = navigator.userAgent.includes('QQBrowser');
|
||||||
|
|
||||||
|
const menu = (
|
||||||
|
<Menu className="side-menu-user-drop-menu">
|
||||||
|
<Menu.Item key="1" icon={<LogoutOutlined />} onClick={logout}>
|
||||||
|
退出登录
|
||||||
|
</Menu.Item>
|
||||||
|
</Menu>
|
||||||
|
);
|
||||||
|
|
||||||
return loading ? (
|
return loading ? (
|
||||||
<PageLoading />
|
<PageLoading />
|
||||||
) : (
|
) : (
|
||||||
|
@ -192,7 +206,7 @@ export default function (props: any) {
|
||||||
loading={loading}
|
loading={loading}
|
||||||
title={
|
title={
|
||||||
<>
|
<>
|
||||||
控制面板
|
<span style={{ fontSize: 16 }}>控制面板</span>
|
||||||
<a
|
<a
|
||||||
href={changeLogLink}
|
href={changeLogLink}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
@ -225,23 +239,46 @@ export default function (props: any) {
|
||||||
}
|
}
|
||||||
return <Link to={menuItemProps.path}>{defaultDom}</Link>;
|
return <Link to={menuItemProps.path}>{defaultDom}</Link>;
|
||||||
}}
|
}}
|
||||||
postMenuData={(menuData) => {
|
|
||||||
return [
|
|
||||||
...(menuData || []),
|
|
||||||
{
|
|
||||||
icon: <LogoutOutlined />,
|
|
||||||
name: '退出登录',
|
|
||||||
path: 'logout',
|
|
||||||
onTitleClick: () => logout(),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}}
|
|
||||||
pageTitleRender={(props, pageName, info) => {
|
pageTitleRender={(props, pageName, info) => {
|
||||||
if (info && typeof info.pageName === 'string') {
|
if (info && typeof info.pageName === 'string') {
|
||||||
return `${info.pageName} - 控制面板`;
|
return `${info.pageName} - 控制面板`;
|
||||||
}
|
}
|
||||||
return '控制面板';
|
return '控制面板';
|
||||||
}}
|
}}
|
||||||
|
onCollapse={setCollapsed}
|
||||||
|
collapsed={collapsed}
|
||||||
|
rightContentRender={() => (
|
||||||
|
<Dropdown overlay={menu} trigger={['click']}>
|
||||||
|
<span className="side-menu-user-wrapper">
|
||||||
|
<Avatar shape="square" size="small" icon={<UserOutlined />} />
|
||||||
|
<span style={{ marginLeft: 5 }}>admin</span>
|
||||||
|
</span>
|
||||||
|
</Dropdown>
|
||||||
|
)}
|
||||||
|
collapsedButtonRender={(collapsed) => (
|
||||||
|
<span
|
||||||
|
className="side-menu-container"
|
||||||
|
onClick={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{!collapsed && (
|
||||||
|
<Dropdown overlay={menu} trigger={['hover']}>
|
||||||
|
<span className="side-menu-user-wrapper">
|
||||||
|
<Avatar shape="square" size="small" icon={<UserOutlined />} />
|
||||||
|
<span style={{ marginLeft: 5 }}>admin</span>
|
||||||
|
</span>
|
||||||
|
</Dropdown>
|
||||||
|
)}
|
||||||
|
<span
|
||||||
|
className="side-menu-collapse-button"
|
||||||
|
onClick={() => setCollapsed(!collapsed)}
|
||||||
|
>
|
||||||
|
{collapsed ? <MenuUnfoldOutlined /> : <MenuFoldOutlined />}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
{...defaultProps}
|
{...defaultProps}
|
||||||
>
|
>
|
||||||
{React.Children.map(props.children, (child) => {
|
{React.Children.map(props.children, (child) => {
|
||||||
|
|
|
@ -182,7 +182,7 @@ export function getTableScroll({
|
||||||
}: { extraHeight?: number; id?: string } = {}) {
|
}: { extraHeight?: number; id?: string } = {}) {
|
||||||
if (typeof extraHeight == 'undefined') {
|
if (typeof extraHeight == 'undefined') {
|
||||||
// 47 + 40 + 10 + 24
|
// 47 + 40 + 10 + 24
|
||||||
extraHeight = 127;
|
extraHeight = 121;
|
||||||
}
|
}
|
||||||
let tHeader = null;
|
let tHeader = null;
|
||||||
if (id) {
|
if (id) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user