diff --git a/public/css/edu-purge.css b/public/css/edu-purge.css index 1ec10446..0d146204 100644 --- a/public/css/edu-purge.css +++ b/public/css/edu-purge.css @@ -2456,7 +2456,7 @@ a.hoverLine:hover{ .color-grey-9 { - color: #333333 !important; + color: #999 !important; } a:hover{ diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js index 59513153..ac139351 100644 --- a/src/forge/Head/Header.js +++ b/src/forge/Head/Header.js @@ -367,7 +367,6 @@ class NewHeader extends Component { } let search_url = settings && settings.common && settings.common.search; - let notice_url = settings && settings.common && settings.common.notice; return (
@@ -438,7 +437,7 @@ class NewHeader extends Component { :"" } - {current_user && current_user.login ? + { (settings && settings.common && settings.common.notice) && (current_user && current_user.login)? - + {current_user && - + } : "" diff --git a/src/forge/SecuritySetting/Index.jsx b/src/forge/SecuritySetting/Index.jsx index 8419fd31..f897dea1 100644 --- a/src/forge/SecuritySetting/Index.jsx +++ b/src/forge/SecuritySetting/Index.jsx @@ -43,8 +43,9 @@ const PrivateLetter = Loadable({ }); function Index(props){ - const { current_user } = props; + const { current_user,mygetHelmetapi } = props; const { pathname } = props.location; + const notice_url = mygetHelmetapi && mygetHelmetapi.common && mygetHelmetapi.common.notice; return(
@@ -59,11 +60,11 @@ function Index(props){
  • 个人信息
  • -1 ?"active":""}>基本资料
  • -
      + {notice_url &&
      • 消息通知
      • -1 && pathname.indexOf("/settings/notice/config") == -1) || pathname.indexOf("/settings/notice/privateLetter")>-1 ?"active":""}>我的通知
      • {/*
      • -1 ?"active":""}>通知管理
      • */} -
      +
    }
    • 安全设置
    • -1 ?"active":""}>SSH密钥
    • diff --git a/src/forge/SecuritySetting/notice/myNotice/Index.jsx b/src/forge/SecuritySetting/notice/myNotice/Index.jsx index 2de2b8c3..22660691 100644 --- a/src/forge/SecuritySetting/notice/myNotice/Index.jsx +++ b/src/forge/SecuritySetting/notice/myNotice/Index.jsx @@ -9,10 +9,9 @@ import './Index.scss'; import '../manager/Index.scss' function MyNotice(props) { - let current_user = props.current_user; - let resetUserInfo = props.resetUserInfo; + let { current_user, resetUserInfo, location, mygetHelmetapi, history}= props; //消息悬停框选择tab - let popover = props.location.query && props.location.query.noticeType; + let popover = location && location.query && location.query.noticeType; let pageSize = 15; const [noticeType, setNoticeType] = useState(popover==="atme"?"2":"0");//消息类别tab栏选择 const [selectedNum, setSelectedNum] = useState(0);//@我批量删除选择消息条数 @@ -27,6 +26,18 @@ function MyNotice(props) { const [currentPage, setCurrentPage] = useState(1);//当前页数 const [onlyUnread, setOnlyUnread] = useState(); + //登录情况下,通过地址访问,直接跳转:/settings/profile + //未登录情况下,通过地址访问,直接跳转:/explore + useEffect(()=>{ + let notice = mygetHelmetapi && mygetHelmetapi.common && mygetHelmetapi.common.notice; + let login = current_user && current_user.login; + if(!login){ + history.push(`/explore`); + }else if(!notice){ + history.push(`/settings/profile`); + } + },[mygetHelmetapi]) + useEffect(()=>{ popover==="atme" ? setNoticeType("2"):setNoticeType("0"); },[popover]) @@ -46,7 +57,7 @@ function MyNotice(props) { limit: pageSize, page: currentPage, }; - axios.get(`/users/${current_user.login}/messages.json`, { + current_user && axios.get(`/users/${current_user.login}/messages.json`, { params: params, }).then((response) => { if(response && response.data){ @@ -59,7 +70,7 @@ function MyNotice(props) { } function readNotice(id){ - if(id){ + if(id && current_user){ const params = { type: noticeType === "0" ? "notification" : noticeType === "2" ? "atme" : "", ids:id, diff --git a/src/forge/Settings/Setting.js b/src/forge/Settings/Setting.js index ec9f80c8..460ec162 100644 --- a/src/forge/Settings/Setting.js +++ b/src/forge/Settings/Setting.js @@ -161,12 +161,12 @@ class Setting extends Component { loading:false }) this.props.showNotification(`仓库信息修改成功!`); - // if(values.project_identifier !== projectsId){ - // this.props.history.push(`/${owner}/${values.project_identifier}/settings`); - // }else{ - // } + if(values.project_identifier !== projectsId){ + this.props.history.push(`/${owner}/${values.project_identifier}/settings`); + }else{ const { getDetail } = this.props; getDetail && getDetail(); + } } }).catch((error) => { console.log(error); @@ -288,7 +288,9 @@ class Setting extends Component { )}
    - {/* + 项目标识 (项目url标识部分,更改项目标识将导致原仓库地址失效)} + > {getFieldDecorator("project_identifier", { rules: [ { @@ -299,7 +301,7 @@ class Setting extends Component { })( )} - */} + {getFieldDecorator("project_description", { rules: [],