diff --git a/src/AppConfig.js b/src/AppConfig.js index ca941733..82a5cb78 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -27,14 +27,14 @@ 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 || '15243705227' } function clearAllCookie() { cookie.remove('_educoder_session', { path: '/' }); cookie.remove('autologin_trustie', { path: '/' }); setpostcookie() } -clearAllCookie(); +// clearAllCookie(); function setpostcookie() { const str = window.location.pathname; if (str.indexOf("/wxcode") !== -1) { diff --git a/src/common/UrlTool.js b/src/common/UrlTool.js index 6b3d3564..9b4d5191 100644 --- a/src/common/UrlTool.js +++ b/src/common/UrlTool.js @@ -6,12 +6,12 @@ const { Search } = Input; const $ = window.$; const isDev = window.location.port == 3007; const isdev2= window.location.hostname ==='www.educoder.net' -export const TEST_HOST = "https://testforgeplus.trustie.net/" +export const TEST_HOST = "http://39.105.176.215:49999" export function getImageUrl(path) { // https://www.educoder.net // https://testbdweb.trustie.net // const local = 'http://localhost:3000' - const local = 'https://testforgeplus.trustie.net'; + const local = 'http://39.105.176.215:49999'; if (isDev) { return `${local}/${path}` } @@ -22,7 +22,7 @@ export function getImage(path) { // https://www.educoder.net // https://testbdweb.trustie.net // const local = 'http://localhost:3000' - const local = 'https://testforgeplus.trustie.net/'; + const local = 'http://39.105.176.215:49999'; if(path.indexOf("http://")===-1){ if (isDev) { return `${local}/images/${path}` @@ -93,7 +93,7 @@ export function setImagesUrl(path){ } export function getUrl(path, goTest) { - const local = 'https://testforgeplus.trustie.net' + const local = 'http://39.105.176.215:49999' if (isDev) { return `${local}${path?path:''}` } diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 6ea90526..1ddef304 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -181,6 +181,7 @@ class Detail extends Component { } getProject = (num) => { + const {user} = this.props; const { projectsId , owner } = this.props.match.params; const url = `/${owner}/${projectsId}/simple.json`; axios.get(url).then((result) => { @@ -191,7 +192,7 @@ class Detail extends Component { platform:result.data.platform && result.data.platform !== 'educoder' }) let signa = result.data.user_apply_signatures && result.data.user_apply_signatures[0]; - if(result.data.is_secret && (signa && signa.status !== "passed")){ + if(result.data.is_secret && (!signa || (signa && signa.status !== "passed")) && user.login !== owner){ this.setState({ visible:true, is_secret:result.data.is_secret, diff --git a/src/forge/Settings/Index.js b/src/forge/Settings/Index.js index 4a22b3d3..2196018e 100644 --- a/src/forge/Settings/Index.js +++ b/src/forge/Settings/Index.js @@ -28,6 +28,10 @@ const Tags = Loadable({ loader: () => import("./new_tags"), loading: Loading, }); +const Special = Loadable({ + loader: () => import("./SpecialProject"), + loading: Loading, +}); const Manage = Loadable({ loader: () => import("./ManageWeb"), loading: Loading, @@ -39,6 +43,7 @@ const ManageNew = Loadable({ class Index extends Component { render() { const { projectsId , owner } = this.props.match.params; + const { user } = this.props; const { pathname } = this.props.history.location; const flag = pathname === `/projects/${owner}/${projectsId}/setting`; @@ -87,6 +92,20 @@ class Index extends Component {

