From 7f2f8c8a129d435fda2620b73349b71dd4d328c1 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:06:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=97=A0=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Information/Pages/newsCreate.jsx | 8 +++++++- src/forge/Information/Pages/sourceCreate.jsx | 8 +++++++- src/forge/Information/fetch.js | 1 - src/forge/Information/index.jsx | 16 ++++++++-------- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/forge/Information/Pages/newsCreate.jsx b/src/forge/Information/Pages/newsCreate.jsx index b4e28384..1e68f505 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 14c63033..86a5cf8a 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 c9057bca..29cc15d2 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 9ee250f4..942d814e 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" && ( - + )} >}