注销登录+softbot新建不传logo

This commit is contained in:
caishi 2024-09-27 11:10:16 +08:00
parent 6e5ce131c3
commit defdcb3dc3
20 changed files with 137 additions and 64 deletions

View File

@ -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";
}

File diff suppressed because one or more lines are too long

View File

@ -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",

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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');
}

View File

@ -114,10 +114,8 @@ class MergeItem extends Component {
item.is_original ?
(
(item.fork_project_user && item.fork_project_identifier) ?
<Link
to={`/${ item.fork_project_user }/${ item.fork_project_identifier }/tree/${turnbar(item.pull_request_head)}`}
className="maxW200px task-hide ver-middle" style={{maxWidth:"300px"}}
>
<Link to={`/${ item.fork_project_user }/${ item.fork_project_identifier }/tree/${turnbar(item.pull_request_head)}`}
className="maxW200px task-hide ver-middle" style={{maxWidth:"300px"}} >
{item.fork_project_user_name || "仓库已删除"} : {item.pull_request_head || "分支已删除"}
</Link>
:

View File

@ -405,10 +405,10 @@ class MessageCount extends Component {
<div className="mt15">
<Tag className="pr-branch-tag">
<Link
to={`/${data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author}/${data.pull_request.is_original?data.project_identifier:projectsId}/tree/${turnbar(data.pull_request && data.pull_request.head)}`}
to={`/${data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.author_name}/${data.pull_request.is_original?data.project_identifier:projectsId}/tree/${turnbar(data.pull_request && data.pull_request.head)}`}
className="ver-middle task-hide" style={{maxWidth:"300px"}} title={`${data.pull_request.fork_project_user}: ${data.pull_request && data.pull_request.head}`}
>
{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}
</Link>
</Tag>
<span className="mr8 ver-middle">
@ -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}
</Link>
</Tag>
</div>

View File

@ -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 ? <div className="setBotListBox">
{botList.map((item, index)=>{return <div className="disBotItem" key={index}>
<div className="botNameLeft">
<img src={getImageUrl(item.logo)} alt="" className="imgBox mr20"/>
<img src={(item.logo && !(item.logo.indexOf("347246")>-1 || item.logo.indexOf("412603")>-1)) ? getImageUrl(item.logo) : LogoBot} alt="" className="imgBox mr20"/>
<Link className="font-15 botName" to={`/settings/installbot/${item.bot_id}`}>{item.bot_name}</Link>
<span className={`statusBox font-12 ml10 ${item.state === 0 ? '' : 'active'}`}>{item.state === 0 ? '挂起' : '启用'}</span>
</div>

View File

@ -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 ? <div className="softBotListBox">
{botList.map((item, index)=>{return <div className="softBotItem" key={index}>
<div className="botOneLine botNameWarpBox">
<img src={getImageUrl(item.logo)} alt="" className="imgBox mr20" object-fit="fill"/>
<img src={(item.logo && !(item.logo.indexOf("347246")>-1 || item.logo.indexOf("412603")>-1)) ? getImageUrl(item.logo) : LogoBot} alt="" className="imgBox mr20" object-fit="fill"/>
<Link className="font-15 botOneLine botNameBox" to={`/settings/mybot/configuration/${item.bot_id}`}>{item.bot_name}</Link>
<span className={`font-12 ml10 statusBot ${item.is_public ? item.is_market ? 'market' : 'public' : 'private'}`}>{item.is_public ? item.is_market ? '上架' : '公开' : '私有'}</span>
</div>

View File

@ -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() : '',

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -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 ? <div className="botListBox">
{botList.map((item, index)=>{return <div className="disBotItem" key={index}>
<div className="flexCenter">
<img src={getImageUrl(item.logo)} alt="" className="imgBox mr20"/>
<img src={(item.logo && !(item.logo.indexOf("347246")>-1 || item.logo.indexOf("412603")>-1)) ? getImageUrl(item.logo) : LogoBot} alt="" className="imgBox mr20"/>
<span className="font-15 botName">{item.bot_name}</span>
<span className={`statusBox font-12 ml10 ${item.state === 0 ? '' : 'active'}`}>{item.state === 0 ? '挂起' : '启用'}</span>
</div>

View File

@ -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(
<Fragment>
@ -337,12 +362,12 @@ export default Form.create()(
<div>
<div className='tipsBox mb15'><img src={img1} alt="" width={16} className='mr10'/>请您谨慎操作注销后帐号内所有数据都会被清空且无法恢复帐号!</div>
<div className='tipCont'>
GitLink目前提供邮件渠道帐号注销服务如需注销帐号请通过发送邮件注销申请邮件到 <span className='orange'>gitlink@ccf.org.cn</span><br/>
相关注意事项如下:<br/>
<span className='oneTipBox mt10'>必须使用要注销的 GitLink 帐号所绑定的邮箱地址发送邮件</span>
<span className='oneTipBox mt5'>发送注销申请邮件之前确认帐号下无创建/加入组织帐号名下无仓库信息</span>
<span className='oneTipBox mt5'>邮件标题: 注销 GitLink 帐号邮件正文请注明要注销帐号的邮箱和昵称</span>
<span className='oneTipBox mt5'>发送邮件后我们会积极处理请耐心等候我们的邮件回复</span>
您可点击按钮完成账号的注销注销后相关数据将不可恢复注意事项如下<br/>
<span className='oneTipBox mt10'>请确认需注销的帐号未加入任何组织的owner团队若owner团队仅此一人则该组织将被删除</span>
<span className='oneTipBox mt5'>注销账号后该账号名下所有仓库将被删除请进行备份以防数据的丢失</span>
<span className='oneTipBox mt5'>注销账号后该账号在Gitlink产生的所有过程数据如疑修合并请求论坛帖子等也将被删除</span>
<span className='oneTipBox mt5'>注销后你将丢失该帐号产生的所有数据一旦注销相关数据将不可恢复请输入登录密码再次确认</span>
{ current_user && <Button className='mt30' loading={offLoading} onClick={checkAccount} style={{color:"red",borderColor:"red"}}>{!offAgain ? "注销账号" : "重新检测"}</Button> }
</div>
</div>
:<Phone {...props}/>
@ -364,6 +389,7 @@ export default Form.create()(
<p>{type === '0' ? '更改邮箱后您在GitLink的登录账号、接收通知的邮件地址将同步变更。请再次确认。' : '更改密码后您在GitLink的登录密码将同步变更。请再次确认。'}</p>
</div>
</Modals>
<OffAccount visible={offVisible} onCancel={()=>{setOffVisible(false)}} {...props}/>
</Fragment>
)})
)

View File

@ -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(
<Modal
title="注销账号"
width={500}
width={560}
visible={visible}
footer={
<div>
<Button size={'large'} onClick={onCancel}>取消</Button>
<Button size={"large"} type={"primary"} onClick={onOk}>确认</Button>
</div>
}
footer={null}
onCancel={onCancel}
destroyOnClose={true}
>
<div>
<p className='AlignCenter'><i className='iconfont icon-shanchu_tc_icon1 font-25 color-red'/>是否仍要注销</p>
<p className='mt20'>注销后你将丢失该帐号产生的所有数据一旦注销相关数据将不可恢复请输入登录密码再次确认</p>
<Form layout={'inline'} className='mt25'>
<Form.Item label="">
<p className='AlignCenter font-bd font-17'><i className='iconfont icon-shanchu_important font-25 color-red mr5'/>是否仍要注销</p>
<p className='mt15'>注销后你将丢失该帐号产生的所有数据一旦注销相关数据将不可恢复请输入登录密码再次确认</p>
<Form className='mt25'>
<Form.Item label="密码校验">
{getFieldDecorator("password",{
rules:[
{required:true,message:"请输入登录密码"},
@ -32,7 +52,19 @@ export default Form.create()(forwardRef((props)=>{
<Input.Password placeholder="请输入登录密码"/>
)}
</Form.Item>
<Form.Item label="注销原因">
{getFieldDecorator("memo",{
rules:[{required:true,message:"请输入注销原因"}],
})(
<TextArea rows={3} maxLength={500} placeholder="我们非常遗憾看到您想要注销账号。在您做出最终决定之前,请告诉我们您注销的原因,这将帮助我们改进社区服务。您的反馈对我们至关重要。"
/>
)}
</Form.Item>
</Form>
<div style={{textAlign:"center"}}>
<Button onClick={onDelete} style={{minWidth:"95px"}} loading={loading}>仍要注销</Button>
<Button type={"primary"} style={{width:"95px"}} className='ml25' onClick={onCancel}>再想想</Button>
</div>
</div>
</Modal>
)})

View File

@ -137,7 +137,7 @@ function Contribution(props){
<div className='tableColumn4'>转账token数额</div>
<div className='tableColumn5'>操作</div>
</div>}
{list && !list.length && <Nodata _html="暂无数据"/>}
{((list && !list.length) || !list) && <Nodata _html="暂无数据"/>}
{list && list.map(item=>{return item.id ? <div key={item.id} className='flexCenterCont transferAccount'>
<div className='tableColumn1'>{item.name}</div>
<div className='tableColumn2'>{item.balance}</div>

View File

@ -25,7 +25,7 @@
}
.ant-message {
z-index: 20000;
z-index: 20000!important;
}
.ant-upload-list-item-info .anticon-loading,

View File

@ -6,6 +6,7 @@ import './index.scss';
import axios from "axios";
import RenderHtml from "../../components/render-html";
import { Link } from "react-router-dom";
import LogoBot from '../image/logoBot.png';
function SoftBotDEtail(props){
const {match:{params:{id}}, current_user, history, showLoginDialog} = props;
@ -171,7 +172,7 @@ function SoftBotDEtail(props){
return <div className="softBotDetailBox">
{detail && <div className="botDetailHead">
<div className="botDetailHeadCont">
<div className="botImgBg"><img src={getImageUrl(detail.logo)} alt="" className="botImg"></img></div>
<div className="botImgBg"><img src={(detail.logo && !(detail.logo.indexOf("347246")>-1 || detail.logo.indexOf("412603")>-1)) ? getImageUrl(detail.logo) : LogoBot} alt="" className="botImg"></img></div>
<div className="centerBox">
<p className="font-24">{detail.bot_name}</p>
<div className="userBox font-16">{detail.first_func && <span className="typeBox font-15 mr15">{detail.first_func}</span>}{detail.second_func && <span className="typeBox font-15 mr15">{detail.second_func}</span>}<a href={`/${detail.developer_login}`}>{detail.developer_name}</a></div>
@ -187,7 +188,7 @@ function SoftBotDEtail(props){
</div>
</div>
<Modal
title={<div><div className="installBotImgBox"><img src={getImageUrl(detail && detail.logo)} alt="" className="installBotImg"/></div><div className="font-18 installBotName">{detail && detail.bot_name}</div></div>}
title={<div><div className="installBotImgBox"><img src={(detail && detail.logo && !(detail.logo.indexOf("347246")>-1 || detail.logo.indexOf("412603")>-1)) ? getImageUrl(detail.logo) : LogoBot} alt="" className="installBotImg"/></div><div className="font-18 installBotName">{detail && detail.bot_name}</div></div>}
visible={visible}
onOk={okClick}
onCancel={()=>{setSelectValue([]);setVisible(false)}}

View File

@ -4,7 +4,8 @@ import { getImageUrl } from 'educoder'
import './index.scss';
import { Link } from "react-router-dom";
import {getAllBotCategory, getContentsLikeNameAndFunc} from '../api.js';
import Nodata from '../../forge/Nodata'
import Nodata from '../../forge/Nodata';
import LogoBot from '../image/logoBot.png';
function SoftBot(props){
const {mygetHelmetapi, current_user, history, showLoginDialog} = props;
@ -85,7 +86,7 @@ function SoftBot(props){
{!loading && botList && botList.length > 0 && botList.map((item, index)=>{
return <div className="oneBotItem mt30" key={index} onClick={()=>{window.location.href=`/softbot/${item.bot_id}`}}>
<div className="oneItemHead">
<div className="oneBotImgBox"><img src={getImageUrl(item.logo)} alt="" className="oneBotImg"/></div>
<div className="oneBotImgBox"><img src={(item.logo && !(item.logo.indexOf("347246")>-1 || item.logo.indexOf("412603")>-1)) ? getImageUrl(item.logo) : LogoBot} alt="" className="oneBotImg"/></div>
<div className="oneBotLine">
<p className="font-16 oneBotName oneBotLine">{item.market_name}</p>
<p>{item.developer_name}</p>