From 4e666a8a6de4db13c737ee159ed43ab2eb4450f7 Mon Sep 17 00:00:00 2001 From: dingyongkang Date: Wed, 31 Aug 2022 10:02:23 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AppConfig.js | 4 +++ src/forge/Component/EducoderAccount.jsx | 3 +- src/forge/New/Index.js | 41 +++++++++---------------- 3 files changed, 20 insertions(+), 28 deletions(-) diff --git a/src/AppConfig.js b/src/AppConfig.js index fb7d4a25c..fbc327da1 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -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; diff --git a/src/forge/Component/EducoderAccount.jsx b/src/forge/Component/EducoderAccount.jsx index 76243f779..f5f4fb6d2 100644 --- a/src/forge/Component/EducoderAccount.jsx +++ b/src/forge/Component/EducoderAccount.jsx @@ -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={ diff --git a/src/forge/New/Index.js b/src/forge/New/Index.js index f2f9b36e6..03269751b 100644 --- a/src/forge/New/Index.js +++ b/src/forge/New/Index.js @@ -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 (
@@ -450,6 +434,9 @@ class Index extends Component { }
} + { + message.info('未填邮箱及密码,当前功能禁止使用') + }} current_user={this.props.current_user.has_gitea_user}/>