From 7bd45d908867016e0bfd9928a554e9ff2d3f69c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BF=83=E5=AE=87?= Date: Sun, 28 Apr 2024 11:13:35 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=90=88=E5=B9=B6=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/webpack.config.dev.js | 10 +++- config/webpack.config.prod.js | 1 + src/common/UrlTool.js | 48 +++++++++++-------- src/forge/Badge/Index.jsx | 2 +- src/forge/Information/Component/partner.jsx | 2 +- .../Information/Pages/headerPagebyCCF.jsx | 2 +- src/forge/Information/Pages/newsDetail.jsx | 20 ++++++-- src/forge/Information/indexZonebyCCF.scss | 2 +- src/forge/users/Infos.js | 2 +- src/ssrUrl.js | 7 +++ 10 files changed, 66 insertions(+), 30 deletions(-) create mode 100644 src/ssrUrl.js diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index e95cffd1..9756df5b 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -17,6 +17,13 @@ const paths = require("./paths"); const publicPath = "/"; const env = getClientEnvironment("/","development"); +const process = require('process'); + +process.on('uncaughtException', function (err) { + // 开发时,websocket proxy 会因服务重新部署而报错中断本地 server,这里拦截一下 + console.log('拦截未处理异常:', err); +}); + module.exports = { optimization: { splitChunks: { @@ -273,12 +280,11 @@ module.exports = { reactPath:'react.production.min.js', }), new InterpolateHtmlPlugin(HtmlWebpackPlugin, env.raw), - // Add module names to factory functions so they appear in browser profiler. new webpack.NamedModulesPlugin(), // Makes some environment variables available to the JS code, for example: // if (process.env.NODE_ENV === 'development') { ... }. See `./env.js`. - new webpack.DefinePlugin(env.stringified), + new webpack.DefinePlugin({ ...env.stringified, __SERVER__: 'false',__CLIENT__: 'true' }), // This is necessary to emit hot updates (currently CSS only): new webpack.HotModuleReplacementPlugin(), // Watcher doesn't work well if you mistype casing in a path so we use diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index a7811c3a..98c2f41b 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -294,6 +294,7 @@ module.exports = { minifyURLs: true, }, }), + new webpack.DefinePlugin({ ...env.stringified, __SERVER__: 'false',__CLIENT__: 'true' }), new InterpolateHtmlPlugin(HtmlWebpackPlugin, env.raw), // Makes some environment variables available to the JS code, for example: // if (process.env.NODE_ENV === 'production') { ... }. See `./env.js`. diff --git a/src/common/UrlTool.js b/src/common/UrlTool.js index e45ae6ba..17946963 100644 --- a/src/common/UrlTool.js +++ b/src/common/UrlTool.js @@ -2,10 +2,14 @@ import React from "react"; import md5 from 'md5'; import {Input} from "antd"; const { Search } = Input; +import { url as ssrOrigin, host as ssrHost } from '../ssrUrl' -const $ = window.$; -const isDev = window.location.port == 3007; -const isdev2= window.location.hostname ==='www.educoder.net' + +if (!__SERVER__) { + const $ = window.$; +} +const isDev = __SERVER__ ? false : window.location.port == 3007; +const isdev2= __SERVER__ ? false : window.location.hostname ==='www.educoder.net' export const TEST_HOST = "https://testforgeplus.trustie.net" export function getImageUrl(path) { // https://www.educoder.net @@ -40,7 +44,7 @@ export function getImageUrlAbsolute(path) { // const local = 'http://localhost:3000' path && !path.startsWith('/') && !path.startsWith('http') && (path = '/'.concat(path)); const local = 'https://testforgeplus.trustie.net'; - const prod = window.location.origin; + const prod = __SERVER__ ? local : window.location.origin; if (isDev) { return `${local}${path}` }else{ @@ -198,7 +202,7 @@ function railsgettimess(proxy) { } }}) - window.setTimeout(function () { + setTimeout(function () { checkSubmitFlgs=false; }, 2500); } @@ -295,13 +299,13 @@ export function turnbar(str){ let s = str; if(s && s.length>0){ if(s.indexOf("%")>-1){ - s = s.replaceAll('%','_25'); + s = s.split('%').join('_25'); } if(s.indexOf("#")>-1){ - s = s.replaceAll('#','%23'); + s = s.split('#').join('%23'); } if(s.indexOf("/")>-1){ - s = s.replaceAll('/','%2F'); + s = s.split('/').join('%2F'); } } return s; @@ -310,13 +314,13 @@ export function returnbar(str){ let s = str; if(s && s.length>0){ if(str.indexOf("_25")>-1){ - s = s.replaceAll('_25','%'); + s = s.split('_25').join('%'); } if(s.indexOf("%23")>-1){ - s = s.replaceAll('%23','#'); + s = s.split('%23').join('#'); } if(s.indexOf("%2F")>-1){ - s = s.replaceAll('%2F','/'); + s = s.split('%2F').join('/'); } } return s; @@ -324,6 +328,9 @@ export function returnbar(str){ // 手动添加/修改mate标签 export function addMeta(name, content){ + if (__SERVER__) { + document = domObj.window.document + } if(document.querySelector(`meta[name='${name}']`)){ document.querySelector(`meta[name='${name}']`).content=content; }else{ @@ -344,16 +351,19 @@ export function addMeta(name, content){ * projectId 项目唯一标识 */ export function setSeoMeta(keyWords, title, description, url, owner, projectId) { + if (__SERVER__) { + document = domObj.window.document + } // 服务端没有location - const host = window.location.host - const origin = window.location.origin - document.querySelector(`meta[property='og:title']`).content = title + ' | GitLink'; - document.querySelector(`title`).textContent = title + ' | GitLink'; + const host = window.location.host === 'null' || !window.location.host ? ssrHost : window.location.host + const origin = window.location.origin === 'null' || !window.location.origin ? ssrOrigin : window.location.origin + document.querySelector(`meta[property='og:title']`).content = title; + document.querySelector(`title`).textContent = title; document.querySelector(`meta[property='og:url']`).content = origin + url; - document.querySelector(`meta[property='og:description']`).content = description + ' | GitLink'; - document.querySelector(`meta[property='og:image:alt']`).content = description + ' | GitLink'; - document.querySelector('meta[name="Keywords"]').content= `${ keyWords },${ keyWords ? '' : 'GitLink, git, 开源, 代码托管, 项目管理, 版本控制, 代码分享, 项目协作, 协同开发平台' }` ; - document.querySelector(`meta[name='description']`).content = description + ' | GitLink'; + document.querySelector(`meta[property='og:description']`).content = description; + document.querySelector(`meta[property='og:image:alt']`).content = description; + document.querySelector('meta[name="Keywords"]').content= `${ keyWords }${ keyWords ? '' : 'GitLink, git, 开源, 代码托管, 项目管理, 版本控制, 代码分享, 项目协作, 协同开发平台' }` ; + document.querySelector(`meta[name='description']`).content = description; document.querySelector(`meta[name='go-import']`).content = host + url + ' git ' + origin + url; document.querySelector(`meta[name='octolytics-dimension-user_login']`).content = owner; if (projectId) { diff --git a/src/forge/Badge/Index.jsx b/src/forge/Badge/Index.jsx index 121267d5..a84fc8a5 100644 --- a/src/forge/Badge/Index.jsx +++ b/src/forge/Badge/Index.jsx @@ -29,7 +29,7 @@ function Badge(props) { } else { setProjectDetail(result.data); // seo优化设置 - let keyWords = `${owner},${projectsId},${result.data.author.name},`; + let keyWords = `${owner},${projectsId},${result.data.author.name}`; let title = `${owner}/${projectsId}${result.data.description ? ':' + result.data.description : ''}`; setSeoMeta(keyWords, title, result.data.description, `/${owner}/${projectsId}`, owner, projectsId); } diff --git a/src/forge/Information/Component/partner.jsx b/src/forge/Information/Component/partner.jsx index 03d1d394..b07cb359 100644 --- a/src/forge/Information/Component/partner.jsx +++ b/src/forge/Information/Component/partner.jsx @@ -1,5 +1,5 @@ import React , { useEffect } from 'react'; -import Slider from 'react-slick'; +// import Slider from 'react-slick'; import { httpUrl } from '../fetch'; import axios from 'axios'; import { useState } from 'react'; diff --git a/src/forge/Information/Pages/headerPagebyCCF.jsx b/src/forge/Information/Pages/headerPagebyCCF.jsx index 1e3b10b1..d73326d7 100644 --- a/src/forge/Information/Pages/headerPagebyCCF.jsx +++ b/src/forge/Information/Pages/headerPagebyCCF.jsx @@ -116,7 +116,7 @@ function HeaderPageCCF(props) { { // 新闻动态 data && data.cmsShow === 1 && newsList && newsList.length >= 0 && -
+

{data.homepageCmsTitle}

diff --git a/src/forge/Information/Pages/newsDetail.jsx b/src/forge/Information/Pages/newsDetail.jsx index 5d5508a8..06eb97ea 100644 --- a/src/forge/Information/Pages/newsDetail.jsx +++ b/src/forge/Information/Pages/newsDetail.jsx @@ -25,9 +25,9 @@ function NewsDetail(props){ let initialContent = undefined; // 设置网页标题 if(detail){ - const { name, cmsDir, summary} = detail; + const { name, cmsDir} = detail; document.title = `${ name }/${ cmsDir.name }`; - addMeta('Keywords', `${ name },${ cmsDir.name },${ summary }`); + setMeta() setTimeout(() => { configShareForCustom(detail.name, detail.summary, detail.headImg) }, 1000); @@ -46,8 +46,7 @@ function NewsDetail(props){ document.querySelector('meta[name="viewport"]').setAttribute('content', initialContent); } if (zonedetail) { - document.title= zonedetail.mainTitle; - setSeoMeta(`${zonedetail.name},`, zonedetail.name, zonedetail.subTitle, `/zone/${deptId}`) + setMeta(true) } } },[zonedetail,detail]) @@ -59,6 +58,19 @@ function NewsDetail(props){ } },[id]) + function setMeta(unmount = false) { + if (unmount) { + document.title= zonedetail.name; + setSeoMeta(`${zonedetail.name}`, zonedetail.name, zonedetail.subTitle, `/zone/${deptId}`) + } else { + const { name, cmsDir, summary, id} = detail; + const title = `${ name }/${ cmsDir.name }`; + const keywords = `${ name },${ cmsDir.name },${ zonedetail.name }`; + document.title = title; + setSeoMeta(keywords, title, summary, `/zone/${deptId}/newdetail/${ id }`) + } + } + function getDetails(){ setIsSpin(true) getNewsDetail(id).then(result=>{ diff --git a/src/forge/Information/indexZonebyCCF.scss b/src/forge/Information/indexZonebyCCF.scss index c6c7478f..cf7128b2 100644 --- a/src/forge/Information/indexZonebyCCF.scss +++ b/src/forge/Information/indexZonebyCCF.scss @@ -1,6 +1,6 @@ @import './theme.scss'; -.zone_news { +.zone_news_ccf { margin-top: -10px !important; .zone_new_first { diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js index 9981cd2d..4d3f4943 100644 --- a/src/forge/users/Infos.js +++ b/src/forge/users/Infos.js @@ -161,7 +161,7 @@ class Infos extends Component { const { pathname } = this.props.location; this.renderPath(pathname,result.data); document.title = result.data.username ? result.data.username : username; - let keyWords=`${result.data.username},${username},`; + let keyWords=`${result.data.username},${username}`; let title= result.data.username+'('+ username +')'; setSeoMeta(keyWords,title,title,`/${username}`,username); }) diff --git a/src/ssrUrl.js b/src/ssrUrl.js new file mode 100644 index 00000000..4bf99bf8 --- /dev/null +++ b/src/ssrUrl.js @@ -0,0 +1,7 @@ +export const url = process.env.NODE_ENV === 'production' ? 'https://www.gitlink.org.cn' : 'https://testforgeplus.trustie.net' +export const zoneUrl = process.env.NODE_ENV === 'production' ? 'https://gateway.gitlink.org.cn' : 'https://testgetway.trustie.net' +export const host = process.env.NODE_ENV === 'production' ? 'www.gitlink.org.cn' : 'testforgeplus.trustie.net' + +// export const url = process.env.NODE_ENV === 'production' ? 'https://www.gitlink.org.cn' : '' +// export const zoneUrl = process.env.NODE_ENV === 'production' ? 'https://gateway.gitlink.org.cn' : '' +// export const host = process.env.NODE_ENV === 'production' ? 'www.gitlink.org.cn' : '' \ No newline at end of file From 55d35f0a6725297e958513726951d8a2d4c5d5a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BF=83=E5=AE=87?= Date: Sun, 28 Apr 2024 11:29:23 +0800 Subject: [PATCH 2/5] cont. --- src/common/UrlTool.js | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/src/common/UrlTool.js b/src/common/UrlTool.js index 17946963..a7bba73c 100644 --- a/src/common/UrlTool.js +++ b/src/common/UrlTool.js @@ -1,15 +1,12 @@ import React from "react"; import md5 from 'md5'; import {Input} from "antd"; -const { Search } = Input; import { url as ssrOrigin, host as ssrHost } from '../ssrUrl' +const { Search } = Input; - -if (!__SERVER__) { - const $ = window.$; -} -const isDev = __SERVER__ ? false : window.location.port == 3007; -const isdev2= __SERVER__ ? false : window.location.hostname ==='www.educoder.net' +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 function getImageUrl(path) { // https://www.educoder.net @@ -44,7 +41,7 @@ export function getImageUrlAbsolute(path) { // const local = 'http://localhost:3000' path && !path.startsWith('/') && !path.startsWith('http') && (path = '/'.concat(path)); const local = 'https://testforgeplus.trustie.net'; - const prod = __SERVER__ ? local : window.location.origin; + const prod = window.location.origin; if (isDev) { return `${local}${path}` }else{ @@ -299,13 +296,13 @@ export function turnbar(str){ let s = str; if(s && s.length>0){ if(s.indexOf("%")>-1){ - s = s.split('%').join('_25'); + s = s.replaceAll('%','_25'); } if(s.indexOf("#")>-1){ - s = s.split('#').join('%23'); + s = s.replaceAll('#','%23'); } if(s.indexOf("/")>-1){ - s = s.split('/').join('%2F'); + s = s.replaceAll('/','%2F'); } } return s; @@ -314,13 +311,13 @@ export function returnbar(str){ let s = str; if(s && s.length>0){ if(str.indexOf("_25")>-1){ - s = s.split('_25').join('%'); + s = s.replaceAll('_25','%'); } if(s.indexOf("%23")>-1){ - s = s.split('%23').join('#'); + s = s.replaceAll('%23','#'); } if(s.indexOf("%2F")>-1){ - s = s.split('%2F').join('/'); + s = s.replaceAll('%2F','/'); } } return s; @@ -328,9 +325,6 @@ export function returnbar(str){ // 手动添加/修改mate标签 export function addMeta(name, content){ - if (__SERVER__) { - document = domObj.window.document - } if(document.querySelector(`meta[name='${name}']`)){ document.querySelector(`meta[name='${name}']`).content=content; }else{ @@ -351,9 +345,6 @@ export function addMeta(name, content){ * projectId 项目唯一标识 */ export function setSeoMeta(keyWords, title, description, url, owner, projectId) { - if (__SERVER__) { - document = domObj.window.document - } // 服务端没有location const host = window.location.host === 'null' || !window.location.host ? ssrHost : window.location.host const origin = window.location.origin === 'null' || !window.location.origin ? ssrOrigin : window.location.origin From ea3c8d841ceb2b6ea734ad45a978c00540d98b07 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Sun, 28 Apr 2024 16:41:23 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=B8=93=E5=8C=BA-=E6=A0=87=E8=AF=86?= =?UTF-8?q?=E9=9D=9E=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/webpack.config.prod.js | 2 +- package-lock.json | 23 +++++++++++++++++++++++ package.json | 1 + src/forge/Information/Pages/apply.jsx | 13 ++++++++----- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index e441901b..a7811c3a 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -16,7 +16,7 @@ const TerserWebpackPlugin = require('terser-webpack-plugin'); const paths = require("./paths"); const getClientEnvironment = require("./env"); -let publicPath = "/react/build/"; +let publicPath = "/build/"; const publicUrl = publicPath.slice(0, -1); // const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== "false"; const shouldUseSourceMap = process.env.NODE_ENV !== "production"; diff --git a/package-lock.json b/package-lock.json index be7f27fb..53001c72 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11029,6 +11029,11 @@ "resolved": "https://registry.npmjs.org/keycode/-/keycode-2.2.1.tgz", "integrity": "sha512-Rdgz9Hl9Iv4QKi8b0OlCRQEzp4AgVxyCtz5S/+VIHezDmrDhkp2N2TqBWOLz0/gbeREXOOiI9/4b8BY9uw2vFg==" }, + "keypress": { + "version": "0.1.0", + "resolved": "https://registry.npmmirror.com/keypress/-/keypress-0.1.0.tgz", + "integrity": "sha512-x0yf9PL/nx9Nw9oLL8ZVErFAk85/lslwEP7Vz7s5SI1ODXZIgit3C5qyWjw4DxOuO/3Hb4866SQh28a1V1d+WA==" + }, "killable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", @@ -12777,6 +12782,24 @@ "pinkie": "^2.0.0" } }, + "pinyin": { + "version": "4.0.0-alpha.0", + "resolved": "https://registry.npmmirror.com/pinyin/-/pinyin-4.0.0-alpha.0.tgz", + "integrity": "sha512-hdxO/2RuLWarhLaIcGKdXjkFZ0hFr3W/Yrvrd0YPxuIafixMZSAa4jvxskYLgYHE8OkOXkGsxMsEScwGzqKe3g==", + "requires": { + "commander": "~1.1.1" + }, + "dependencies": { + "commander": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/commander/-/commander-1.1.1.tgz", + "integrity": "sha512-71Rod2AhcH3JhkBikVpNd0pA+fWsmAaVoti6OR38T76chA7vE3pSerS0Jor4wDw+tOueD2zLVvFOw5H0Rcj7rA==", + "requires": { + "keypress": "0.1.x" + } + } + } + }, "pkg-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", diff --git a/package.json b/package.json index 420fac00..f4507d91 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "nvm": "0.0.4", "object-assign": "4.1.1", "papaparse": "^5.3.2", + "pinyin": "^4.0.0-alpha.0", "postcss-flexbugs-fixes": "3.2.0", "promise": "8.0.1", "prop-types": "^15.6.1", diff --git a/src/forge/Information/Pages/apply.jsx b/src/forge/Information/Pages/apply.jsx index 5f020e6e..6d2480e3 100644 --- a/src/forge/Information/Pages/apply.jsx +++ b/src/forge/Information/Pages/apply.jsx @@ -3,6 +3,7 @@ import { Form , Input , Row , Col, Button } from 'antd'; import '../index.scss'; import { postCreateZone } from '../api'; import axios from 'axios'; + const { TextArea } = Input; const phonereg = /^([1][3456789])\d{9}$/ @@ -25,14 +26,15 @@ function Apply(props){ const zoneApplication = {...values}; postCreateZone(zoneApplication).then(response=>{ if(response && response.data && response.data.code===200){ - props.showNotification("提交成功!"); + props.showNotification("您的专区申请已提交,请耐心等待管理员与您联系!"); setTimeout(() => { window.location.href="/"; - }, 70); + }, 1000); } }).catch(error=>{}) } }) + } function checkPhone(rule, value, callback){ @@ -55,6 +57,7 @@ function Apply(props){ callback(); }):callback(); } + return( @@ -99,18 +102,18 @@ function Apply(props){ {getFieldDecorator("key",{ rules:[ - { required: true,message:"请输入专区域名标识" }, + // { required: true,message:"请输入专区域名英文标识" }, { pattern: /^[a-zA-Z][a-zA-Z0-9_-]{0,18}[a-zA-Z]$/, message: "长度2-20,只能包含数字、字母、下划线、中划线,必须以字母开头结尾"}, { validator:checkId } ], validateTrigger:"onBlur", validateFirst: true, })( - + )} From 0ba4a5573bb78c4d6a638c5d6f31a3b02f710e85 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 29 Apr 2024 10:43:58 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=B8=93=E5=8C=BA?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=AA=8C=E8=AF=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Information/Pages/apply.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/forge/Information/Pages/apply.jsx b/src/forge/Information/Pages/apply.jsx index 6d2480e3..400f0864 100644 --- a/src/forge/Information/Pages/apply.jsx +++ b/src/forge/Information/Pages/apply.jsx @@ -1,5 +1,5 @@ import React, { useEffect } from 'react'; -import { Form , Input , Row , Col, Button } from 'antd'; +import { Form , Input , Row , Col, Button, message } from 'antd'; import '../index.scss'; import { postCreateZone } from '../api'; import axios from 'axios'; @@ -26,7 +26,7 @@ function Apply(props){ const zoneApplication = {...values}; postCreateZone(zoneApplication).then(response=>{ if(response && response.data && response.data.code===200){ - props.showNotification("您的专区申请已提交,请耐心等待管理员与您联系!"); + message.success("您的专区申请已提交,请耐心等待管理员与您联系!"); setTimeout(() => { window.location.href="/"; }, 1000); @@ -34,7 +34,6 @@ function Apply(props){ }).catch(error=>{}) } }) - } function checkPhone(rule, value, callback){ @@ -75,9 +74,12 @@ function Apply(props){ label="专区名称" > {getFieldDecorator("name",{ - rules:[{required:true,message:"请输入专区名称"}] + rules:[ + {required:true,message:"请输入专区名称"}, + {pattern: /^[a-zA-Z0-9\u4e00-\u9fa5\\_.-]{1,31}$/, message: "长度1-30,支持中文,英文,数字,可包含下划线(_),中划线(-),英文句号(.)"} + ] })( - + )} Date: Mon, 29 Apr 2024 11:49:34 +0800 Subject: [PATCH 5/5] =?UTF-8?q?glcc=E5=A2=9E=E5=8A=A0=E6=8A=A5=E5=90=8D?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/glcc/apply/editInfo.jsx | 25 +++++++++++++++++-------- src/glcc/apply/index.jsx | 2 +- src/glcc/apply/index.scss | 11 +++++++++++ src/glcc/apply/taskApply.jsx | 25 +++++++++++++++++-------- 4 files changed, 46 insertions(+), 17 deletions(-) diff --git a/src/glcc/apply/editInfo.jsx b/src/glcc/apply/editInfo.jsx index 86ecbf46..528f78fc 100644 --- a/src/glcc/apply/editInfo.jsx +++ b/src/glcc/apply/editInfo.jsx @@ -1,5 +1,5 @@ import React , { useCallback, useEffect , useState } from 'react'; -import { Button, Form, Input, Select, Upload, message, Popconfirm, Checkbox } from 'antd'; +import { Button, Form, Input, Select, Upload, message, Popconfirm, Checkbox, Icon, Tooltip } from 'antd'; import {getUploadActionUrl} from 'educoder'; import {applyGlcc, findStudentTaskByTaskId, updateApplyGlcc} from '../api'; import TextArea from 'antd/lib/input/TextArea'; @@ -231,13 +231,22 @@ function EditRepoApplyInfo(props) { {cateList && cateList.map(item=> {return })} )} - {helper('GitLink地址', - '', - 'gitlinkUrl', - [{ required: true, message: "请输入GitLink项目地址" }, - { max: 252, message: '超出限制长度252位字符,请重新编辑' }], - {verify("gitlink")}}/> - )} + +
+ {helper('GitLink地址', + '', + 'gitlinkUrl', + [{ required: true, message: "请输入GitLink项目地址" }, + { max: 252, message: '超出限制长度252位字符,请重新编辑' }], + {verify("gitlink")}}/> + )} + + 指项目在GitLink的托管地址,详见迁移说明文档 +
} + > + + +
{getFieldDecorator("contactName", { rules: [{ required: true, message: "请输入项目联系人姓名" }, { max: 32, message: '超出限制长度32位字符,请重新编辑' }], validateFirst: true, initialValue: current_user.username })( diff --git a/src/glcc/apply/index.jsx b/src/glcc/apply/index.jsx index fd70553c..aaba5945 100644 --- a/src/glcc/apply/index.jsx +++ b/src/glcc/apply/index.jsx @@ -85,7 +85,7 @@ function Apply(props) {

申请说明

1、项目报名时间为{formatParsedResult(applyTime, "rangeDay")},请在报名截止时间(北京时间{formatParsedResult(applyTime, "end")})前提交报名信息。
2、本次GLCC夏令营建议使用GitLink为代码托管平台,学生基于GitLink上项目完成编程任务。同时也欢迎使用其他代码托管平台的项目参与活动。目前GLCC只对夏令营期间使用GitLink托管的项目提供部分奖励支持。
-
3、如果您的项目还未迁移到GitLink上,迁移事项请查看迁移说明文档。如在迁移过程中遇到问题,请加qq群: 1071514693 联系qq群管理员。
+
3、如果您的项目还未迁移到GitLink上,迁移事项请查看迁移说明文档。如在迁移过程中遇到问题,请加qq群: 1071514693 联系qq群管理员。
4、提交社区和题目信息后,欢迎与组委会联系沟通宣传推广和后续合作工作。联系人微信: _TigerWang(备注GitLink编程夏令营)
5、在项目报名期间({formatParsedResult(applyTime, "rangeDay")}),您可以随时进入当前页调整项目或课题报名信息
6、课题奖励默认由项目方支持,可提供现金或者实习机会等其他形式的奖励,请根据课题难度设定奖励内容。若您可能无法支撑本课题奖励,GLCC组委会将进行资助评审,择优资助。如未获得资助,将下线该课题
diff --git a/src/glcc/apply/index.scss b/src/glcc/apply/index.scss index 6a52017c..1a7810d6 100644 --- a/src/glcc/apply/index.scss +++ b/src/glcc/apply/index.scss @@ -57,6 +57,17 @@ max-height: 100px; } } + + .hasQuestionBox{ + width: 50%; + display: inline-flex; + .question{ + color: $primary-color; + } + .ant-row.ant-form-item{ + width: 100%; + } + } } .introArea{ width: 100%; diff --git a/src/glcc/apply/taskApply.jsx b/src/glcc/apply/taskApply.jsx index 8fe90d38..e828b09c 100644 --- a/src/glcc/apply/taskApply.jsx +++ b/src/glcc/apply/taskApply.jsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from 'react'; -import {Form, Input, Radio, Select } from 'antd'; +import {Form, Icon, Input, Radio, Select, Tooltip } from 'antd'; import TextArea from 'antd/lib/input/TextArea'; import { rewardMoney } from '../api'; const Option = Select.Option; @@ -36,13 +36,22 @@ function TaskApply(props) { { max: 32, message: '超出限制长度32位字符,请重新编辑' }], )} - {helper('课题链接', - '', - `taskUrl${taskKey}`, - [{ required: true, message: "请输入课题链接" }, - { max: 252, message: '超出限制长度252位字符,请重新编辑' }], - - )} +
+ {helper('课题链接', + '', + `taskUrl${taskKey}`, + [{ required: true, message: "请输入课题链接" }, + { max: 252, message: '超出限制长度252位字符,请重新编辑' }], + + )} + + 您可用issue的形式来发布课题,详见课题样例 +
} + > + + +
+ {helper('课题难度', '', `taskDifficulty${taskKey}`,