diff --git a/platform-code/src/library/request/request-umi.ts b/platform-code/src/library/request/request-umi.ts index f732b32..6fe50b5 100644 --- a/platform-code/src/library/request/request-umi.ts +++ b/platform-code/src/library/request/request-umi.ts @@ -72,7 +72,7 @@ const checkMethod = async () => { let pathname = history.location.pathname; pathname = !pathname || pathname.length == 0 ? "" : (pathname[0] == "/" ? pathname.substring(1, pathname.length) : pathname) if (docker.has(pathname) && docker.get(pathname)) return true; - + createAclsMap(); if (!acls || acls.length == 0) return false; @@ -221,7 +221,7 @@ const interceptor = async (url: string, options: RequestOptionsInit) => { else{ //throw "webapi url error." } - + // console.log("check", check) // console.log("request:", url) diff --git a/platform-code/src/microhost/components/rightInfo/index.tsx b/platform-code/src/microhost/components/rightInfo/index.tsx index f026424..7645f12 100644 --- a/platform-code/src/microhost/components/rightInfo/index.tsx +++ b/platform-code/src/microhost/components/rightInfo/index.tsx @@ -15,6 +15,7 @@ import { SystemData } from '@/microhost/models/system' import { string } from 'prop-types'; import { FrameMessage as message1 } from '@/library/union'; import { WebSocketOption as SocketOption, WebSocketLoader as Socket } from "./ws" +import { getLoginId } from '@/utils'; /** @@ -63,8 +64,14 @@ const RightInfo = () => { } option.onMessage = (msgdata: any) => { - setsocketData(JSON.parse(msgdata)) - console.log("on message", msgdata) + + if (getLoginId() == JSON.parse(msgdata).UserNo) { + setsocketData(JSON.parse(msgdata)) + } else { + setsocketData({}) + + } + // console.log("on message", msgdata, getLoginId()) } ws.current = new Socket(option) diff --git a/platform-code/src/utils/index.ts b/platform-code/src/utils/index.ts index 727b3d5..959a032 100644 --- a/platform-code/src/utils/index.ts +++ b/platform-code/src/utils/index.ts @@ -1,4 +1,4 @@ -import {history as umiHistory} from 'umi' +import { history as umiHistory } from 'umi' import localStorageUtil from './localStorageUtil'; import request from './request'; import dataUtil from './dataUtil'; @@ -7,8 +7,14 @@ import timeUtil from './timeUtil'; const DataUtil = new dataUtil(); const DateUtil = new timeUtil(); const LocalStorageUtil = new localStorageUtil(); -export { LocalStorageUtil, request, DataUtil, DateUtil }; +const getLoginId = () => { + let userInfo: any = LocalStorageUtil.get("user_info") + return userInfo && userInfo.loginId ? userInfo.loginId : null -export const qiankunJump = (url:string,name='页面名称',params = null) =>{ - window.__POWERED_BY_QIANKUN__ ? history.pushState(params,name,url): umiHistory.push(url) -} \ No newline at end of file + +} +export { LocalStorageUtil, request, DataUtil, DateUtil, getLoginId }; + +export const qiankunJump = (url: string, name = '页面名称', params = null) => { + window.__POWERED_BY_QIANKUN__ ? history.pushState(params, name, url) : umiHistory.push(url) +}