+ { + user && user.login === owner ? +
  • -1 ? "active" : ""} + > +

    + + + 特殊开源许可证项目管理 + +

    +
  • + :"" + } {/*
  • )} > + + ( + + )} + > {/* 修改仓库信息 */} + ( diff --git a/src/forge/Settings/SpecialProject.jsx b/src/forge/Settings/SpecialProject.jsx new file mode 100644 index 00000000..197af884 --- /dev/null +++ b/src/forge/Settings/SpecialProject.jsx @@ -0,0 +1,187 @@ +import React , { useEffect , useState} from 'react'; +import { Input , Table , Pagination, Button , Dropdown , Menu } from 'antd'; +import { Banner , WhiteBack , AlignCenterBetween } from '../Component/layout'; +import axios from 'axios'; + +const { Search } = Input; + +const LIMIT = 15; +function SpecialProject(props){ + const [ page , setPage] = useState(1); + const [ searchValue , SetSearchValue ] = useState(undefined); + const [ total , setTotal ] = useState(0); + const [ list , setList ] = useState(undefined); + const [ status , setStatus ] = useState(undefined); + const [ loading ,setLoading ] = useState(true); + + const { owner , projectsId} = props.match.params; + console.log(props); + const { project_id } = props; + + useEffect(()=>{ + if(project_id){ + setLoading(true); + Init(searchValue, status); + } + },[page,project_id]); + + function Init(search,status){ + const url = `/apply_signatures.json`; + axios.get(url,{ + params:{ + project_id, + page,limit:LIMIT,search,status + } + }).then(result=>{ + setLoading(false); + if(result){ + setList(result.data.apply_signatures); + setTotal(result.data.total_count); + } + }).catch(error=>{}) + } + + function changePage(page){ + setLoading(true); + setPage(page); + } + + const column = [ + { + dataIndex:"column", + key:1, + width:"12%", + title:"序号", + render:(txt,item,index)=>{ + return `${index+1}` + } + }, + { + dataIndex:"name", + key:2, + title:"申请人", + render:(text,item,m)=>{ + return item.user && {item.user.name} + } + }, + { + dataIndex:"email", + key:2, + title:"邮箱", + width:"22%", + render:(text,item,m)=>{ + return item.user && {item.user.email} + } + }, + { + dataIndex:"attachment", + key:3, + title:"附件", + width:"28%", + render:(text,item,m)=>{ + return item.attachment && {item.attachment.filename} + } + }, + { + dataIndex:"operation", + key:4, + width:"18%", + title:"操作", + render:(text, item) =>{ + return( + + { + item.status === "waiting" && + + + + + } + { + item.status === "unpassed" && + 已拒绝 + } + { + item.status === "passed" && + 已同意 + } + + ) + } + } + ] + // 拒绝&同意 + function operation(ids,s){ + setLoading(true); + const url = `/apply_signatures/${ids}.json`; + axios.put(url,{ + project_id:project_id, + status:s + }).then(result=>{ + setLoading(false); + if(result){ + props.showNotification(`${s==="passed"?"同意":"拒绝"}此申请已操作成功!`); + Init(searchValue,status); + } + }).catch(error=>{setLoading(false)}) + } + + function searchList(){ + setLoading(true); + Init(searchValue,status); + } + + const menu=( + + 全部 + 审核中 + 已拒绝 + 已同意 + + ) + + function chooseStatus(e){ + setStatus(e.key); + Init(searchValue, e.key); + } + + + return( + + 项目管理 + + SetSearchValue(e.target.value)} + onSearch={searchList} + /> + + + {status ==="waiting"?"审核中":status==="unpassed"?"已拒绝":status==="passed"?"已同意":"全部"} + + + + + record.id} + pagination={false} + dataSource={list} + loading={loading} + >
    + { + total > LIMIT && +
    + +
    + } + +
    + ) +} +export default SpecialProject; \ No newline at end of file diff --git a/src/forge/Settings/setting.scss b/src/forge/Settings/setting.scss index 3d1d6aeb..affc9838 100644 --- a/src/forge/Settings/setting.scss +++ b/src/forge/Settings/setting.scss @@ -139,6 +139,7 @@ .padding15-10{ padding:15px 10px; } +.center{text-align: center;} .w-100{width: 100%;} .fwb{font-weight: 600;} .text-black{color: #333;}