diff --git a/src/AppConfig.js b/src/AppConfig.js index 68dd5439a..d0955ca6e 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -39,7 +39,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 || '' } // 超管 // debugType="admin"; diff --git a/src/forge/Index.js b/src/forge/Index.js index e76fd4d9f..893cfc2f3 100644 --- a/src/forge/Index.js +++ b/src/forge/Index.js @@ -33,14 +33,8 @@ const ProjectDetail = Loadable({ }) class Index extends Component{ - constructor(props){ - super(props); - } - - render(){ - console.log("123",this.props); return(
diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 3d5e28cc1..bce11f4d1 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -138,7 +138,7 @@ class Detail extends Component{ forked_count:undefined, http_url: undefined, author:undefined, - current_user:undefined, + // current_user:undefined, branchs:undefined, branchList:undefined, @@ -161,15 +161,10 @@ class Detail extends Component{ componentDidMount=()=>{ - this.getUserInfo(); + // this.getUserInfo(); this.getDetail(); } - // componentDidUpdate=(provState)=>{ - // if(provState.match.params.projectsId !== this.props.match.params.projectsId){ - // this.getDetail(); - // } - // } getDetail=()=>{ const { projectsId } = this.props.match.params; @@ -274,7 +269,6 @@ class Detail extends Component{ branchList:result.data, branchs, branchLastCommit:result.data[0], - // http_url:result.data[0].http_url }) } }).catch((error)=>{}) @@ -282,14 +276,16 @@ class Detail extends Component{ render(){ - const { projectDetail , watchers_count , praises_count , forked_count , project_id , current_user } = this.state; + const { projectDetail , watchers_count , praises_count , forked_count } = this.state; const url = this.props.history.location.pathname; const urlArr= url.split("/"); const urlFlag = (urlArr.length === 3); - const { isManager , isDeveloper } = this.props; + + const { isManager } = this.props; const { projectsId } = this.props.match.params; const { state } = this.props.history.location; + return(
@@ -344,55 +340,55 @@ class Detail extends Component{ {/* 新建文件 */} () + (props) => () } > () + (props) => () } > {/* 标签列表 */} () + (props) => () } > {/* 仓库设置 */} () + (props) => () } > {/* 工单详情 */} () + (props) => () } > {/* 里程碑 */} () + (props) => () } > {/* 新建里程碑 */} () + (props) => () } > {/*里程碑详情*/ } () + (props) => () } > {/*修改里程碑*/} () + (props) => () } > @@ -401,28 +397,28 @@ class Detail extends Component{ () + (props) => () } > {/* 修改详情 */} () + (props) => () } > {/* 复制详情 */} () + (props) => () } > {/* 动态 */} () + (props) => () } > @@ -430,66 +426,66 @@ class Detail extends Component{ {/* 代码Index */} () + (props) => () } > () + (props) => () } > () + (props) => () } > () + (props) => () } > () + (props) => () } > () + (props) => () } > () + (props) => () } > () + (props) => () } > () + (props) => () } > () + (props) => () } > () + (props) => () } > diff --git a/src/forge/Main/Index.js b/src/forge/Main/Index.js index 2c13704a1..bafed7671 100644 --- a/src/forge/Main/Index.js +++ b/src/forge/Main/Index.js @@ -177,6 +177,7 @@ class Index extends Component{ } render(){ + const { current_user } = this.props; const menu=( 更新时间排序 @@ -200,6 +201,8 @@ class Index extends Component{
:"" ) + + return(

@@ -218,12 +221,14 @@ class Index extends Component{
- - - - 新建 - - + { + current_user && current_user.login && + + + 新建 + + + } diff --git a/src/forge/New/Index.js b/src/forge/New/Index.js index 8a42f2b4e..68ec6cad7 100644 --- a/src/forge/New/Index.js +++ b/src/forge/New/Index.js @@ -23,7 +23,6 @@ class Index extends Component{ GitignoreList:undefined, LicensesList:undefined, isSpin:false, - current_user:undefined } } getUserInfo=()=>{ @@ -40,7 +39,7 @@ class Index extends Component{ }) } componentDidMount=()=>{ - this.getUserInfo(); + // this.getUserInfo(); // 获取项目类别 this.getCategory(); // 获取项目语言 @@ -116,7 +115,7 @@ class Index extends Component{ }) this.props.form.validateFieldsAndScroll((err, values) => { if(!err){ - const { current_user } = this.state; + const { current_user } = this.props; const { projectsType } =this.props.match.params; const url = projectsType === "deposit" ? "/projects.json" :"/projects/migrate.json"; axios.post(url,{ @@ -129,7 +128,7 @@ class Index extends Component{ isSpin:false }) this.props.showNotification(`${projectsType === "deposit" ? "托管" :"镜像"}项目创建成功!`); - this.props.history.push(`/projects/${result.data.identifier}/${current_user && current_user.login}/coders`); + this.props.history.push(`/projects/${result.data.id}/coders`); } } }).catch((error)=>{ @@ -148,7 +147,6 @@ class Index extends Component{ render(){ const { getFieldDecorator } = this.props.form; - console.log(this.props); // 项目类型:deposit-托管项目,mirror-镜像项目 const { projectsType } =this.props.match.params; const { @@ -165,6 +163,8 @@ class Index extends Component{ LicensesList, isSpin }=this.state; + + console.log("current_user",this.props); return(
diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js index 81c12edba..be6d6e85b 100644 --- a/src/modules/tpm/NewHeader.js +++ b/src/modules/tpm/NewHeader.js @@ -730,21 +730,18 @@ submittojoinclass=(value)=>{ try { var chromesettingArray = JSON.parse(localStorage.getItem('chromesetting')); var chromesettingresponseArray = JSON.parse(localStorage.getItem('chromesettingresponse')); - // console.log("NewHeaderNewHeaderNewHeader"); - // console.log(chromesettingArray); - // console.log(chromesettingresponseArray); - - this.setState({ - mygetHelmetapi2:chromesettingArray - }); - if (chromesettingArray.tab_logo_url) { - this.gettablogourldata(chromesettingresponseArray); - } else { - this.gettablogourlnull(); - } + + this.setState({ + mygetHelmetapi2:chromesettingArray + }); + if (chromesettingArray.tab_logo_url) { + this.gettablogourldata(chromesettingresponseArray); + } else { + this.gettablogourlnull(); + } }catch (e) { - console.log("head获取游览器配置失败 重新请求开始读取配置"); - this.geturlsdata(); + // console.log("head获取游览器配置失败 重新请求开始读取配置"); + this.geturlsdata(); } };