diff --git a/public/css/iconfont.css b/public/css/iconfont.css index 47753be5a..f877beb85 100644 --- a/public/css/iconfont.css +++ b/public/css/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: "iconfont"; /* Project id 2340181 */ - src: url('iconfont.woff2?t=1726630002422') format('woff2'), - url('iconfont.woff?t=1726630002422') format('woff'), - url('iconfont.ttf?t=1726630002422') format('truetype'); + src: url('iconfont.woff2?t=1727340588188') format('woff2'), + url('iconfont.woff?t=1727340588188') format('woff'), + url('iconfont.ttf?t=1727340588188') format('truetype'); } .iconfont { @@ -449,6 +449,10 @@ content: "\e90e"; } +.icon-shanchu_important:before { + content: "\f1d8"; +} + .icon-shanchu_tc_icon1:before { content: "\e90c"; } diff --git a/public/css/iconfont.js b/public/css/iconfont.js index abfff7ff8..433c5d5f1 100644 --- a/public/css/iconfont.js +++ b/public/css/iconfont.js @@ -1 +1 @@ -window._iconfont_svg_string_2340181='',(c=>{var a=(l=(l=document.getElementsByTagName("script"))[l.length-1]).getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var h,i,o,z,t,p=function(a,l){l.parentNode.insertBefore(a,l)};if(a&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}h=function(){var a,l=document.createElement("div");l.innerHTML=c._iconfont_svg_string_2340181,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(a=document.body).firstChild?p(l,a.firstChild):a.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),h()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=h,z=c.document,t=!1,m(),z.onreadystatechange=function(){"complete"==z.readyState&&(z.onreadystatechange=null,v())})}function v(){t||(t=!0,o())}function m(){try{z.documentElement.doScroll("left")}catch(a){return void setTimeout(m,50)}v()}})(window); \ No newline at end of file +window._iconfont_svg_string_2340181='',(c=>{var a=(l=(l=document.getElementsByTagName("script"))[l.length-1]).getAttribute("data-injectcss"),l=l.getAttribute("data-disable-injectsvg");if(!l){var h,i,o,z,t,p=function(a,l){l.parentNode.insertBefore(a,l)};if(a&&!c.__iconfont__svg__cssinject__){c.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}h=function(){var a,l=document.createElement("div");l.innerHTML=c._iconfont_svg_string_2340181,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(a=document.body).firstChild?p(l,a.firstChild):a.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),h()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=h,z=c.document,t=!1,m(),z.onreadystatechange=function(){"complete"==z.readyState&&(z.onreadystatechange=null,v())})}function v(){t||(t=!0,o())}function m(){try{z.documentElement.doScroll("left")}catch(a){return void setTimeout(m,50)}v()}})(window); \ No newline at end of file diff --git a/public/css/iconfont.json b/public/css/iconfont.json index 86e5e9a06..4ebfc428b 100644 --- a/public/css/iconfont.json +++ b/public/css/iconfont.json @@ -768,6 +768,13 @@ "unicode": "e90e", "unicode_decimal": 59662 }, + { + "icon_id": "41976790", + "name": "shanchu_tc_icon-copy", + "font_class": "shanchu_important", + "unicode": "f1d8", + "unicode_decimal": 61912 + }, { "icon_id": "26470602", "name": "shanchu_tc_icon", diff --git a/public/css/iconfont.ttf b/public/css/iconfont.ttf index 0d1c0f1e4..30b005296 100644 Binary files a/public/css/iconfont.ttf and b/public/css/iconfont.ttf differ diff --git a/public/css/iconfont.woff b/public/css/iconfont.woff index 48704cce2..fad2a7bab 100644 Binary files a/public/css/iconfont.woff and b/public/css/iconfont.woff differ diff --git a/public/css/iconfont.woff2 b/public/css/iconfont.woff2 index 78127d363..d8eab05f1 100644 Binary files a/public/css/iconfont.woff2 and b/public/css/iconfont.woff2 differ diff --git a/src/AppConfig.js b/src/AppConfig.js index 56a67e016..6723ab141 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -17,16 +17,16 @@ function locationurl(list) { } // TODO 开发期多个身份切换 let debugType = "" -if (isDev) { - const _search = window.location.search; - let parsed = {}; - if (_search) { - parsed = queryString.parse(_search); - } - 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' -} +// if (isDev) { +// const _search = window.location.search; +// let parsed = {}; +// if (_search) { +// parsed = queryString.parse(_search); +// } +// 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 || 'student' +// } window._debugType = debugType; export function initAxiosInterceptors(props) { // 判断网络是否连接 @@ -45,19 +45,20 @@ export function initAxiosInterceptors(props) { requestProxy(config); let url = `/api${config.url}`; - if (`${config[0]}` !== `true`) { - if (window.location.port === "3007") { - config.url = `${proxy}${url}`; - if (config.url.indexOf('?') === -1) { - config.url = `${config.url}?debug=${debugType}`; - } else { - config.url = `${config.url}&debug=${debugType}`; - } - } else { - config.url = url; - } - } + // if (`${config[0]}` !== `true`) { + // if (window.location.port === "3007") { + // config.url = `${proxy}${url}`; + // if (config.url.indexOf('?') === -1) { + // config.url = `${config.url}?debug=${debugType}`; + // } else { + // config.url = `${config.url}&debug=${debugType}`; + // } + // } else { + // config.url = url; + // } + // } config.withCredentials = false; + config.url = url; return config; }, err => { @@ -100,7 +101,7 @@ export function initAxiosInterceptors(props) { // 组织和个人的拥有情况,404不跳转 if (responseURL.indexOf('/api/users/') === -1 && responseURL.indexOf('/api/organizations/') === -1 ) { // 邀请页面不进行404跳转 - if( window.location.pathname.includes('/invite') && (responseURL.includes('/simple.json')||responseURL.includes('/detail.json')||responseURL.includes('/menu_list.json')||responseURL.includes('/entries.json'))){ + if( window.location.pathname.includes('/invite') && (responseURL.includes('/simple.json')||responseURL.includes('/detail.json')||responseURL.includes('/menu_list.json'))||responseURL.includes('/entries.json')){ }else{ locationurl('/nopage'); } diff --git a/src/forge/Merge/MergeItem.js b/src/forge/Merge/MergeItem.js index 583e71651..7cace1e5d 100644 --- a/src/forge/Merge/MergeItem.js +++ b/src/forge/Merge/MergeItem.js @@ -114,10 +114,8 @@ class MergeItem extends Component { item.is_original ? ( (item.fork_project_user && item.fork_project_identifier) ? - + {item.fork_project_user_name || "仓库已删除"} : {item.pull_request_head || "分支已删除"} : diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js index 251db6fef..767444e49 100644 --- a/src/forge/Merge/MessageCount.js +++ b/src/forge/Merge/MessageCount.js @@ -405,10 +405,10 @@ class MessageCount extends Component {
- {data.pull_request && data.pull_request.fork_project_user}: {data.pull_request && data.pull_request.head} + {data.pull_request && (data.pull_request.is_original ? data.pull_request.fork_project_user:data.issue.author_name)}: {data.pull_request && data.pull_request.head} @@ -423,7 +423,7 @@ class MessageCount extends Component { to={`/${owner}/${projectsId}/tree/${data.pull_request.base}`} className="ver-middle task-hide" style={{maxWidth:"300px"}} title={`${data.issue.project_author_name}:${data.pull_request.base}`} > - {data.issue.project_author}: {data.pull_request.base} + {data.issue.project_author_name}: {data.pull_request.base}
diff --git a/src/forge/SecuritySetting/bot/disposition/index.jsx b/src/forge/SecuritySetting/bot/disposition/index.jsx index 5c7a125f6..d2e685a33 100644 --- a/src/forge/SecuritySetting/bot/disposition/index.jsx +++ b/src/forge/SecuritySetting/bot/disposition/index.jsx @@ -6,6 +6,7 @@ import nullBot from '../../../../softbot/image/notBot.png'; import { getAllInstallBots, deleteInstallBot } from "../../../../softbot/api"; import './index.scss'; import axios from "axios"; +import LogoBot from '../../../Settings/image/logoBot.png'; // 配置已安装的bot function DispositionBot(props){ @@ -85,7 +86,7 @@ function DispositionBot(props){ {botList && (botList.length > 0 ?
{botList.map((item, index)=>{return
- + -1 || item.logo.indexOf("412603")>-1)) ? getImageUrl(item.logo) : LogoBot} alt="" className="imgBox mr20"/> {item.bot_name} {item.state === 0 ? '挂起' : '启用'}
diff --git a/src/forge/SecuritySetting/bot/exploit/index.jsx b/src/forge/SecuritySetting/bot/exploit/index.jsx index db4a9667e..a234457e1 100644 --- a/src/forge/SecuritySetting/bot/exploit/index.jsx +++ b/src/forge/SecuritySetting/bot/exploit/index.jsx @@ -6,6 +6,7 @@ import { getImageUrl } from 'educoder'; import { getMyBot, getTransferToBot, receiveTransferBot, refuseTransferBot } from "../../../../softbot/api"; import nullBot from '../../../../softbot/image/notBot1.png'; import moment from "moment"; +import LogoBot from '../../../Settings/image/logoBot.png'; function ExploitBot(props){ const {current_user} = props; @@ -96,7 +97,7 @@ function ExploitBot(props){ {botList && (botList.length > 0 ?
{botList.map((item, index)=>{return
- + -1 || item.logo.indexOf("412603")>-1)) ? getImageUrl(item.logo) : LogoBot} alt="" className="imgBox mr20" object-fit="fill"/> {item.bot_name} {item.is_public ? item.is_market ? '上架' : '公开' : '私有'}
diff --git a/src/forge/SecuritySetting/bot/exploit/new/index.jsx b/src/forge/SecuritySetting/bot/exploit/new/index.jsx index bdecfa7de..f11ffbc80 100644 --- a/src/forge/SecuritySetting/bot/exploit/new/index.jsx +++ b/src/forge/SecuritySetting/bot/exploit/new/index.jsx @@ -83,7 +83,7 @@ function Disposition(props){ bot_name, bot_des, webhook, is_public, login: current_user && current_user.login, user_id: current_user && current_user.user_id, - logo: `/api/attachments/${window.location.host !== 'www.gitlink.org.cn' ? 347246 : 412603}`, + // logo: `/api/attachments/${window.location.host !== 'www.gitlink.org.cn' ? 347246 : 412603}`, limit_and_events: { event_code: event_code ? event_code.toString() : '', event_pr: event_pr ? event_pr.toString() : '', diff --git a/src/forge/Settings/image/logoBot.png b/src/forge/Settings/image/logoBot.png new file mode 100644 index 000000000..9bcd94646 Binary files /dev/null and b/src/forge/Settings/image/logoBot.png differ diff --git a/src/forge/Settings/softBot.jsx b/src/forge/Settings/softBot.jsx index ec371767c..7719a2e69 100644 --- a/src/forge/Settings/softBot.jsx +++ b/src/forge/Settings/softBot.jsx @@ -6,6 +6,7 @@ import './setting.scss'; import { useEffect } from "react"; import { getStoreAllInstallBots } from "../../softbot/api"; import { getImageUrl } from 'educoder'; +import LogoBot from './image/logoBot.png'; function SoftBot(props){ const {projectDetail} = props; @@ -34,7 +35,7 @@ function SoftBot(props){ {botList && (botList.length > 0 ?
{botList.map((item, index)=>{return
- + -1 || item.logo.indexOf("412603")>-1)) ? getImageUrl(item.logo) : LogoBot} alt="" className="imgBox mr20"/> {item.bot_name} {item.state === 0 ? '挂起' : '启用'}
diff --git a/src/forge/users/Material/Password.jsx b/src/forge/users/Material/Password.jsx index c9ef3a183..c07984dbe 100644 --- a/src/forge/users/Material/Password.jsx +++ b/src/forge/users/Material/Password.jsx @@ -7,6 +7,7 @@ import img1 from '../../Images/personalInfo3.png'; import { setmiyah } from '../../../common/Component'; import { useEffect } from 'react'; import Phone from './Phone'; +import OffAccount from './component/offAccount'; export default Form.create()( forwardRef((props)=>{ @@ -20,6 +21,9 @@ export default Form.create()( const [ passMap, setPassMap] = useState({password: undefined, email: undefined, code: undefined}); const [ updatePsdMap, setUpdatePsdMap] = useState({oldPassword: undefined, password: undefined, password1: undefined}); const [ visible, setVisible] = useState(false); + const [ offVisible , setOffVisible ] = useState(false); + const [ offAgain , setOffAgain ] = useState(false); + const [ offLoading , setOffLoading ] = useState(false); useEffect(()=>{ setPassMap({password: undefined, email: undefined, code: undefined}); @@ -239,6 +243,27 @@ export default Form.create()( }).catch(error=>{}) } } + // 注销账号检测 + function checkAccount(){ + if(current_user){ + setOffLoading(true); + const url = `/v1/${current_user.login}/check_user_can_delete.json`; + Axios.post(url).then(result=>{ + if(result.data){ + let can_delete = result.data.can_delete; + if(can_delete === false){ + setOffAgain(true); + message.error("当前账号名下存在未删除或退出的组织/仓库,请先删除或退出后再尝试注销操作"); + } else { + setOffAgain(false); + setOffVisible(true); + message.success("已满足注销条件"); + } + setOffLoading(false); + } + }).catch(error=>{}) + } + } // type: 0邮箱管理 1密码管理 2账号注销 return( @@ -337,12 +362,12 @@ export default Form.create()(
请您谨慎操作,注销后帐号内所有数据都会被清空,且无法恢复帐号!
- GitLink目前提供邮件渠道帐号注销服务。如需注销帐号,请通过发送邮件注销申请邮件到 gitlink@ccf.org.cn
- 相关注意事项如下:
- 必须使用要注销的 GitLink 帐号所绑定的邮箱地址发送邮件。 - 发送注销申请邮件之前确认帐号下无创建/加入组织,帐号名下无仓库信息。 - 邮件标题: 注销 GitLink 帐号,邮件正文请注明要注销帐号的邮箱和昵称。 - 发送邮件后,我们会积极处理,请耐心等候我们的邮件回复。 + 您可点击按钮完成账号的注销,注销后相关数据将不可恢复,注意事项如下:
+ 请确认需注销的帐号未加入任何组织的owner团队,若owner团队仅此一人,则该组织将被删除。 + 注销账号后,该账号名下所有仓库将被删除,请进行备份以防数据的丢失。 + 注销账号后,该账号在Gitlink产生的所有过程数据(如疑修,合并请求,论坛帖子等)也将被删除。 + 注销后你将丢失该帐号产生的所有数据,一旦注销相关数据将不可恢复,请输入登录密码再次确认。 + { current_user && }
: @@ -364,6 +389,7 @@ export default Form.create()(

{type === '0' ? '更改邮箱后,您在GitLink的登录账号、接收通知的邮件地址将同步变更。请再次确认。' : '更改密码后,您在GitLink的登录密码将同步变更。请再次确认。'}

+ {setOffVisible(false)}} {...props}/> )}) ) \ No newline at end of file diff --git a/src/forge/users/Material/component/offAccount.jsx b/src/forge/users/Material/component/offAccount.jsx index eafb8eb47..44acb2e8e 100644 --- a/src/forge/users/Material/component/offAccount.jsx +++ b/src/forge/users/Material/component/offAccount.jsx @@ -1,26 +1,46 @@ -import React , { forwardRef } from 'react'; +import React , { forwardRef, useState } from 'react'; import { Modal , Form , Button , Input } from 'antd'; +import Axios from 'axios'; +const { TextArea } = Input; export default Form.create()(forwardRef((props)=>{ - const { getFieldDecorator , validateFields, resetFields, getFieldsValue } = props && props.form; - const { onCancel, visible, onOk} = props; + const { getFieldDecorator , validateFields } = props && props.form; + const { onCancel, visible , current_user} = props; + const [ loading , setLoading ] =useState(false); + + + function onDelete(){ + validateFields((error,values)=>{ + if(!error && current_user){ + setLoading(true); + const url = `/v1/${current_user.login}.json`; + Axios.delete(url,{ + data:{...values} + }).then(result=>{ + if(result.data && result.data.status === 0){ + window.location.href = `/`; + onCancel(); + } + setLoading(false); + }).catch(error=>{setLoading(false);}) + + } + }) + } return( - - -
- } + footer={null} + onCancel={onCancel} + destroyOnClose={true} >
-

是否仍要注销?

-

注销后你将丢失该帐号产生的所有数据,一旦注销相关数据将不可恢复,请输入登录密码再次确认

-
- +

是否仍要注销?

+

注销后你将丢失该帐号产生的所有数据,一旦注销相关数据将不可恢复,请输入登录密码再次确认

+ + {getFieldDecorator("password",{ rules:[ {required:true,message:"请输入登录密码"}, @@ -32,7 +52,19 @@ export default Form.create()(forwardRef((props)=>{ )} + + {getFieldDecorator("memo",{ + rules:[{required:true,message:"请输入注销原因"}], + })( +