Commit 5d003629 authored by Bill's avatar Bill

修改app.tsx dev环境也需要登录,不然首页因没有用户信息而报错

parent c58ddae0
......@@ -172,9 +172,9 @@ export function onRouteChange({ routes, matchedRoutes, location, action }) {
recent.put(breadCrumb, location.pathname + location.search);
}
if (isDev) {
return;
}
// if (isDev) {
// return;
// }
if (whiteLists.includes(location.pathname)) {
return
......
......@@ -30,7 +30,7 @@ const GlobalHeaderRight: React.FC<{}> = (props) => {
const ws = useRef<WebSocket | null>(null);
const webSocketInit = useCallback(() => {
console.log(ws.current)
if (!ws.current || ws.current.readyState === 3) {
if ((!ws.current || ws.current.readyState === 3) && userInfo) {
ws.current = new WebSocket(`${SOCKET_URL}/report/websocket?memberId=${userInfo.memberId}&roleId=${userInfo.memberRoleId}`);
ws.current.onopen = (e) => {
console.log(e)
......
......@@ -27,7 +27,7 @@ const UserCenter: React.FC<Iprops> = () => {
<div className={styles.header}>
<div className={styles.infos}>
<div className={styles.hi}>
{`Hi, ${userAuth.name}! 欢迎来到数商云瓴犀业务中台能力中心`}
{`Hi, ${userAuth?.name}! 欢迎来到数商云瓴犀业务中台能力中心`}
</div>
<div className={styles.date}>
{today.format('YYYY年MM月DD日')} 星期{WEEKDAYS[today.day()]}
......@@ -40,7 +40,7 @@ const UserCenter: React.FC<Iprops> = () => {
<div className={styles.content}>
<Row className={styles.row}>
<Col span={11} className={styles.user}>
<div className={styles.pic} style={!userAuth.logo ? {display: 'none'} : {}}>
<div className={styles.pic} style={!userAuth?.logo ? {display: 'none'} : {}}>
<img src={userAuth.logo} />
</div>
<div className={styles.wrapper}>
......
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