bug修复

This commit is contained in:
dingyongkang 2022-08-31 10:02:23 +08:00
parent e04d17fd50
commit 4e666a8a6d
3 changed files with 20 additions and 28 deletions

View File

@ -47,8 +47,12 @@ export function initAxiosInterceptors(props) {
config.url = `${proxy}${url}`;
if (config.url.indexOf('?') === -1) {
config.url = `${config.url}?debug=${debugType}`;
// config.url = `${config.url}`;
} else {
config.url = `${config.url}&debug=${debugType}`;
// config.url = `${config.url}`;
}
} else {
config.url = url;

View File

@ -3,7 +3,7 @@ import { Modal , Form , Input , Button } from 'antd';
import './EAccount.scss';
import axios from 'axios';
function EducoderAccount({form , visible , current_user , onCancel}){
function EducoderAccount({form , visible , current_user , onCancel,isCancel}){
const { getFieldDecorator, validateFields , setFieldsValue } = form;
useEffect(()=>{
@ -44,6 +44,7 @@ function EducoderAccount({form , visible , current_user , onCancel}){
visible={visible}
title="提示"
width="500px"
maskClosable={isCancel}
onCancel={onCancel}
footer={
<Button type="primary" onClick={onSure}>确定</Button>

View File

@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { Input , Form , Select , Checkbox , Button , Spin , AutoComplete, Modal } from 'antd';
import { Input , Form , Select , Checkbox , Button , Spin , AutoComplete, Modal,message } from 'antd';
import { Base64 } from 'js-base64';
import { AlignCenter } from '../Component/layout';
import EducoderAccount from '../../forge/Component/EducoderAccount';
@ -52,6 +52,8 @@ class Index extends Component {
languageFlag:false,
ignoreFlag:false,
licenseFlag:false,
giteaVisible:false
}
}
componentDidMount = () => {
@ -94,31 +96,12 @@ class Index extends Component {
}
}).catch(error=>{})
let url1 = `/users/get_user_info.json`;
axios.get(url1).then((response) => {
if (response && response.data) {
this.initCommonState(response.data)
this.setState({
tpmLoading: false,
completeProfile:response.data.profile_completed
})
if(response.data && response.data.login){
if(response.data.need_edit_info){
this.setState({
giteaVisible:true,
email:response.data.email
})
}
// 如果处于登录状态,且刚刚打开,那么跳到个人主页
if(this.props.match.path === "/" && this.props.history.length===2){
debugger
this.props.history.push(`/${response.data.login}`)
}
}
}
}).catch((error) => {
console.log(error)
})
if(!this.props.current_user.has_gitea_user || (this.props.current_user.has_gitea_user && !this.props.current_user.is_sync_pwd)){
this.setState({
giteaVisible:true
})
}
}
getCategory = () => {
@ -385,7 +368,8 @@ class Index extends Component {
ignoreFlag,
licenseFlag,
languageFlag,
categoreFlag
categoreFlag,
giteaVisible
} = this.state;
return (
<div className="main back-white" style={{padding:"0px",border:"none"}}>
@ -450,6 +434,9 @@ class Index extends Component {
}
</div>
}
<EducoderAccount visible={giteaVisible} isCancel={false} onCancel={()=>{
message.info('未填邮箱及密码,当前功能禁止使用')
}} current_user={this.props.current_user.has_gitea_user}/>
<AlignCenter>
<Form.Item
label="拥有者"