From 6610f7f065f891fa005fa194ddc040b0f34fb1bc Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 26 Dec 2022 15:26:57 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E7=99=BB?= =?UTF-8?q?=E5=BD=95-=E7=AC=AC=E4=BA=8C=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/css/edu-purge.css | 15 +- src/App.js | 10 + src/common/marked.js | 2 +- src/components/render-html.jsx | 1 + src/forge/Account/Index.jsx | 38 ++++ src/forge/Account/bind.jsx | 99 ++++++++++ src/forge/Account/image/lock.png | Bin 0 -> 435 bytes src/forge/Account/image/logo.png | Bin 0 -> 3542 bytes src/forge/Account/image/phone.svg | 3 + src/forge/Account/image/shield.png | Bin 0 -> 420 bytes src/forge/Account/image/user.png | Bin 0 -> 413 bytes src/forge/Account/index.scss | 85 +++++++++ src/forge/Account/unbind.jsx | 271 ++++++++++++++++++++++++++++ src/forge/Main/CoderDepotReadme.jsx | 1 - src/forge/Main/Index.scss | 4 +- 15 files changed, 525 insertions(+), 4 deletions(-) create mode 100644 src/forge/Account/Index.jsx create mode 100644 src/forge/Account/bind.jsx create mode 100644 src/forge/Account/image/lock.png create mode 100644 src/forge/Account/image/logo.png create mode 100644 src/forge/Account/image/phone.svg create mode 100644 src/forge/Account/image/shield.png create mode 100644 src/forge/Account/image/user.png create mode 100644 src/forge/Account/index.scss create mode 100644 src/forge/Account/unbind.jsx diff --git a/public/css/edu-purge.css b/public/css/edu-purge.css index eb8625a44..c289a14dd 100644 --- a/public/css/edu-purge.css +++ b/public/css/edu-purge.css @@ -1080,7 +1080,20 @@ a.shixun-task-btn { word-wrap: break-word; word-break: break-word; } - +.markdown_anchors{ + position: relative; +} +.markdown_anchors:hover .anchors{ + display: inline-block; +} +.markdown_anchors .anchors:hover{ + text-decoration: none; +} +.markdown_anchors .anchors { + color: inherit; + margin-left: -14px; + display: none; +} .markdown code { padding: 0; line-height: 23px; diff --git a/src/App.js b/src/App.js index 0e5921da5..0d86e4341 100644 --- a/src/App.js +++ b/src/App.js @@ -102,11 +102,16 @@ const Home = Loadable({ loading: Loading, }) +const Relaction = Loadable({ + loader: () => import("./forge/Account/Index"), + loading: Loading, +}); const LoginRegisterPage = Loadable({ loader: () => import("./modules/loginRegister/LoginRegisterPage"), loading: Loading, }); + const AboutUs = Loadable({ loader: () => import("./forge/AboutUs/AboutUs"), loading: Loading, @@ -371,6 +376,11 @@ class App extends Component { ) } /> + {/* 关联账号 */} + } + > {/* 登录 */} ' + text + '' + return '' + text + '' } marked.setOptions({ silent: true, diff --git a/src/components/render-html.jsx b/src/components/render-html.jsx index 3b7e4b520..9eafa5c74 100644 --- a/src/components/render-html.jsx +++ b/src/components/render-html.jsx @@ -31,6 +31,7 @@ export default ({ rs = rs.replace("

[TOC]

", getTocContent()) cleanToc() } + // 循环匹配所有emoji let matchStr = str.match(strRegexSub); if(matchStr && matchStr.length>0){ for(var i=0;i < matchStr.length;i++){ diff --git a/src/forge/Account/Index.jsx b/src/forge/Account/Index.jsx new file mode 100644 index 000000000..18087d324 --- /dev/null +++ b/src/forge/Account/Index.jsx @@ -0,0 +1,38 @@ +import React , { useState } from 'react'; +import './index.scss'; +import logo from './image/logo.png'; +import { Menu } from 'antd'; +import Bind from './bind'; +import UnBind from './unbind'; + +function Index(props){ + const [ key , setKey ] = useState("0"); + + // 选择menu + function chooseMenuFunc(e){ + setKey(e.key) + } + return( +
+
+ +
+
+

关联账号

+
+ + 已有账号,进行绑定 + 无账号,注册并绑定 + + { + key === "0" ? + + : + + } +
+
+
+ ) +} +export default Index; \ No newline at end of file diff --git a/src/forge/Account/bind.jsx b/src/forge/Account/bind.jsx new file mode 100644 index 000000000..33453191b --- /dev/null +++ b/src/forge/Account/bind.jsx @@ -0,0 +1,99 @@ +import React ,{ useState } from 'react'; +import { Form , Input , Button } from 'antd'; +import phone from './image/phone.svg'; +import lock from "./image/lock.png"; +import axios from 'axios'; + + +const phonereg = /^([1][3456789])\d{9}$/ +const emailreg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/ +function Bind(props){ + const { form } = props; + + const { getFieldDecorator , getFieldsValue } = form; + const [ bindFlag , setBindFlag] = useState(true); + const type = props.match.params.type; + + // 绑定登录 + function bindloginFunc(){ + const {username, password } = getFieldsValue(); + if(username && password){ + var url = '/bind_user.json'; + axios.post(url,{ + username,password,type + }).then(result=>{ + if(result){ + window.location.href = "/"+result.data.login; + } + }) + } + } + + function accountConfirm(r,v,c){ + if(v){ + const {password } = getFieldsValue(); + if(!(phonereg.test(v) || emailreg.test(v))){ + setBindFlag(true); + c(`请输入正确的手机号或邮箱地址`); + }else if(password){ + setBindFlag(false); + } + }else{ + c(); + setBindFlag(true); + } + } + function psdConfirm(r,v,c){ + if(v){ + const { username } = getFieldsValue(); + if(phonereg.test(username) || emailreg.test(username)){ + setBindFlag(false); + }else{ + setBindFlag(true); + } + }else{ + c(); + setBindFlag(true); + } + } + return( +
+
+ + {getFieldDecorator('username',{ + rules:[ + { + required:true, + message:"请输入手机号或邮箱地址" + }, + { + validator: (rule, value, callback) => { accountConfirm(rule, value, callback) } + } + ], + validateTrigger:"onInput", + })(} size="large" placeholder="请输入手机号或邮箱地址"/>)} + + + {getFieldDecorator('password', { + rules: [ + { + required:true, + message:"请输入登录密码" + }, + { + validator: (rule, value, callback) => { psdConfirm(rule, value, callback) } + } + ], + validateTrigger:"onInput", + })( + } className="psd" size="large" placeholder="请输入登录密码" />, + )} + + +
+
+ ) +} +export default Form.create({ name: 'Bind' })(Bind); \ No newline at end of file diff --git a/src/forge/Account/image/lock.png b/src/forge/Account/image/lock.png new file mode 100644 index 0000000000000000000000000000000000000000..4d5d27c2f6788dd40b7a26b81bd05e17d0c94ec3 GIT binary patch literal 435 zcmV;k0ZjghP)4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zeDWSLt04BBWl+AJakF^?uQlK#1Xi!%6m z@Jxaxnfe5O&{ka2SAf?jq9bWEO9fY@xzeV?`W)drIq;Jt03Pao+=Gle*1=%=DZaq2=>Jwsb@k4%3`Po;v(fqh6 zN^_My{Z)fSjzFp4DzYOL?P>(3Z3HTCP1}rA{G6E)sK9k*rn2hDw2i?30WML|*4249 QC;$Ke07*qoM6N<$g4-h0?*IS* literal 0 HcmV?d00001 diff --git a/src/forge/Account/image/phone.svg b/src/forge/Account/image/phone.svg new file mode 100644 index 000000000..a33d110a9 --- /dev/null +++ b/src/forge/Account/image/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/forge/Account/image/shield.png b/src/forge/Account/image/shield.png new file mode 100644 index 0000000000000000000000000000000000000000..475867bf3bb14f69fcf3d71772da6b5b26e8d8e6 GIT binary patch literal 420 zcmV;V0bBlwP)-=X5Z#4THpvb22Fe6_zf?jIbAot-;0eMJ$PG9`Qa~z% zK00^=JwcKtm7mRi^gHO_3{5Ea@7uTU?E|6ZOS5$VNY8{2`NDo}>p@-o$jdijpvRrK#JtTr1A{2-ePlZ$Hh9oaXNHXB}F~9c-XyZ>D z3)AI_yor5cZd8uj7hehBT$5fInu_o0&63x{gdZ93k@Q} z9Ba0#jCo$({gN!$sV^X~E4%P);j8$>{c= zc8q1b4Z-?x;t%_kz(t(yq_=4`5W&PB^r{utX#~PenK?C(w%#7=HSEp<&G2_`NLJr=YH{AT& z<}tZS-duna3zUZ(DaEq<>!CF|%oIqg+mKk_Ux%D3%n$GjU|g+uoE)n*00000NkvXX Hu0mjf5G=K_ literal 0 HcmV?d00001 diff --git a/src/forge/Account/index.scss b/src/forge/Account/index.scss new file mode 100644 index 000000000..1c9de9ccd --- /dev/null +++ b/src/forge/Account/index.scss @@ -0,0 +1,85 @@ +.bodies{ + height: 100vh; + width: 100%; + background-color: rgba(245, 248, 255, 1); + .logo{ + width: 100%; + background-color: #fff; + padding:7px 26px; + } + .content{ + padding-top: 50px; + margin:0px auto; + width: 570px; + &>p{ + height:42px; + line-height:42px; + font-weight:400; + color:#000000; + font-size:30px; + margin-bottom: 32px!important; + text-align: center; + } + .panels{ + background-color: #fff; + border-radius:6.6px; + padding:32px 42px; + .panelsMenu{ + border-bottom: none!important; + margin-bottom: 36px!important; + .ant-menu-item{ + padding: 0px; + margin-right: 60px!important; + } + } + .bind_form{ + padding-bottom: 48px; + .has-error .ant-input:focus,.has-error .ant-input, .has-error .ant-input:hover{ + border-color: #ff4d4f!important; + } + .ant-btn-primary[disabled]{ + background-color:rgba(70, 106, 255,0.55); + color: #fff; + border:none + } + .ant-input-group-addon{ + background-color: transparent; + } + .ant-input{ + border-left: none; + background-color: #fff!important; + } + .ant-input:focus,.ant-input:hover{ + border-right: 1px solid #ddd!important; + border-color: #ddd!important; + border-left: none!important; + } + .codeBut{ + border:1px solid rgba(70, 106, 255, 1)!important; + span{ + color: rgba(70, 106, 255, 1); + } + } + .codeBut.disable{ + border:1px solid #ddd!important; + span{ + color: #ddd; + } + } + .login_register_head{ + display: flex; + justify-content: space-between; + align-items: center; + &>span:first-child{ + font-size: 1.5em; + font-weight: 600; + color: #000000; + line-height: 1.5; + } + //注册页面的获取验证码输入框 + .ant-btn{margin-left: 15px; } + } + } + } + } +} \ No newline at end of file diff --git a/src/forge/Account/unbind.jsx b/src/forge/Account/unbind.jsx new file mode 100644 index 000000000..57db4d8e3 --- /dev/null +++ b/src/forge/Account/unbind.jsx @@ -0,0 +1,271 @@ +import React ,{ useState , useRef } from 'react'; +import { Form , Input , Button , message } from 'antd'; +import user from "./image/user.png"; +import lock from "./image/lock.png"; +import shield from './image/shield.png'; +import phone from './image/phone.svg'; +import axios from 'axios'; +import { setmiyah } from 'educoder'; + +const phonereg = /^([1][3456789])\d{9}$/ +const emailreg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/ +function Bind(props){ + const { form } = props; + const seconds = useRef(); + let interval = undefined; + const { getFieldDecorator , getFieldsValue } = form; + const [ bindFlag , setBindFlag] = useState(true); + const [ captchaFlag , setCaptchaFlag ] = useState(true); + const [secondsStr, setSecondsStr] = useState(60); + const [ getCaptchaBut , setGetCaptchaBut ] = useState(true); + + + //判断用户名(username)是否注册 + function usernameConfirm(rule, value, callback){ + value ? axios.post(`/accounts/check.json`, { + value: value, + type: 1 + }).then(response => { + if(response){ + if (response.data.status === -1) { + callback('该名称已经被使用'); + } else { + const { captcha , password , confirm_password,username} = getFieldsValue(); + if( captcha && password && confirm_password && (password === confirm_password) &&(phonereg.test(username) || emailreg.test(username)) ){ + setBindFlag(false); + } + } + } + callback(); + }):callback(); + } + + function accountConfirm(rule, value, callback){ + if(value){ + const { captcha , password , confirm_password,register_username} = getFieldsValue(); + if(!(phonereg.test(value) || emailreg.test(value))){ + setCaptchaFlag(true); + callback(`请输入正确的手机号或邮箱地址`); + }else{ + setCaptchaFlag(false); + if(captcha && password && confirm_password && (password === confirm_password) && register_username){ + setBindFlag(false); + } + } + callback(); + }else{ + setBindFlag(true); + callback(); + } + } + function psdConfirm(r,v,c){ + if(v){ + const { username , captcha , confirm_password , register_username } = getFieldsValue(); + if(register_username && (phonereg.test(username) || emailreg.test(username)) && captcha && confirm_password && (v=== confirm_password) ){ + setBindFlag(false); + }else{ + setBindFlag(true); + } + c(); + }else{ + c(); + setBindFlag(true); + } + } + function captchaConfirm(r,v,c){ + if(v){ + const { username , password , confirm_password , register_username } = getFieldsValue(); + if(register_username && (phonereg.test(username) || emailreg.test(username)) && password && confirm_password && (password ===confirm_password) ){ + setBindFlag(false); + }else{ + setBindFlag(true); + } + c(); + }else{ + c(); + setBindFlag(true); + } + } + function repsdConfirm(r,v,c){ + if(v){ + const { username , password , register_username , captcha} = getFieldsValue(); + if(v !== password){ + c("两次输入的密码不一样"); + }else{ + c(); + } + if((phonereg.test(username) || emailreg.test(username)) && password && register_username && captcha){ + setBindFlag(false); + }else{ + setBindFlag(true); + } + c(); + }else{ + c(); + } + } + + //获取验证码 + function getCaptcha() { + const { username }= getFieldsValue(); + if (username) { + // 倒计时开始 + setCaptchaFlag(true); + setGetCaptchaBut(false); + seconds.current = 60; + setSecondsStr(60); + !interval && clearInterval(interval); + interval = setInterval(() => { + if (seconds.current > 1) { + let oldSeconds = seconds.current; + seconds.current = oldSeconds - 1; + setSecondsStr(oldSeconds - 1); + } else { + clearInterval(interval); + //倒计时结束->可以获取验证码 + setCaptchaFlag(false); + setGetCaptchaBut(true); + } + }, 1000) + + //请求获取验证码接口 + axios.get(`/accounts/get_verification_code.json`, { + params: { + login: username, + type: 1, + smscode: setmiyah(username), + } + }).then(response => { + if (response.data && response.data.status === 0) { + //验证码发送成功 + setGetCaptchaBut(false); + } + }) + } + } + // 绑定登录 + function bindRegFunc(){ + form.validateFields((err, values) => { + if (!err) { + var url = '/accounts/register.json'; + axios.post(url,{ + namespace: values.register_username, + login: values.username, + password: values.password, + password_confirmation: values.confirm_password, + code: values.captcha + }).then(response=>{ + if(response.data && response.data.status === -6){ + //验证码不正确 + form.setFields({captcha: {value:values.captcha,errors:[new Error('验证码错误,请重新输入')]}}); + + }else if(response.data && response.data.status === 0){ + //注册成功,页面跳转即可,注册后登录流程forge处理了 + window.location.href = "/"+values.register_username; + } + }) + } + }) + } + return( +
+
+ + {getFieldDecorator('register_username',{ + rules:[ + { + required:true, + message:"请输入用户名" + }, + { + pattern: /^[a-zA-Z]/, + message: "用户名必须以字母开头" + }, + { + pattern: /[a-zA-Z0-9]$/, + message: "用户名只能使用英文字母和数字" + }, + { + min: 4, + max: 15, + message: "用户名长度为4到15个字符" + }, + { + validator: (rule, value, callback) => { usernameConfirm(rule, value, callback) } + } + ], + validateTrigger:"onBlur", + validateFirst: true, + })(} size="large" autoComplete="off"/>)} + + + {getFieldDecorator('username',{ + rules:[ + { + required:true, + message:"请输入手机号或邮箱地址" + }, + { + validator: (rule, value, callback) => { accountConfirm(rule, value, callback) } + } + ], + validateTrigger:"onInput", + })(} size="large" placeholder="请输入手机号或邮箱地址"/>)} + + +
+ {getFieldDecorator('captcha', { + rules: [{ + required: true, + message: "请输入验证码" + }, + { + validator: (rule, value, callback) => { captchaConfirm(rule, value, callback) } + }], + validateTrigger: "onInput", + })( + } placeholder="请输入验证码" autoComplete="off"/> + )} + +
+
+ + {getFieldDecorator('password', { + rules: [ + { + required:true, + message:"请输入登录密码" + }, + { + validator: (rule, value, callback) => { psdConfirm(rule, value, callback) } + } + ], + validateTrigger:"onInput", + })( + } className="psd" size="large" placeholder="请输入登录密码" />, + )} + + + {getFieldDecorator('confirm_password', { + rules: [ + { + required:true, + message:"请再次输入登录密码" + }, + { + validator: (rule, value, callback) => { repsdConfirm(rule, value, callback) } + } + ], + validateTrigger:"onBlur", + })( + } className="psd" size="large" placeholder="请确认登录密码" />, + )} + + +
+
+ ) +} +export default Form.create({ name: 'Bind' })(Bind); \ No newline at end of file diff --git a/src/forge/Main/CoderDepotReadme.jsx b/src/forge/Main/CoderDepotReadme.jsx index 93d8b04c2..5e8bc3532 100644 --- a/src/forge/Main/CoderDepotReadme.jsx +++ b/src/forge/Main/CoderDepotReadme.jsx @@ -19,7 +19,6 @@ function CoderDepotReadme({ operate , history , readme , ChangeFile }){ },[readme]) useEffect(()=>{ - let path = history.location.pathname; const items = $.map($("#readme").find("h1,h2,h3,h4,h5,h6"), function (el, _) { const anchor = el.id; const level = el.tagName.replace("H", ""); diff --git a/src/forge/Main/Index.scss b/src/forge/Main/Index.scss index f17bc4805..a2ff111c4 100644 --- a/src/forge/Main/Index.scss +++ b/src/forge/Main/Index.scss @@ -521,7 +521,9 @@ } } } - +.readmeFile{ + overflow: inherit; +} .readmeFile p{ white-space: normal; } \ No newline at end of file From 7cf9e7b6f1f0bc4a85d6207803865f96c6d9be53 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 27 Dec 2022 14:18:46 +0800 Subject: [PATCH 02/10] =?UTF-8?q?update=20=E5=90=8C=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 2 +- src/forge/Account/bind.jsx | 3 +++ src/forge/Account/unbind.jsx | 7 ++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/App.js b/src/App.js index 0d86e4341..b412c0e55 100644 --- a/src/App.js +++ b/src/App.js @@ -136,7 +136,7 @@ const WebIDE = Loadable({ // }) // 此处仅维护前端可能的一级路由,不用进行项目或者组织判断的字段。 -const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc"]; +const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc","bindlogin"]; class App extends Component { constructor(props) { diff --git a/src/forge/Account/bind.jsx b/src/forge/Account/bind.jsx index 33453191b..aa009cb27 100644 --- a/src/forge/Account/bind.jsx +++ b/src/forge/Account/bind.jsx @@ -3,6 +3,7 @@ import { Form , Input , Button } from 'antd'; import phone from './image/phone.svg'; import lock from "./image/lock.png"; import axios from 'axios'; +import cookie from 'react-cookies'; const phonereg = /^([1][3456789])\d{9}$/ @@ -23,6 +24,8 @@ function Bind(props){ username,password,type }).then(result=>{ if(result){ + cookie.save("supplyphone",true); + cookie.save("login",result.data.login); window.location.href = "/"+result.data.login; } }) diff --git a/src/forge/Account/unbind.jsx b/src/forge/Account/unbind.jsx index 57db4d8e3..5bab356cc 100644 --- a/src/forge/Account/unbind.jsx +++ b/src/forge/Account/unbind.jsx @@ -5,6 +5,7 @@ import lock from "./image/lock.png"; import shield from './image/shield.png'; import phone from './image/phone.svg'; import axios from 'axios'; +import cookie from 'react-cookies'; import { setmiyah } from 'educoder'; const phonereg = /^([1][3456789])\d{9}$/ @@ -19,6 +20,7 @@ function Bind(props){ const [secondsStr, setSecondsStr] = useState(60); const [ getCaptchaBut , setGetCaptchaBut ] = useState(true); + const type = props.match.params.type; //判断用户名(username)是否注册 function usernameConfirm(rule, value, callback){ @@ -153,7 +155,8 @@ function Bind(props){ login: values.username, password: values.password, password_confirmation: values.confirm_password, - code: values.captcha + code: values.captcha, + type }).then(response=>{ if(response.data && response.data.status === -6){ //验证码不正确 @@ -161,6 +164,8 @@ function Bind(props){ }else if(response.data && response.data.status === 0){ //注册成功,页面跳转即可,注册后登录流程forge处理了 + cookie.save("supplyphone",true); + cookie.save("login",response.data.login); window.location.href = "/"+values.register_username; } }) From ef91e6ece94ef5b58148d689dd77fd3510e59094 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 29 Dec 2022 11:06:05 +0800 Subject: [PATCH 03/10] add --- src/forge/users/Personal/Index.jsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/forge/users/Personal/Index.jsx b/src/forge/users/Personal/Index.jsx index bff871d7c..4eaff92c2 100644 --- a/src/forge/users/Personal/Index.jsx +++ b/src/forge/users/Personal/Index.jsx @@ -12,13 +12,12 @@ function Personal(props){ const [ showedit , setShowEdit ] = useState(false); const [ description ,setDescription ] = useState(""); const [ copyDescription ,setCopyDescription ] = useState(""); + console.log(user); useEffect(()=>{ - if(user && user.super_description){ - setDescription(user.super_description); - setCopyDescription(user.super_description); - setShowEdit(true); - } - },[user]) + setDescription(user.super_description); + setCopyDescription(user.super_description); + setShowEdit(true); + },[user && user.super_description]) function onContentChange(value){ setDescription(value); From acb87c7e09d579eddd96d73fedd8f673bd1f8ae9 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 30 Dec 2022 11:59:33 +0800 Subject: [PATCH 04/10] update --- src/App.js | 2 +- src/AppConfig.js | 4 +- src/forge/Account/bind.jsx | 5 ++- src/forge/Account/unbind.jsx | 66 +++++++++++++++++++++++++----- src/forge/users/Personal/Index.jsx | 12 +++--- src/modules/login/LoginDialog.js | 4 +- 6 files changed, 70 insertions(+), 23 deletions(-) diff --git a/src/App.js b/src/App.js index b412c0e55..42f8bef51 100644 --- a/src/App.js +++ b/src/App.js @@ -159,7 +159,7 @@ class App extends Component { const login = cookie.load("login"); let path = this.props.history.location.pathname; - if(login && (path === "/login" || path === "/register" ||path === "/resetPassword" )){ + if(login && (path === "/login" || path === "/register" || path === "/resetPassword" || path.indexOf("/bindlogin") >-1 )){ this.props.history.push(`/${login}`); } // 添加路由监听,决定组织还是个人 diff --git a/src/AppConfig.js b/src/AppConfig.js index 74288bea1..e87c10bdf 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -26,7 +26,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 || '' } window._debugType = debugType; export function initAxiosInterceptors(props) { @@ -70,7 +70,7 @@ export function initAxiosInterceptors(props) { if (response.data.status === -1) { if (window.location.pathname.startsWith('/tasks/')) { props.showSnackbar(response.data.message || '服务器异常,请联系管理员。') - } else if(window.location.pathname.startsWith('/login') || window.location.pathname.startsWith('/register') || window.location.pathname.startsWith('/resetPassword')) { + } else if(window.location.pathname.startsWith('/login') || window.location.pathname.startsWith('/register') || window.location.pathname.startsWith('/resetPassword') || window.location.pathname.indexOf("/bindlogin/")>-1) { return response; } else { notification.open({ diff --git a/src/forge/Account/bind.jsx b/src/forge/Account/bind.jsx index aa009cb27..983c781b2 100644 --- a/src/forge/Account/bind.jsx +++ b/src/forge/Account/bind.jsx @@ -14,7 +14,6 @@ function Bind(props){ const { getFieldDecorator , getFieldsValue } = form; const [ bindFlag , setBindFlag] = useState(true); const type = props.match.params.type; - // 绑定登录 function bindloginFunc(){ const {username, password } = getFieldsValue(); @@ -23,10 +22,12 @@ function Bind(props){ axios.post(url,{ username,password,type }).then(result=>{ - if(result){ + if(result && result.data.status === 0){ cookie.save("supplyphone",true); cookie.save("login",result.data.login); window.location.href = "/"+result.data.login; + }else{ + props.showNotification(result.data.message); } }) } diff --git a/src/forge/Account/unbind.jsx b/src/forge/Account/unbind.jsx index 5bab356cc..84232eaa1 100644 --- a/src/forge/Account/unbind.jsx +++ b/src/forge/Account/unbind.jsx @@ -49,29 +49,50 @@ function Bind(props){ setCaptchaFlag(true); callback(`请输入正确的手机号或邮箱地址`); }else{ - setCaptchaFlag(false); - if(captcha && password && confirm_password && (password === confirm_password) && register_username){ - setBindFlag(false); - } + axios.get(`/accounts/valid_email_and_phone.json`, { + params: { + login: value, + type: 1 + } + }).then(response => { + if(response){ + if (response.data.status === -2) { + callback(response.data.message); + } else { + setCaptchaFlag(false); + if(captcha && password && confirm_password && (password === confirm_password) && register_username){ + setBindFlag(false); + } + } + callback(); + } + }) } - callback(); }else{ setBindFlag(true); callback(); } } function psdConfirm(r,v,c){ - if(v){ + if(!v){ + setBindFlag(true); + c('请输入登录密码'); + }else if(/(?!.*\s)(?!^[\u4e00-\u9fa5]+$)^.{8,16}$/.test(v)){ const { username , captcha , confirm_password , register_username } = getFieldsValue(); if(register_username && (phonereg.test(username) || emailreg.test(username)) && captcha && confirm_password && (v=== confirm_password) ){ setBindFlag(false); }else{ setBindFlag(true); } - c(); + c() }else{ - c(); - setBindFlag(true); + if(v.length<8 || v.length>16){ + setBindFlag(true); + c('密码长度为8-16个字符'); + }else{ + setBindFlag(true); + c('密码不能使用空格'); + } } } function captchaConfirm(r,v,c){ @@ -89,6 +110,28 @@ function Bind(props){ } } function repsdConfirm(r,v,c){ + if(!v){ + setBindFlag(true); + c("请重复输入登录密码"); + }else if(/(?!.*\s)(?!^[\u4e00-\u9fa5]+$)^.{8,16}$/.test(v)){ + const { username , password , register_username , captcha} = getFieldsValue(); + if(v !== password){ + c("两次输入的密码不一样"); + }else if((phonereg.test(username) || emailreg.test(username)) && password && register_username && captcha){ + setBindFlag(false); + }else{ + setBindFlag(true); + } + c(); + }else{ + if(v.length<8 || v.length>16){ + setBindFlag(true); + c('密码长度为8-16个字符'); + }else{ + setBindFlag(true); + c('密码不能使用空格'); + } + } if(v){ const { username , password , register_username , captcha} = getFieldsValue(); if(v !== password){ @@ -214,7 +257,8 @@ function Bind(props){ validator: (rule, value, callback) => { accountConfirm(rule, value, callback) } } ], - validateTrigger:"onInput", + validateTrigger:"onBlur", + validateFirst: true, })(} size="large" placeholder="请输入手机号或邮箱地址"/>)} @@ -261,7 +305,7 @@ function Bind(props){ validator: (rule, value, callback) => { repsdConfirm(rule, value, callback) } } ], - validateTrigger:"onBlur", + validateTrigger:"onInput", })( } className="psd" size="large" placeholder="请确认登录密码" />, )} diff --git a/src/forge/users/Personal/Index.jsx b/src/forge/users/Personal/Index.jsx index 4eaff92c2..b2ab6ea95 100644 --- a/src/forge/users/Personal/Index.jsx +++ b/src/forge/users/Personal/Index.jsx @@ -12,12 +12,14 @@ function Personal(props){ const [ showedit , setShowEdit ] = useState(false); const [ description ,setDescription ] = useState(""); const [ copyDescription ,setCopyDescription ] = useState(""); - console.log(user); + useEffect(()=>{ - setDescription(user.super_description); - setCopyDescription(user.super_description); - setShowEdit(true); - },[user && user.super_description]) + if(current_user && current_user.super_description){ + setDescription(current_user.super_description); + setCopyDescription(current_user.super_description); + setShowEdit(true); + } + },[current_user && current_user.super_description]) function onContentChange(value){ setDescription(value); diff --git a/src/modules/login/LoginDialog.js b/src/modules/login/LoginDialog.js index 01c3c52b8..0cdbf6c85 100644 --- a/src/modules/login/LoginDialog.js +++ b/src/modules/login/LoginDialog.js @@ -5,8 +5,8 @@ import { notification , Tooltip } from 'antd'; import axios from 'axios'; import educoderLogo from './educoder.png'; -import qqlogo from './qq.png'; -import WeChatlogo from './WeChat.png'; +import qqlogo from './qq@2x.png'; +import WeChatlogo from './WeChat@2x.png'; import giteelogo from './gitee.png'; import githublogo from './github.png'; import cookie from 'react-cookies'; From b1d13f4014aa9096d3ebf594323b604c2950bcfc Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 30 Dec 2022 13:53:36 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5-?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AE=80=E4=BB=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppConfig.js | 7 +++---- src/forge/users/Infos.js | 4 +--- src/forge/users/Personal/Index.jsx | 13 ++++++------- src/modules/user/usersInfo/InfosTopics.js | 11 +---------- 4 files changed, 11 insertions(+), 24 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index e87c10bdf..cf7fe8b6a 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -2,7 +2,6 @@ import axios from 'axios'; import { requestProxy } from "./indexEduplus2RequestProxy"; import { broadcastChannelOnmessage, isDev, queryString } from 'educoder'; import { notification } from 'antd'; -import cookie from 'react-cookies'; import './index.css'; @@ -17,7 +16,7 @@ function locationurl(list) { } } // TODO 开发期多个身份切换 -let debugType = ""; +let debugType = "" if (isDev) { const _search = window.location.search; let parsed = {}; @@ -26,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) { @@ -70,7 +69,7 @@ export function initAxiosInterceptors(props) { if (response.data.status === -1) { if (window.location.pathname.startsWith('/tasks/')) { props.showSnackbar(response.data.message || '服务器异常,请联系管理员。') - } else if(window.location.pathname.startsWith('/login') || window.location.pathname.startsWith('/register') || window.location.pathname.startsWith('/resetPassword') || window.location.pathname.indexOf("/bindlogin/")>-1) { + } else if(window.location.pathname.startsWith('/login') || window.location.pathname.startsWith('/register') || window.location.pathname.startsWith('/resetPassword')) { return response; } else { notification.open({ diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js index a703597a1..79b793a08 100644 --- a/src/forge/users/Infos.js +++ b/src/forge/users/Infos.js @@ -142,8 +142,6 @@ class Infos extends Component { }); const { current_user } = this.props; const { username } = this.props.match.params; - const { pathname } = this.props.location; - const { notice } = this.state; let url = `/users/${username || (current_user && current_user.login)}.json`; axios.get(url).then((result) => { @@ -461,7 +459,7 @@ class Infos extends Component { { - return ; + return ; }} > {/* { - if(current_user && current_user.super_description){ - setDescription(current_user.super_description); - setCopyDescription(current_user.super_description); + if(user && user.super_description){ + setDescription(user.super_description); + setCopyDescription(user.super_description); setShowEdit(true); } - },[current_user && current_user.super_description]) + },[user && user.super_description]) function onContentChange(value){ setDescription(value); @@ -52,7 +51,7 @@ function Personal(props){ setCopyDescription(description); setEdit(false); setShowEdit(description ?true :false); - resetUserInfo && resetUserInfo(); + generalFetchUser && generalFetchUser(); } }) } diff --git a/src/modules/user/usersInfo/InfosTopics.js b/src/modules/user/usersInfo/InfosTopics.js index 56820fa4a..d80bb0700 100644 --- a/src/modules/user/usersInfo/InfosTopics.js +++ b/src/modules/user/usersInfo/InfosTopics.js @@ -1,9 +1,6 @@ import React, { Component } from 'react'; -import { SnackbarHOC } from 'educoder'; -import {BrowserRouter as Router,Route,Switch,Link} from 'react-router-dom'; -import {Tooltip,Menu,Pagination,Spin, Dropdown,Checkbox} from 'antd'; +import {Menu,Pagination,Spin, Dropdown,Checkbox} from 'antd'; import axios from 'axios'; -import {getImageUrl,WordsBtn} from 'educoder'; import moment from 'moment'; import Modals from '../../modals/Modals'; import SendTopics from '../../modals/SendTopics' @@ -313,12 +310,6 @@ class InfosTopics extends Component{ let user_type=this.props.current_user&&this.props.current_user.user_identity; let targetuserid=this.props.data&&this.props.data.id; - - - // console.log(is_current) - // console.log(current_user) - // console.log(current_user.is_teacher) - // console.log(current_user.admin) const menu = ( this.updatedlist("updated_at")}> From 2731d54fd197d2482358b86ad156bd2fb068cbb0 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 5 Jan 2023 13:26:19 +0800 Subject: [PATCH 06/10] issue --- src/forge/Main/CoderRootCommit.js | 6 ++++-- src/forge/Order/order.scss | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/forge/Main/CoderRootCommit.js b/src/forge/Main/CoderRootCommit.js index 3df0bfef8..063afa407 100644 --- a/src/forge/Main/CoderRootCommit.js +++ b/src/forge/Main/CoderRootCommit.js @@ -1,5 +1,5 @@ import React , { Component } from 'react'; -import { Spin , Pagination, Timeline } from 'antd'; +import { Spin , Pagination, Timeline , Tooltip } from 'antd'; import { getImageUrl , returnbar } from 'educoder'; import { truncateCommitId ,timeFormat } from '../common/util'; import { AlignTop } from '../Component/layout'; @@ -200,7 +200,9 @@ class CoderRootCommit extends Component{ - + + + diff --git a/src/forge/Order/order.scss b/src/forge/Order/order.scss index bff07c9a8..036fd1613 100644 --- a/src/forge/Order/order.scss +++ b/src/forge/Order/order.scss @@ -5,6 +5,27 @@ justify-content: space-between; flex-wrap: wrap; } +.markdown-body{ + overflow: inherit; +} +.markdown_anchors{ + position: relative; +} +.markdown_anchors:hover { + .anchors{ + display: inline-block; + } +} +.markdown_anchors { + .anchors:hover{ + text-decoration: none; + } +} +.markdown_anchors .anchors { + color: inherit; + margin-left: -14px; + display: none; +} .quillContent { position: relative; margin-bottom: 4px; From 8f75ed46370ff0f5885180a953aac0a16e3dd4f5 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 6 Jan 2023 10:52:57 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E5=8A=A8=E6=80=81-=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Activity/Activity.js | 48 +++++++++++++++++++++++++++++++-- src/forge/Activity/activity.css | 42 +++++++++++++++++++++++++++++ src/forge/Main/version/New.jsx | 5 ++-- 3 files changed, 90 insertions(+), 5 deletions(-) diff --git a/src/forge/Activity/Activity.js b/src/forge/Activity/Activity.js index 5f04acfcc..42e51d186 100644 --- a/src/forge/Activity/Activity.js +++ b/src/forge/Activity/Activity.js @@ -1,5 +1,6 @@ import React , { Component } from 'react'; -import { Dropdown , Menu , Icon , Pagination , Spin } from 'antd'; +import { Dropdown , Menu , Icon , Pagination , Spin , Tooltip } from 'antd'; +import { getImageUrl } from 'educoder'; import '../css/index.scss'; import '../Branch/branch.scss'; import './activity.css'; @@ -49,6 +50,8 @@ class Activity extends Component{ data:undefined, project_trends:undefined, + codeStatus:undefined, + isSpin:false } } @@ -59,6 +62,19 @@ class Activity extends Component{ isSpin:true }) this.getInfo(time,type,status,page); + this.getCodeInfo(); + } + + getCodeInfo(){ + const { projectsId , owner } = this.props.match.params; + const url = `/v1/${owner}/${projectsId}/code_stats.json`; + axios.get(url).then(result=>{ + if(result){ + this.setState({ + codeStatus:result.data + }) + } + }).catch(error=>{}) } componentDidUpdate(){ @@ -140,7 +156,7 @@ class Activity extends Component{ render(){ const { time , data , page , project_trends , isSpin , pr_count , new_pr_count , close_issues_count , open_issues_count , pr_all_count ,issues_count, - type,status } = this.state; + type,status , codeStatus } = this.state; let name = time ? ARRAY.filter(item=>item.id === parseInt(time)) :[{name:"全部"}]; const first_per = pr_all_count > 0 ? `${parseFloat(pr_count/pr_all_count).toFixed(2)*100}%` :"50%"; @@ -148,6 +164,7 @@ class Activity extends Component{ const third_per =issues_count > 0 ?`${parseFloat(close_issues_count/issues_count).toFixed(2)*100}%` :"50%"; const fourth_per =issues_count > 0 ?`${parseFloat(open_issues_count/issues_count).toFixed(2)*100}%` :"50%"; + const {projectDetail} = this.props; return(
@@ -187,6 +204,33 @@ class Activity extends Component{ this.changeTrends("Issue","not_delay")}>未处理的疑修 + { + codeStatus && +
+
排除合并, + {codeStatus.author_count} 作者 已经推送 {codeStatus.commit_count} 提交 到 + {codeStatus.commit_count_in_all_branches && codeStatus.commit_count_in_all_branches>0? {projectDetail && projectDetail.default_branch} 和 {codeStatus.commit_count_in_all_branches} 提交 到所有分支:""}。 在 {projectDetail && projectDetail.default_branch} 上, + {codeStatus.change_files && codeStatus.change_files >0 ? {codeStatus.change_files} 文件 已经改变 而且:""} + {codeStatus.additions && codeStatus.additions >0 ?新增 {codeStatus.additions} 行:""} + {(codeStatus.additions && codeStatus.additions >0) &&(codeStatus.deletions && codeStatus.deletions >0) ?:""} + {codeStatus.deletions && codeStatus.deletions >0 ?删除 {codeStatus.deletions} 行:""}.
+ { + codeStatus.authors && codeStatus.authors.length > 0 && + + } +
+ }
diff --git a/src/forge/Activity/activity.css b/src/forge/Activity/activity.css index 60e9895a2..f1ac39be7 100644 --- a/src/forge/Activity/activity.css +++ b/src/forge/Activity/activity.css @@ -60,6 +60,48 @@ .percentBox > li:last-child{ border-right: none; } +.prMsg{ + padding:0px 20px; + border-top: 1px solid #f4f4f4; +} +.prMsg > div{ + padding:20px 20px 20px 0px; + line-height: 22px; + border-right:1px solid #f4f4f4; + width: 50%; +} +.prMsg > div span.fontbold{ + font-weight: 500; +} +.prMsg > div span.fontbold.greencount{ + color: green; +} +.prMsg > div span.fontbold.redcount{ + color: red; +} +.prAuthor{ + padding-bottom: 20px; + display: flex; + border-right:1px solid #f4f4f4; + width: 50%; + flex-wrap: wrap; +} +.prAuthor a{ + display: flex; + flex-direction: column; + align-items: center; + width: 78px; +} +.prAuthor a img{ + border-radius: 50%; +} +.prAuthor a span{ + display: block; + max-width: 78px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} .activity_list .activity_item{ border-bottom: 1px solid #f4f4f4; padding:15px 0px; diff --git a/src/forge/Main/version/New.jsx b/src/forge/Main/version/New.jsx index e388e4078..3196af523 100644 --- a/src/forge/Main/version/New.jsx +++ b/src/forge/Main/version/New.jsx @@ -260,9 +260,8 @@ export default Form.create()(

附件大小说明

- 单个附件不能超过 100M(GVP 项目200M),每个仓库总附件不可超过 - 1G(推荐项目不可超过 5G;GVP 项目不可超过 - 20G)。附件总容量统计包括仓库附件和发行版附件。 + 单个附件不能超过 100M,每个仓库总附件不可超过 + 1G。附件总容量统计包括仓库附件和发行版附件。

From 2438ee2e6cfd883829b0ec0b6f26664a7bc2c7ea Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 9 Jan 2023 16:29:23 +0800 Subject: [PATCH 08/10] issue --- src/forge/Activity/Activity.js | 20 ++++++++++++++------ src/forge/Activity/activity.css | 6 +++--- src/forge/Order/Detail.js | 2 +- src/forge/Order/order.scss | 21 --------------------- src/forge/css/index.scss | 24 ++++++++++++++++++++++++ 5 files changed, 42 insertions(+), 31 deletions(-) diff --git a/src/forge/Activity/Activity.js b/src/forge/Activity/Activity.js index 42e51d186..342ce388a 100644 --- a/src/forge/Activity/Activity.js +++ b/src/forge/Activity/Activity.js @@ -212,18 +212,26 @@ class Activity extends Component{ {codeStatus.commit_count_in_all_branches && codeStatus.commit_count_in_all_branches>0? {projectDetail && projectDetail.default_branch} 和 {codeStatus.commit_count_in_all_branches} 提交 到所有分支:""}。 在 {projectDetail && projectDetail.default_branch} 上, {codeStatus.change_files && codeStatus.change_files >0 ? {codeStatus.change_files} 文件 已经改变 而且:""} {codeStatus.additions && codeStatus.additions >0 ?新增 {codeStatus.additions} 行:""} - {(codeStatus.additions && codeStatus.additions >0) &&(codeStatus.deletions && codeStatus.deletions >0) ?:""} - {codeStatus.deletions && codeStatus.deletions >0 ?删除 {codeStatus.deletions} 行:""}.
+ {(codeStatus.additions && codeStatus.additions >0) &&(codeStatus.deletions && codeStatus.deletions >0) ?:""} + {codeStatus.deletions && codeStatus.deletions >0 ? 删除 {codeStatus.deletions} 行:""}. { codeStatus.authors && codeStatus.authors.length > 0 &&
    { codeStatus.authors.map((i,v)=>{ return( - - - {i.author && i.author.name} - + i.author ? + (!i.author.login && !i.author.email) ? + + + {i.author && i.author.name} + + : + + + {i.author && i.author.name} + + :"" ) }) } diff --git a/src/forge/Activity/activity.css b/src/forge/Activity/activity.css index f1ac39be7..d53c52490 100644 --- a/src/forge/Activity/activity.css +++ b/src/forge/Activity/activity.css @@ -86,16 +86,16 @@ width: 50%; flex-wrap: wrap; } -.prAuthor a{ +.prAuthor a,.prAuthor> span{ display: flex; flex-direction: column; align-items: center; width: 78px; } -.prAuthor a img{ +.prAuthor a img,.prAuthor> span img{ border-radius: 50%; } -.prAuthor a span{ +.prAuthor a span,.prAuthor> span span{ display: block; max-width: 78px; overflow: hidden; diff --git a/src/forge/Order/Detail.js b/src/forge/Order/Detail.js index 5dc19bb8c..e76c24451 100644 --- a/src/forge/Order/Detail.js +++ b/src/forge/Order/Detail.js @@ -1,4 +1,4 @@ -import React, { Component, useRef } from "react"; +import React, { Component } from "react"; import { Link } from "react-router-dom"; import axios from "axios"; diff --git a/src/forge/Order/order.scss b/src/forge/Order/order.scss index 036fd1613..bff07c9a8 100644 --- a/src/forge/Order/order.scss +++ b/src/forge/Order/order.scss @@ -5,27 +5,6 @@ justify-content: space-between; flex-wrap: wrap; } -.markdown-body{ - overflow: inherit; -} -.markdown_anchors{ - position: relative; -} -.markdown_anchors:hover { - .anchors{ - display: inline-block; - } -} -.markdown_anchors { - .anchors:hover{ - text-decoration: none; - } -} -.markdown_anchors .anchors { - color: inherit; - margin-left: -14px; - display: none; -} .quillContent { position: relative; margin-bottom: 4px; diff --git a/src/forge/css/index.scss b/src/forge/css/index.scss index ddb307636..943b9ab4d 100644 --- a/src/forge/css/index.scss +++ b/src/forge/css/index.scss @@ -1,6 +1,30 @@ ul,ol,dl{ margin-bottom: 0px; } +.markdown-body{ + overflow: inherit; +} +.markdown-body a{ + color: #6e90ff; +} +.markdown_anchors{ + position: relative; +} +.markdown_anchors:hover { + .anchors{ + display: inline-block; + } +} +.markdown_anchors { + .anchors:hover{ + text-decoration: none; + } +} +.markdown_anchors .anchors { + color: inherit; + margin-left: -14px; + display: none; +} .newMain{ background-color: #fff; } From 11ad5150ca56a9140f1e8f0278c27c6fdf601e85 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 10 Jan 2023 14:29:22 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E9=A1=B5=E9=9D=A2-?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/New/Index.js | 2 +- src/forge/Upload/Index.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/forge/New/Index.js b/src/forge/New/Index.js index 86709b9cf..1794d8e40 100644 --- a/src/forge/New/Index.js +++ b/src/forge/New/Index.js @@ -635,7 +635,7 @@ class Index extends Component { - 取消 + window.history.back(-1)} className="btn_32">取消 diff --git a/src/forge/Upload/Index.js b/src/forge/Upload/Index.js index f979fe7f5..985e06ba5 100644 --- a/src/forge/Upload/Index.js +++ b/src/forge/Upload/Index.js @@ -62,6 +62,7 @@ class Index extends Component { const { changeIsComplete } = this.props; changeIsComplete && changeIsComplete(true); const file = info.file; + console.log(file); if(file && !file.type){ let flag = this.checkFile(file.name); if(!flag) return; From e2b9f16f60897c79180f20663fb94f613420e2f9 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 11 Jan 2023 09:23:16 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Activity/Activity.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/forge/Activity/Activity.js b/src/forge/Activity/Activity.js index 342ce388a..8e28c1fbc 100644 --- a/src/forge/Activity/Activity.js +++ b/src/forge/Activity/Activity.js @@ -221,7 +221,7 @@ class Activity extends Component{ codeStatus.authors.map((i,v)=>{ return( i.author ? - (!i.author.login && !i.author.email) ? + !i.author.id ? {i.author && i.author.name}