邮箱管理+已删除分支的跳转处理

This commit is contained in:
caishi 2024-09-25 17:25:55 +08:00
parent 8f359c053e
commit 6e5ce131c3
5 changed files with 49 additions and 5 deletions

View File

@ -100,7 +100,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'))){
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

@ -62,7 +62,7 @@ function Index(props){
key:3,
width:"10%",
render:(value,item)=>{
return <Link to={`/${value.login}`}><img src={getImageUrl(`/${value.image_url}`)} alt="" style={{borderRadius:"50%"}} width="32px" height="32px" /></Link>
return <Link to={`/${value.login}`}><img src={`${value.image_url}`} alt="" style={{borderRadius:"50%"}} width="32px" height="32px" /></Link>
}
},
{

View File

@ -207,7 +207,7 @@ function CoderDepot(props){
axios.get(url, {
params: { ref:branch}
}).then((result) => {
if (result) {
if (result && result.data.status !== 404) {
setCommitCount(result.data.commits_count);
setDirInfo(result.data.entries);
setFileInfo(undefined);
@ -222,6 +222,9 @@ function CoderDepot(props){
setEditReadme(false);
setHide(true);
getReadmeInfo('', branchName || defaultBranch);
}else{
// entries404
props.history.push(`/${owner}/${projectsId}`)
}
setTimeout(function(){setIsSpin(false);},500);
}).catch(error=>{setIsSpin(false);})

View File

@ -10,7 +10,7 @@ import Phone from './Phone';
export default Form.create()(
forwardRef((props)=>{
const { getFieldDecorator, validateFields, resetFields, getFieldsValue } = props && props.form;
const { getFieldDecorator, validateFields, resetFields, getFieldsValue , setFieldsValue } = props && props.form;
const { current_user, type, resetUserInfo} = props;
const [ NewPass , setNewPass ] = useState(undefined);
@ -156,6 +156,8 @@ export default Form.create()(
setPassMap(map);
callback(res.data.message);
}
//
setFieldsValue({code:""})
})
}else{
setEmailValue(undefined);
@ -168,7 +170,7 @@ export default Form.create()(
//
function checkCode(rule, value, callback){
const map = passMap;
if(value){
if(value && emailValue){
current_user && value && value.length > 4 && Axios.post(`/v1/${current_user.login}/check_email_verify_code.json`,{
code_type: 10,
email: emailValue,

View File

@ -0,0 +1,39 @@
import React , { forwardRef } from 'react';
import { Modal , Form , Button , Input } from 'antd';
export default Form.create()(forwardRef((props)=>{
const { getFieldDecorator , validateFields, resetFields, getFieldsValue } = props && props.form;
const { onCancel, visible, onOk} = props;
return(
<Modal
title="注销账号"
width={500}
visible={visible}
footer={
<div>
<Button size={'large'} onClick={onCancel}>取消</Button>
<Button size={"large"} type={"primary"} onClick={onOk}>确认</Button>
</div>
}
>
<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="">
{getFieldDecorator("password",{
rules:[
{required:true,message:"请输入登录密码"},
// {validator:(rule, value, callback)=>checkNewPass(rule, value, callback, NewPassRepeat)}
],
validateFirst: true,
validateTrigger:"onBlur",
})(
<Input.Password placeholder="请输入登录密码"/>
)}
</Form.Item>
</Form>
</div>
</Modal>
)})
)