feat: 联调

This commit is contained in:
秋水浮尘
2023-11-12 17:27:54 +08:00
parent 35c973ccd0
commit 13f794caea
7 changed files with 208 additions and 192 deletions

View File

@@ -1,64 +1,68 @@
import { Input, Dropdown, message } from 'antd';
import Logo from '@/imgs/logo.jpg'
import Head from '@/imgs/head.jpg'
import Logo from '@/imgs/logo.jpg'
import { HeartOutlined, LikeOutlined, LoginOutlined, UserOutlined } from '@ant-design/icons'
import TopMenu from '@components/top-menu'
import { UserOutlined, HeartOutlined, LikeOutlined, LoginOutlined } from '@ant-design/icons'
import { useNavigate } from "react-router-dom";
import { Dropdown, Input, message } from 'antd'
import { useNavigate } from 'react-router-dom'
const { Search } = Input;
const { Search } = Input
const menuItems = [
{
label: '个人中心',
key: 1,
icon: <UserOutlined style={{ fontSize: '16px' }} />
},
{
label: '我的收藏',
key: 2,
icon: <HeartOutlined style={{ fontSize: '16px' }} />
}, {
label: '我的点赞',
key: 3,
icon: <LikeOutlined style={{ fontSize: '16px' }} />
},
{
type: 'divider',
},
{
label: '退出',
key: 4,
icon: <LoginOutlined style={{ fontSize: '16px' }} />
}
{
label: '个人中心',
key: 1,
icon: <UserOutlined style={{ fontSize: '16px' }} />
},
{
label: '我的收藏',
key: 2,
icon: <HeartOutlined style={{ fontSize: '16px' }} />
},
{
label: '我的点赞',
key: 3,
icon: <LikeOutlined style={{ fontSize: '16px' }} />
},
{
type: 'divider'
},
{
label: '退出',
key: 4,
icon: <LoginOutlined style={{ fontSize: '16px' }} />
}
]
const Header = () => {
const { pathname } = window.location;
const navigate = useNavigate()
const { pathname } = window.location
const navigate = useNavigate()
const handleMenuClick = e => {
if (e.key != 1) {
return message.info('敬请期待')
}
navigate('/user-info')
}
const handleMenuClick = e => {
const userInfoStorage = localStorage.getItem('userInfo')
if (!userInfoStorage) {
return message.info('请登录')
}
if (e.key != 1) {
return message.info('敬请期待')
}
navigate('/user-info')
}
return (
<div className="head-navigator-box">
<div className="head-navigator">
<div className="head-navigator-left">
<div
className="head-navigator-logo"
onClick={() =>
(window.location.href = '/question-bank')
}>
<img src={Logo} style={{ height: 50 }} />
</div>
<TopMenu />
</div>
<div className="head-navigator-user-box">
<div className="time-box"></div>
{/* {'/question-bank' == pathname && (
return (
<div className='head-navigator-box'>
<div className='head-navigator'>
<div className='head-navigator-left'>
<div
className='head-navigator-logo'
onClick={() => (window.location.href = '/question-bank')}
>
<img src={Logo} style={{ height: 50 }} />
</div>
<TopMenu />
</div>
<div className='head-navigator-user-box'>
<div className='time-box'></div>
{/* {'/question-bank' == pathname && (
<div className="head-navigator-input-box">
<Search
placeholder="请输入感兴趣的内容~"
@@ -67,32 +71,28 @@ const Header = () => {
/>
</div>
)} */}
{/* <div className="head-navigator-bell"> */}
{/* <Icon type="bell" /> */}
{/* </div> */}
<div className="head-navigator-user-img">
<Dropdown
menu={{
items: menuItems,
onClick: handleMenuClick,
}}
placement="bottom"
trigger={['click']}
destroyPopupOnHide
overlayStyle={{
width: '150px'
}}
>
<img
src={Head}
style={{ width: 36, height: 36 }}
/>
</Dropdown>
</div>
</div>
</div>
</div>
)
{/* <div className="head-navigator-bell"> */}
{/* <Icon type="bell" /> */}
{/* </div> */}
<div className='head-navigator-user-img'>
<Dropdown
menu={{
items: menuItems,
onClick: handleMenuClick
}}
placement='bottom'
trigger={['click']}
destroyPopupOnHide
overlayStyle={{
width: '150px'
}}
>
<img src={Head} style={{ width: 36, height: 36 }} />
</Dropdown>
</div>
</div>
</div>
</div>
)
}
export default Header
export default Header

View File

@@ -1,6 +1,6 @@
.login-box {
width: 100%;
height: calc(100% - 100px);
height: 100%;
background: url(../../imgs/login_bg.jpg) no-repeat 50%;
background-size: cover;
min-height: 600px;

View File

@@ -40,11 +40,7 @@ const Login = () => {
return (
<div className='login-box'>
<div className='login-container-inner'>
<div className='notes'>
LeNet-5 1998 11 LeNet-5
·Gradient-Based Learning Applied to Document
Recognition
</div>
<div className='notes'></div>
<div className='qrcode-box'>
<div className='qrcode-desc'>
<p></p>