diff --git a/src/AppConfig.js b/src/AppConfig.js index 9ca6363a5..cf7fe8b6a 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -25,7 +25,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 || '' + window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin' } window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/src/forge/Settings/Setting.js b/src/forge/Settings/Setting.js index fdf557c53..cde5b9b9a 100644 --- a/src/forge/Settings/Setting.js +++ b/src/forge/Settings/Setting.js @@ -29,6 +29,7 @@ class Setting extends Component { CategoryList: undefined, LanguageList: undefined, private_check: undefined, + prview_check:undefined, loading:true, project_units:['home',"activity","code"], divertVisible:false, @@ -93,6 +94,7 @@ class Setting extends Component { this.setState({ projectName:result.data.project_name, private_check: result.data.private, + prview_check:result.data.pr_view_admin, loading:false, project_units:units, transfer:result.data.transfer, @@ -224,6 +226,11 @@ class Setting extends Component { }); }; + changePrview=(e) => { + this.setState({ + prview_check: e.target.checked, + }); + }; // 转移仓库 DivertProject=()=>{ this.setState({ @@ -266,7 +273,7 @@ class Setting extends Component { const { projectsId , owner } = this.props.match.params; const { projectDetail } = this.props; - const { CategoryList, LanguageList, private_check ,loading , divertVisible , is_transfering, transfer } = this.state; + const { CategoryList, LanguageList, private_check , prview_check ,loading , divertVisible , is_transfering, transfer } = this.state; let mirror = projectDetail && projectDetail.mirror; let type = projectDetail && projectDetail.type; const forked_from_project_id = this.props && this.props.projectDetail && this.props.projectDetail.forked_from_project_id; @@ -361,6 +368,26 @@ class Setting extends Component { )} + 访问权限: +