diff --git a/src/forge/Information/Pages/apply.jsx b/src/forge/Information/Pages/apply.jsx index 2c07bb12a..77851a710 100644 --- a/src/forge/Information/Pages/apply.jsx +++ b/src/forge/Information/Pages/apply.jsx @@ -2,17 +2,23 @@ import React, { useEffect } from 'react'; import { Form , Input , Row , Col, Button } from 'antd'; import '../index.scss'; import { postCreateZone } from '../api'; +import cookie from 'react-cookies'; const { TextArea } = Input; const phonereg = /^([1][3456789])\d{9}$/ function Apply(props){ - const { form } = props; + const { form , current_user } = props; const { getFieldDecorator , validateFields } = form; -console.log(props); useEffect(()=>{ document.title = '申请创建专区'; },[]) + useEffect(()=>{ + if(!(current_user && current_user.login)){ + props.history.push("/403"); + } + },[current_user]) + function submitFunc(){ validateFields((error,values)=>{ if(!error){ @@ -22,7 +28,7 @@ console.log(props); props.showNotification("提交成功!"); setTimeout(() => { window.location.href="/"; - }, 200); + }, 100); } }).catch(error=>{}) } @@ -39,13 +45,6 @@ console.log(props); callback(); } - - // function checkIndentity(rule, value, callback){ - // if(value && !idenReg.test(value)){ - // callback("专区标识长度2-20,只能以字母开头结尾,可包含数字、下划线、中划线"); - // } - // callback(); - // } return(
diff --git a/src/forge/Information/Pages/selfList.jsx b/src/forge/Information/Pages/selfList.jsx index dbce4ccdf..ab69589d1 100644 --- a/src/forge/Information/Pages/selfList.jsx +++ b/src/forge/Information/Pages/selfList.jsx @@ -4,6 +4,8 @@ import { Link } from 'react-router-dom'; import { getNewsMyList , getSourceMyList , delNewsMyList , delSourceMyList } from '../api'; import moment from 'moment'; import nodata from '../img/nodata.png'; +import { tempEnum } from '../tempInfo'; +import emptydata from '../../Images/nodata.png'; import '../index.scss'; @@ -25,16 +27,29 @@ function SelfList(props){ useEffect(()=>{ if(id){ setIsSpin(true); - if(source===true){ - getSource(); - } - if(source===false){ - getNew(); - } + getFunc(source); } - },[status, page , id,source]) + },[id,source,page]) + useEffect(()=>{ + if(page===1){ + setIsSpin(true); + getFunc(source); + }else{ + setPage(1); + } + },[status]) + + function getFunc(s){ + if(s===true){ + getSource(); + } + if(s===false){ + getNew(); + } + } + useEffect(()=>{ if(pathname){ if(pathname.indexOf("/source/self")>-1){ @@ -113,12 +128,12 @@ function SelfList(props){
- - + +
- {source ? "资源发布": temp==="zone1" ? "新闻资讯":"领域资讯"} + {source ? "资源发布": temp === tempEnum.zone1 ? "新闻资讯":"领域资讯"} 我的{source ? "资源":"文章"}