diff --git a/src/forge/Information/Pages/newsCreate.jsx b/src/forge/Information/Pages/newsCreate.jsx index b4e283848..1e68f5054 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} = props; + const {history, id, role} = props; const temp = props.temp; const { getFieldDecorator, validateFields , setFieldsValue, setFields } = props.form; const { deptId, id: newsId } = props.match.params; @@ -27,6 +27,12 @@ function NewsCreate(props){ wrapperCol: { span: 14 }, }; + useEffect(()=>{ + if(role && role.role === "None"){ + history.push(`/zone/${deptId}`); + } + }, [role]) + useEffect(()=>{ id && getDircList(); },[id]) diff --git a/src/forge/Information/Pages/sourceCreate.jsx b/src/forge/Information/Pages/sourceCreate.jsx index 14c630333..86a5cf8a8 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} = props; + const {history, id, role} = props; const { getFieldDecorator, validateFields , setFieldsValue, setFields } = props.form; const { deptId, sourceid} = props.match.params; const pathname = props.location.pathname; @@ -20,6 +20,12 @@ function SourceCreate(props){ wrapperCol: { span: 14 }, }; + useEffect(()=>{ + if(role && role.role === "None"){ + history.push(`/zone/${deptId}`); + } + }, [role]) + useEffect(()=>{ id && getZoneList(); },[id]) diff --git a/src/forge/Information/fetch.js b/src/forge/Information/fetch.js index c9057bca0..29cc15d28 100644 --- a/src/forge/Information/fetch.js +++ b/src/forge/Information/fetch.js @@ -7,7 +7,6 @@ function beforeFetch(actionUrl){ } const service = axios.create({ - headers:{Authorization:"fb55fcaae60bb0c341078dade4b37c965e285394"}, baseURL: actionUrl, timeout: 1800000, // 请求超时时间 }); diff --git a/src/forge/Information/index.jsx b/src/forge/Information/index.jsx index 9ee250f40..942d814e4 100644 --- a/src/forge/Information/index.jsx +++ b/src/forge/Information/index.jsx @@ -162,16 +162,16 @@ function Index(props){ )} > - {role && role.role !== "None" && ( - + )} >} - {role && role.role !== "None" && ( - + )} >} )} > - {role && role.role !== "None" && ( - + )} >} - {role && role.role !== "None" && ( - + )} >}