Commit 51e3c2b5 authored by Bill's avatar Bill

fix: 首页logo

parent 9abd92e2
......@@ -83,6 +83,7 @@ const memberCenterRoute = {
path: '/memberCenter/noAuth',
auth: false,
hideInMenu: true,
name: '无权限',
component: '@/pages/403',
},
// 能力中心的404页
......
This diff is collapsed.
......@@ -120,6 +120,7 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
const breadCrumb = matchedRoutes.slice(2).reduce((prev, current) => {
return prev += "." + current.route.name
}, 'menu')
console.log(breadCrumb);
recent.put(breadCrumb, location.pathname + location.search);
}
......
......@@ -6,7 +6,7 @@ import ProLayout, {
getMenuData,
getPageTitle
} from '@ant-design/pro-layout';
import React, { useState, useEffect, useLayoutEffect } from 'react';
import React, { useState, useEffect, useLayoutEffect, useMemo } from 'react';
import { Link, useIntl, Helmet } from 'umi';
import RightContent from './components/RightContent';
import { GlobalConfig } from '@/global/config';
......@@ -149,7 +149,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
const prolayoutStyle = isHome
? {
minHeight: '100vh',
minWidth: '1280px'
minWidth: '1280px',
}
: {}
......@@ -162,7 +162,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
// formatMessage={formatMessage}
menuHeaderRender={(logoDom, titleDom) => (
<Link to="/">
{logoDom}
{/* {logoDom} */}
{titleDom}
</Link>
)}
......@@ -182,7 +182,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
changeOpenKeys={(keys: string[]) => setOpenKeys(keys)}
/>}
footerRender={() => defaultFooterDom}
rightContentRender={() => <RightContent />}
rightContentRender={() => <RightContent isHome={isHome} />}
{...props}
{...settings}
>
......
......@@ -91,7 +91,9 @@ const MenuSlider: React.FC<MenuSliderProps> = (props) => {
return <>
<OuterSider {...props} />
<Sider theme="light" className="menu_sider" collapsed={props.collapseState}>
<div className={styles.logo}><img src={GlobalConfig.global.siteInfo.logo} /></div>
<Link to={`/`} className={styles.logo}>
<img src={GlobalConfig.global.siteInfo.logo} />
</Link>
<div className={styles.menuTitle}>
{menuRouter?.name}
</div>
......
import { Tooltip, Badge } from 'antd';
import { BellOutlined, CustomerServiceOutlined } from '@ant-design/icons';
import React, { useCallback, useRef, useLayoutEffect, useState, useEffect } from 'react';
import React, { useCallback, useRef, useLayoutEffect, useState, useEffect, useMemo } from 'react';
import Avatar from './AvatarDropdown';
import SelectLang from './SelectLang';
import Location from './Location';
......@@ -12,6 +12,7 @@ import { getAuth } from '@/utils/auth';
import { getCookie } from '@/utils/cookie'
import { notificationChatRoom } from '@/utils/im'
import { SOCKET_URL, PLATFORM_DOMAIN } from '@/constants';
import { GlobalConfig } from '@/global/config';
import { usePurchaseBidStore } from '@/store/purchaseBid';
......@@ -38,8 +39,8 @@ type WsMessage = {
timestamp: number
}
const GlobalHeaderRight: React.FC<{ SiteStore?: any }> = (props) => {
const { SiteStore: { currentLayoutInfo } } = props;
const GlobalHeaderRight: React.FC<{ SiteStore?: any, isHome: boolean }> = (props) => {
const { SiteStore: { currentLayoutInfo }, isHome } = props;
const [message, setMessage] = useState<number>(0);
const className = styles.right;
......@@ -73,7 +74,7 @@ const GlobalHeaderRight: React.FC<{ SiteStore?: any }> = (props) => {
if (data.action === 'msg_no_read_message') {
setMessage(+data.data);
}
};
ws.current.onclose = (e) => {
console.log("关闭连接")
......@@ -82,7 +83,7 @@ const GlobalHeaderRight: React.FC<{ SiteStore?: any }> = (props) => {
console.log("socket 出错")
}
}
}, [ws]);
}, [ws, userInfo]);
useEffect(() => {
webSocketInit();
......@@ -99,34 +100,52 @@ const GlobalHeaderRight: React.FC<{ SiteStore?: any }> = (props) => {
window.location.href = PLATFORM_DOMAIN
}
}
const cacheStyle = useMemo(() => {
return {
isHome: { marginLeft: '-40px' },
iamge: { height: "30px", marginRight: '12px' }
}
}, [])
return (
<div className={className}>
<span style={{ color: 'rgba(0, 0, 0, 0.85)', cursor: "pointer" }} onClick={handleBackMall}>返回商城</span>
<Roles />
{/* <Location /> */}
<SelectLang />
<Tooltip title="消息">
<Link
to="/memberCenter/systemSetting/message"
className={styles.action}
>
<Badge count={message} size={"small"}>
<BellOutlined />
</Badge>
<div>
<Link to={"/"} className={styles.container} style={isHome ? cacheStyle.isHome : {}}>
{
isHome && (
<img src={GlobalConfig.global.siteInfo.logo} style={cacheStyle.iamge} />
)
}
数商云瓴犀业务中台能力中心
</Link>
</Tooltip>
{/* <Tooltip title="服务">
<a
target="_blank"
href=""
rel="noopener noreferrer"
className={styles.action}
>
<CustomerServiceOutlined />
</a>
</Tooltip> */}
<Avatar />
</div>
<div className={styles.rightContent}>
<span style={{ color: 'rgba(0, 0, 0, 0.85)', cursor: "pointer" }} onClick={handleBackMall}>返回商城</span>
<Roles />
{/* <Location /> */}
<SelectLang />
<Tooltip title="消息">
<Link
to="/memberCenter/systemSetting/message"
className={styles.action}
>
<Badge count={message} size={"small"}>
<BellOutlined />
</Badge>
</Link>
</Tooltip>
{/* <Tooltip title="服务">
<a
target="_blank"
href=""
rel="noopener noreferrer"
className={styles.action}
>
<CustomerServiceOutlined />
</a>
</Tooltip> */}
<Avatar />
</div>
</div>
);
};
......
......@@ -14,12 +14,32 @@
.right {
display: flex;
float: right;
flex-direction: row;
align-items: center;
width: 100%;
// float: right;
height: @layout-header-height;
margin-left: auto;
overflow: hidden;
// overflow: hidden;
font-size: 12px;
padding: 0 16px;
position: relative;
justify-content: space-between;
.container {
font-size: 16px;
display: flex;
flex-direction: row;
align-items: center;
color: #000;
}
.rightContent {
display: flex;
flex-direction: row;
align-items: center;
}
.action {
display: flex;
......
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