Merge remote-tracking branch 'origin/pre_gitlink_server' into gitlink_ssr_head

This commit is contained in:
黄心宇 2024-04-26 10:45:59 +08:00
commit edf09f069f
23 changed files with 125 additions and 115 deletions

View File

@ -198,7 +198,7 @@
"eslintConfig": {
"extends": "react-app"
},
"proxy": "http://172.20.32.202:4000",
"proxy": "https://testforgeplus.trustie.net",
"port": "3007",
"devDependencies": {
"@babel/core": "^7.23.6",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -50,6 +50,7 @@
<script src="%PUBLIC_URL%js/codemirror/merge/merge.js"></script>
<script src="%PUBLIC_URL%js/alex/moment.js"></script>
<script src="https://gw.alipayobjects.com/os/lib/alipay/alex/2.0.19/bundle/alex.all.global.min.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<meta name="viewport" content="">
<%= htmlWebpackPlugin.tags.bodyTags %>
<script>

View File

@ -20,11 +20,9 @@ import SiderBar from './forge/Component/SiderBar';
import SiderBarHelp from './glcc/siderBarHelp';
// import GlccModal from './modules/glccModal';
import { SnackbarHOC } from 'educoder';
import { SnackbarHOC, configShareForCustom } from 'educoder';
import { initAxiosInterceptors } from './AppConfig'
import cookie from 'react-cookies';
import InfosIndex from './forge/users/Index'
import OrganizeIndex from './forge/Team/Index'
window.marked = marked;
const theme = createMuiTheme({
@ -76,15 +74,15 @@ const http500 = Loadable({
loader: () => import('./modules/500/http500'),
loading: Loading,
})
// const InfosIndex = Loadable({
// loader: () => import('./forge/users/Index'),
// loading: Loading,
// })
const InfosIndex = Loadable({
loader: () => import('./forge/users/Index'),
loading: Loading,
})
// 组织
// const OrganizeIndex = Loadable({
// loader: () => import('./forge/Team/Index'),
// loading: Loading,
// })
const OrganizeIndex = Loadable({
loader: () => import('./forge/Team/Index'),
loading: Loading,
})
const Search = Loadable({
loader: () => import('./modules/search/'),
@ -301,6 +299,9 @@ class App extends Component {
this.setState({
mygetHelmetapi: response.data.setting
});
configShareForCustom(response.data.name)
//存储配置到游览器
localStorage.setItem('chromesetting', JSON.stringify(response.data.setting));
localStorage.setItem('chromesettingresponse', JSON.stringify(response));

View File

@ -148,7 +148,7 @@ export function getUrl(path, goTest) {
// if (isDev) {
// return `${local}${path?path:''}`
// }
return `${path ? path: TEST_HOST}`;
return `${path ? path: ''}`;
}
export function getZoneUrl(path) {

View File

@ -1,13 +1,20 @@
import axios from 'axios'
const host = window.location.protocol + '//' + window.location.host
const wx = window.wx
const appId = 'wxf8debe756b4a0309'
let settings = localStorage.chromesetting&&JSON.parse(localStorage.chromesetting);
let actionUrl = settings && settings.common.zone +'/api';
const service = axios.create({
baseURL: actionUrl,
timeout: 1800000, // 请求超时时间
});
function share(shareData) {
try {
wx.onMenuShareAppMessage(shareData);//分享给好友
wx.onMenuShareTimeline(shareData);//分享到朋友圈
wx.onMenuShareQQ(shareData);//分享给手机QQ
wx.onMenuShareWeibo(shareData);//分享腾讯微博
wx.onMenuShareQZone(shareData);//分享到QQ空间
wx.updateAppMessageShareData(shareData);//分享给好友
wx.updateTimelineShareData(shareData);//分享到朋友圈
} catch(e) {
console.log(e)
}
@ -21,26 +28,24 @@ function requestForSignatrue (callback) {
callback && callback()
} else {
const wx = window.wx
const url = '/wechats/js_sdk_signature.json'
const url = '/cms/doc/open/wechatSignature'
urlDoneMap[currentUrl] = true
// window.encodeURIComponent()
axios.post(url, {
url: window.__testUrl || currentUrl,
service.post(url, {
url: currentUrl,
}).then((response) => {
console.log('got res')
const data = response.data;
const data = response.data && response.data.data;
wx.config({
debug: false,
appId: data.appid,
appId: appId, // data.appid,
timestamp: data.timestamp,
nonceStr: data.noncestr,
signature: data.signature,
jsApiList: [
'onMenuShareTimeline',//
'onMenuShareAppMessage',
'onMenuShareQQ',
'onMenuShareWeibo',
'onMenuShareQZone'
'updateAppMessageShareData',//
'updateTimelineShareData',
]
});
wx.ready(function () {
@ -125,11 +130,10 @@ export function configShareForCustom (title, desc, imgUrl, path) {
console.log('configShareForCustom', host)
const _url = window.location.href.split('#')[0];
var shareData = {
title: title,
desc: desc,
title: title || 'GitLink | 确实开源',
desc: desc || 'GitLink新一代开源创新服务平台',
link: path ? `${host}/${path}` : _url,
imgUrl: imgUrl || window.__testImageUrl
|| host + '/react/build/images/share_logo_icon.jpg'
imgUrl: imgUrl || host + '/build/images/share_logo_icon.png'
};
share(shareData)
})

View File

@ -28,7 +28,8 @@ function Releases({ owner, projectsId, releaseVersions, distribution }) {
:
<div className="mt8">
暂无发行版
{distribution && <Link className="color-blue ml20" to={{pathname:`/${owner}/${projectsId}/releases/new`,state:{stable:true}}}>发布新版本</Link>}
{distribution && <Link className="color-blue ml20" to={{pathname:`/${owner}/${projectsId}
new`,state:{stable:true}}}>发布新版本</Link>}
</div>
}

View File

@ -53,7 +53,7 @@ function Index(props){
<p className='titile task-hide'>{item.dataSetName}</p>
<p className='task-hide-2 desc'>{item.dataSetDescription}</p>
{/* <span className='time'><i className='iconfont icon-a-31shijian'/>2023-09-08 15:54:23</span> */}
<span className='time'><i className='iconfont icon-daimakuicon1 font-14 mr8'/>{item.repositoryName}</span>
<span className='time task-hide'><i className='iconfont icon-daimakuicon1 font-14 mr8'/>{item.repositoryName}</span>
</Link>
</li>
)

View File

@ -74,13 +74,13 @@ function HeaderPage(props){
//
data && (data.introductionTitle || data.introductionContent || data.introductionImage) &&
<div className="boxmain zone_infos">
<div className="zone_infos_desc">
{data.introductionTitle && <p className="z_name">{data.introductionTitle}</p>}
<p className="z_desc task-hide-2" style={{WebkitLineClamp:data.introductionTitle?"4":"7"}} dangerouslySetInnerHTML={{ __html: data.introductionContent }} ></p>
</div>
<div className="zone_infos_desc">
{data.introductionTitle && <p className="z_name">{data.introductionTitle}</p>}
<p className="z_desc task-hide-2" style={{WebkitLineClamp:data.introductionTitle?"4":"7"}} dangerouslySetInnerHTML={{ __html: data.introductionContent }} ></p>
</div>
{
data.introductionImage &&
<img src={data.introductionImage} alt="" height="277px"/>
<img src={data.introductionImage} alt="" width="300px"/>
}
</div>
}

View File

@ -237,7 +237,7 @@ function HeaderPageCCF(props) {
</div>
{
data.introductionImage &&
<img src={data.introductionImage} alt="" height="277px" />
<img src={data.introductionImage} alt="" width="300px" />
}
</div>
}

View File

@ -7,7 +7,7 @@ import { getNewsDetail } from '../api';
import { isPhone } from 'educoder';
import { tempConfig } from '../tempInfo';
import Acce from '../Component/mobile/accessory';
import { addMeta, setSeoMeta } from 'educoder';
import { addMeta, setSeoMeta, configShareForCustom } from 'educoder';
import CommentList from '../Component/comments/list'
import { connect } from 'react-redux';
import { withRouter } from "react-router";
@ -35,6 +35,9 @@ function NewsDetail(props){
const { name, cmsDir} = detail;
document.title = `${ name }/${ cmsDir.name }`;
setMeta()
setTimeout(() => {
configShareForCustom(detail.name, detail.summary, detail.headImg)
}, 1000);
}
if(isPhone() && zonedetail){
setTimeout(()=>{

View File

@ -1,5 +1,5 @@
import React ,{ useEffect , useState } from "react";
import { connect } from 'react-redux';
import { Route, Switch } from "react-router-dom";
import { withRouter } from "react-router";
@ -17,11 +17,8 @@ import "slick-carousel/slick/slick-theme.css";
import { tempEnum } from "./tempInfo";
import { ImageLayerOfCommentHOC } from "../../modules/page/layers/ImageLayerOfCommentHOC";
import { setSeoMeta } from 'educoder';
import NewsDetail from './Pages/newsDetail'
import HeaderPage from './Pages/headerPage'
import HeaderPageZone1 from './Pages/headerPageZone1'
import HeaderPageCCF from './Pages/headerPagebyCCF'
import { setZoneDetail, setNewsDetail } from '../../redux/actions/server';
import { configShareForCustom } from 'educoder';
const SourceDetail = Loadable({
loader: () => import("./Pages/sourceDetail"),
@ -47,29 +44,29 @@ const SourceSelfList = Loadable({
loader: () => import("./Pages/selfList"),
loading: Loading,
});
// const HeaderPage = Loadable({
// loader: () => import("./Pages/headerPage"),
// loading: Loading,
// });
const HeaderPage = Loadable({
loader: () => import("./Pages/headerPage"),
loading: Loading,
});
// const HeaderPageZone1 = Loadable({
// loader: () => import("./Pages/headerPageZone1"),
// loading: Loading,
// });
const HeaderPageZone1 = Loadable({
loader: () => import("./Pages/headerPageZone1"),
loading: Loading,
});
// const HeaderPageCCF = Loadable({
// loader : () => import("./Pages/headerPagebyCCF"),
// loading : Loading,
// });
const HeaderPageCCF = Loadable({
loader : () => import("./Pages/headerPagebyCCF"),
loading : Loading,
});
const ProjectSource = Loadable({
loader: () => import("./Pages/projectSource"),
loading: Loading,
});
// const NewsDetail = Loadable({
// loader: () => import("./Pages/newsDetail"),
// loading: Loading,
// });
const NewsDetail = Loadable({
loader: () => import("./Pages/newsDetail"),
loading: Loading,
});
const NewsList = Loadable({
loader: () => import("./Pages/newsList"),
loading: Loading,
@ -103,20 +100,16 @@ const DataSetList = Loadable({
});
function Index(props){
const [ data , setData ] = useState( props.zoneDetail || undefined);
const [ data , setData ] = useState(undefined);
const [ adminUrl , setAdminUrl ] = useState(undefined);
const { deptId } = props.match.params;
const [ id , setId ] = useState(undefined);
const [ temp , setTemp ] = useState( props.zoneDetail ? props.zoneDetail.template : tempEnum.zone);
const [ temp , setTemp ] = useState(tempEnum.zone);
const [ role , setRole ] = useState(undefined);
const { pathname } = props.history.location;
const sourcedetail = pathname.indexOf(`/zone/${deptId}/newdetail/`)>-1 && isPhone();
const {current_user} = props;
if (__SERVER__ && data) {
setSeoMeta(`${data.name}`, data.name, data.subTitle, `/zone/${deptId}`)
}
useEffect(()=>{
if(deptId && deptId!=="apply"){
getDetail();
@ -150,6 +143,7 @@ function Index(props){
getAdminUrl(data.id);
getRole(data.id)
}
configShareForCustom(data.mainTitle, data.subTitle, data.introductionImage)
// deptIdheader
sessionStorage.setItem('deptId', data.deptId)
setSeoMeta(`${data.name},`, data.name, data.subTitle, `/zone/${deptId}`)
@ -294,36 +288,8 @@ function Index(props){
</div>
)
}
const mapStateToProps = (state) => {
const {
zoneDetail,
newsDetail
} = state.zoneReducer;
return {
zoneDetail,
newsDetail
};
}
const mapDispatchToProps = (dispatch) => ({
clearProject: (type) => dispatch(actions.clearProject(type)),
});
const newIndex = (CNotificationHOC()(SnackbarHOC()(TPMIndexHOC((Index)))))
newIndex.preFetch = ({ store, match, query }) => {
return new Promise(async function(resolve, reject) {
let { dispatch } = store;
// const { owner,projectsId } = match.params
const promises = [
dispatch(setZoneDetail(match.params)),
dispatch(setNewsDetail(match.params)),
];
const data = await Promise.all(promises);
resolve({
code: 200,
});
});
};
export default withRouter((connect(mapStateToProps, mapDispatchToProps)(newIndex)));
export default withRouter((CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(ImageLayerOfCommentHOC({
imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
parentSelector: ".newContainer",
})(Index)))))
);

View File

@ -770,7 +770,7 @@
display: flex;
align-items: center;
margin-top: 54px;
padding:27px 24px;
padding:40px 24px;
&>img{
border-radius: 4px;
object-fit: contain;
@ -783,7 +783,7 @@
font-size:20px;
height: 28px;
line-height: 28px;
margin-bottom: 35px!important;
margin-bottom: 30px!important;
}
.z_desc{
color:#3d485d;
@ -1787,10 +1787,13 @@
line-height: 24px;
margin-bottom: 15px!important;
height: 48px;
word-break: break-all;
}
.time{
font-size: 14px;
color: #5E6685;
word-break: break-all;
display: block;
i{
font-size: 14px!important;
margin-right: 5px;

View File

@ -54,6 +54,11 @@ class CoderRootFileDetail extends Component {
}
}
isCommit = () => {
const {detail, branch} = this.props;
return detail && detail.commit && detail.commit.sha.includes(branch)
}
// 更新网页标题
updateDocumentTitle(){
const {projectDetail, treeValuePath, location} = this.props;
@ -300,7 +305,7 @@ class CoderRootFileDetail extends Component {
</span>
</div>
<p className="text-right">
{flag && platform && (
{flag && platform && !this.isCommit() && (
<div>
{readOnly ? (
<span>

View File

@ -136,7 +136,8 @@ class Index extends Component {
action: actionUrl || `${getUploadActionUrl()}`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
beforeUpload: this.beforeUpload
beforeUpload: this.beforeUpload,
multiple:true
};
return (

View File

@ -2,7 +2,7 @@ import React from 'react';
import './index.scss';
function Award() {
function Award({round}) {
return (
<div className="award">
@ -21,14 +21,14 @@ function Award() {
</div>
<div className="award-item">
<div className="award-tit">毕业证书或奖杯</div>
<div className="award-content">通过结项考核的学生获得毕业证书优秀同学还可获得单项奖奖杯</div>
<div className="award-tit">{round === 3 ? "荣誉证书或奖杯" : "毕业证书或奖杯"}</div>
<div className="award-content">{round === 3 ? "通过结项考核的学生获得夏令营毕业证书。优秀同学还可获得开源之星等单项奖杯,项目及导师将有机会评选优秀社区、明星导师等奖项" : "通过结项考核的学生获得毕业证书,优秀同学还可获得单项奖奖杯"}</div>
<div className="award-line"></div>
</div>
<div className="award-item">
<div className="award-tit">夏令营大礼包</div>
<div className="award-content">夏令营纪念文化衫帆布包鼠标垫开源系列图书社区周边等此外还会评选出若干优秀社区明星导师最佳课题开源之星等单项奖</div>
<div className="award-content">{round === 3 ? "所有入选学生将领取到夏令营纪念文化衫、帆布包、鼠标垫,开源系列图书,社区周边等" : "夏令营纪念文化衫、帆布包、鼠标垫,开源系列图书,社区周边等。此外,还会评选出若干优秀社区、明星导师、最佳课题、开源之星等单项奖"}</div>
<div className="award-line"></div>
</div>
</div>

View File

@ -201,7 +201,7 @@ export default (props) => {
<Lightspot/>
<TimerShaft id={id} period={period} history={history} current_user={current_user} showLoginDialog={showLoginDialog} glccSettings={glccSettings}/>
</Fragment> : <PreviousReview round={round}/>}
<Award />
<Award round={round}/>
<News round={round}/>
<Partner round={round}/>
<Contact />

View File

@ -35,6 +35,7 @@ import log63 from '../../img/63@2x.png';
import log65 from '../../img/65@2x.png';
import log67 from '../../img/67@2x.png';
import log69 from '../../img/69@2x.png';
import log71 from '../../img/70.png';
import log70 from '../../img/浙江大学.png';
import logo1 from '../../img/logo1.png';
import logo2 from '../../img/logo2.png';
@ -44,6 +45,26 @@ function Partner({round}) {
<div className="partner">
<div className="glcc-content">
<h3 className="glcc-tit">组织方及合作伙伴</h3>
{round === 3 && <div className='cont1 cont mb10'>
<div>
主办方
<div onClick={() => { window.open("https://www.ccf.org.cn/") }} className='div8b9'><img src={ccf1} /></div>
</div>
<div className='flex_div'>
承办方
<div className='flex_div'>
<div onClick={() => { window.open("https://www.zhejianglab.com/home") }} className='div8b9 mr20'><img src={sponsor42} alt='之江实验室' className='gitlink'/></div>
<div onClick={() => { window.open("https://www.gitlink.org.cn/zone/CCF-ODC") }} className='div8b9'><img src={log71} alt='ccf开源发展委员会' className='xjy'/></div>
</div>
</div>
<div>
协办方
<div className='flex_div'>
<div onClick={() => { window.open("https://www.gitlink.org.cn/") }} className='div8b9 mr35'><img src={gitlink} className='gitlink' /></div>
</div>
</div>
</div>}
{round === 2 && <div className='cont1 cont mb10'>
<div>
主办方

View File

@ -5,6 +5,7 @@ import { formatParsedResult } from '../../api';
function TimerShaft(props) {
const {current_user, period, history, showLoginDialog, id, glccSettings} = props;
let repoApplyEnd = undefined
const step = [{
title: "Step1",
date: "4.22",
@ -71,6 +72,9 @@ function TimerShaft(props) {
const repoApply = glccSettings.filter(item=>item.name === "repoApply");
repoApply[0] && (step[0].date = formatParsedResult(repoApply, "startMonthDay"))
repoApply[0] && (step[1].date = formatParsedResult(repoApply, "rangeConcatDot"))
if(repoApply[0]){
repoApplyEnd = new Date(repoApply[0].value.split(",")[1]).getTime()-new Date().getTime() < 0
}
//
const stuApply = glccSettings.filter(item=>item.name === "stuApply");
stuApply[0] && (step[3].date = formatParsedResult(stuApply, "rangeConcatDot"))
@ -93,12 +97,12 @@ function TimerShaft(props) {
<div className="teacher-text">
<h3 className="teacher-invite">有兴趣成为GLCC的导师吗</h3>
<div className="teacher-content">想要扩大项目知名度和影响力为开源项目吸引新鲜血液培养长期开发者通过GitLink平台与高校建立连接指导开源新人传授他们的开源文化享受开源的乐趣</div>
{period === "repoApply" ? <div className='applyBut' onClick={goToApply}>立即报名</div> : <div className='applyBut project'><span className='hover-none'>项目报名</span><span className='hover-show'>已结束</span></div>}
{period === "repoApply" ? <div className='applyBut' onClick={goToApply}>立即报名</div> : <div className='applyBut project'><span className='hover-none'>项目报名</span><span className='hover-show'>{repoApplyEnd ? "已结束" : "敬请期待"}</span></div>}
</div>
<div className="teacher-text">
<h3 className="teacher-invite">你是开源新手有兴趣参加GLCC吗</h3>
<div className="teacher-content">想要参与一线开源项目开发熟悉开源社区运作流程接受资深开源软件专家指导获得丰厚奖金和实习机会参加GLCC开启全新的开源之旅</div>
{(period === "stuApply" || period === "stuApply1") ? <div className='applyBut' onClick={goToApply}>学生报名</div> : <div className='applyBut project'><span className='hover-none'>学生报名</span><span className='hover-show'>{period === "repoApply" ? "敬请期待" : "已结束"}</span></div>}
{(period === "stuApply" || period === "stuApply1") ? <div className='applyBut' onClick={goToApply}>学生报名</div> : <div className='applyBut project'><span className='hover-none'>学生报名</span><span className='hover-show'>{(period === "repoApply" || !period) ? "敬请期待" : "已结束"}</span></div>}
</div>
</div>
</div>

BIN
src/glcc/img/70.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -32,7 +32,7 @@ function TopEdition({register,current_user}) {
const url = `/topics.json?topic_type=banner`;
axios.get(url,{
params:{
limit:5
limit:6
}
}).then(result=>{
if(result){

View File

@ -158,7 +158,7 @@ export default ({ mdID, onChange, onCMBeforeChange, onCMBlur, error = false, cla
const ch = cursor.ch;//列
const startIndex = cm.getRange({line,ch:0},{line,ch}).lastIndexOf("#");
//替换内容
cm.replaceRange(`[#${i.project_issues_index}](/${owner}/${projectsId}/issues/${i.project_issues_index}) `,{line,ch:startIndex},{line,ch});
cm.replaceRange(`[#${i.subject}](/${owner}/${projectsId}/issues/${i.project_issues_index}) `,{line,ch:startIndex},{line,ch});
//鼠标聚焦
cm.focus();
// 保存引用的issue