Commit 51e3c2b5 authored by Bill's avatar Bill

fix: 首页logo

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