ソースを参照

feat: 登录页不触发websocket员工状态通信

lanjianrong 4 年 前
コミット
b21506e56f
2 ファイル変更3 行追加2 行削除
  1. 2 1
      src/app.tsx
  2. 1 1
      src/pages/Product/Cloud/index.jsx

+ 2 - 1
src/app.tsx

@@ -78,7 +78,8 @@ export const layout = ({ initialState, setInitialState }) => {
       if (!initialState?.currentUser?.staffId && location.pathname !== loginPath) {
         history.replcae('/user/login')
       } else {
-        tryChangeWorkStatus(initialState?.currentUser?.staffId, location.pathname)
+        location.pathname !== loginPath &&
+          tryChangeWorkStatus(initialState?.currentUser?.staffId, location.pathname)
       }
 
       // if (

+ 1 - 1
src/pages/Product/Cloud/index.jsx

@@ -1,5 +1,5 @@
 /* eslint-disable no-underscore-dangle */
-import React, { useState, useEffect } from 'react'
+import React, { useState, useEffect, useRef } from 'react'
 import BasicTable from '@/components/Table'
 import { dayjsFormat, refactorSortField } from '@/utils/utils'
 import { queryRoadpricingList } from '@/services/product'