From 5d0f4df7e9cd72ac04433d2bca520687ccb65624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Mon, 25 Sep 2023 10:34:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppConfig.js | 2 +- src/forge/Information/Pages/newsCreate.jsx | 4 ++-- src/forge/Information/Pages/sourceCreate.jsx | 4 ++-- src/forge/Information/index.jsx | 16 ++++++++-------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index cf7fe8b6a..9ca6363a5 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -25,7 +25,7 @@ if (isDev) { } debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' : window.location.search.indexOf('debug=s') !== -1 ? 'student' : - window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin' + window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || '' } window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/src/forge/Information/Pages/newsCreate.jsx b/src/forge/Information/Pages/newsCreate.jsx index 1e68f5054..5926af15d 100644 --- a/src/forge/Information/Pages/newsCreate.jsx +++ b/src/forge/Information/Pages/newsCreate.jsx @@ -11,7 +11,7 @@ import { addNewsByDirId, getDirListById, getNewsDetailByAu, updateDoc } from '.. import { httpUrl } from '../fetch'; function NewsCreate(props){ - const {history, id, role} = props; + const {history, id, role, current_user} = props; const temp = props.temp; const { getFieldDecorator, validateFields , setFieldsValue, setFields } = props.form; const { deptId, id: newsId } = props.match.params; @@ -28,7 +28,7 @@ function NewsCreate(props){ }; useEffect(()=>{ - if(role && role.role === "None"){ + if((role && role.role === "None") || (current_user && !current_user.login)){ history.push(`/zone/${deptId}`); } }, [role]) diff --git a/src/forge/Information/Pages/sourceCreate.jsx b/src/forge/Information/Pages/sourceCreate.jsx index 86a5cf8a8..9b99a3f98 100644 --- a/src/forge/Information/Pages/sourceCreate.jsx +++ b/src/forge/Information/Pages/sourceCreate.jsx @@ -6,7 +6,7 @@ import { Link } from 'react-router-dom'; import { getTypeByFileId, getSourceZoneList, addResource, getSourceDetailByAu, updateMyResource } from '../api'; function SourceCreate(props){ - const {history, id, role} = props; + const {history, id, role, current_user} = props; const { getFieldDecorator, validateFields , setFieldsValue, setFields } = props.form; const { deptId, sourceid} = props.match.params; const pathname = props.location.pathname; @@ -21,7 +21,7 @@ function SourceCreate(props){ }; useEffect(()=>{ - if(role && role.role === "None"){ + if((role && role.role === "None") || (current_user && !current_user.login)){ history.push(`/zone/${deptId}`); } }, [role]) diff --git a/src/forge/Information/index.jsx b/src/forge/Information/index.jsx index 942d814e4..599fdbd01 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -162,18 +162,18 @@ function Index(props){ )} > - {current_user && current_user.login && ( )} - >} - {current_user && current_user.login && + ( )} - >} + > ( @@ -192,18 +192,18 @@ function Index(props){ )} > - {current_user && current_user.login && ( )} - >} - {current_user && current_user.login && + ( )} - >} + > (