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 && + ( )} - >} + > (