Merge branch '20230215-3.0单点登录2.0' into 'release_20230224'
2.24 3.0单点登录2.0 See merge request eshop/fe_service_ebtp_frontend!170
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { Avatar, Dropdown, Menu, message, Modal } from 'antd';
|
||||
import { DownOutlined, UserOutlined, UserSwitchOutlined, CarryOutOutlined, HomeOutlined, ImportOutlined } from '@ant-design/icons';
|
||||
import React, { useEffect } from 'react';
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import moment from 'moment'
|
||||
import { connect, history } from 'umi';
|
||||
import { ConnectState } from '@/models/connect';
|
||||
@ -8,11 +8,13 @@ import logo from '../../assets/logo.svg';
|
||||
import './index.less';
|
||||
import { getMenu, getLogout } from './services'
|
||||
import { getSessionUserData } from "@/utils/session";
|
||||
import { getToSecondUrl } from '@/pages/LoadingPage/service';
|
||||
|
||||
const GlobalHeaderRight: React.FC<{}> = (props) => {
|
||||
// let className = styles.right;
|
||||
let data = getSessionUserData();
|
||||
const [dataMenu, setDataMenu] = React.useState<any>([]);
|
||||
const urlRef = useRef(null);
|
||||
const handelRole = (item: any) => {
|
||||
sessionStorage.setItem('roleData', JSON.stringify(item));
|
||||
sessionStorage.setItem('roleAuthority', JSON.stringify([item.roleCode]));
|
||||
@ -74,13 +76,23 @@ const GlobalHeaderRight: React.FC<{}> = (props) => {
|
||||
</Menu>
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const getUrl = async () => {
|
||||
const response = await getToSecondUrl();
|
||||
if (response?.success) {
|
||||
urlRef.current = response?.data;
|
||||
}
|
||||
}
|
||||
getUrl();
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="top-menu">
|
||||
<div className="left-logo">
|
||||
<img src={logo} alt="" />中国联通智慧供应链平台 | 招标采购中心
|
||||
</div>
|
||||
<ul className="right-btns">
|
||||
{/* <li><ImportOutlined /><a onClick={()=>window.open(REACT_APP_MALL_V2_URL)}>交易平台2.0</a></li> */}
|
||||
<li><ImportOutlined /><a onClick={() => { urlRef.current && window.open(urlRef.current); }}>交易平台2.0</a></li>
|
||||
<li><HomeOutlined /><a onClick={() => history.push('/Dashboard')}>首页</a></li>
|
||||
<li><CarryOutOutlined />{moment().format("YYYY-MM-DD")}</li>
|
||||
{data?.organizationName == null ? null : (<li><UserSwitchOutlined />{data?.organizationName}</li>)}
|
||||
|
Reference in New Issue
Block a user