diff --git a/src/AppConfig.js b/src/AppConfig.js
index a5a063b09..174bac5ae 100644
--- a/src/AppConfig.js
+++ b/src/AppConfig.js
@@ -56,7 +56,7 @@ window._debugType = debugType;
export function initAxiosInterceptors(props) {
initOnlineOfflineListener();
var proxy = "http://localhost:3000";
- proxy = "https://testforgeplus.trustie.net";
+ proxy = "https://testforgeplus.educoder.net";
const requestMap = {};
window.setfalseInRequestMap = function (keyName) {
diff --git a/src/forge/Component/EAccount.scss b/src/forge/Component/EAccount.scss
new file mode 100644
index 000000000..6f0bb97f9
--- /dev/null
+++ b/src/forge/Component/EAccount.scss
@@ -0,0 +1,9 @@
+.ant-modal-mask{
+ z-index: 10000;
+}
+.ant-modal-wrap{
+ z-index: 10001;
+ .ant-form-explain{
+ position: absolute;
+ }
+}
\ No newline at end of file
diff --git a/src/forge/Component/EducoderAccount.jsx b/src/forge/Component/EducoderAccount.jsx
new file mode 100644
index 000000000..b9b2f7afc
--- /dev/null
+++ b/src/forge/Component/EducoderAccount.jsx
@@ -0,0 +1,65 @@
+import React , {forwardRef, useEffect} from 'react';
+import { Modal , Form , Input , Button } from 'antd';
+import './EAccount.scss';
+
+function EducoderAccount({form , visible , onOk , email}){
+ const { getFieldDecorator, validateFields , setFieldsValue } = form;
+
+ useEffect(()=>{
+ if(email){
+ setFieldsValue({email})
+ }
+ },[email])
+
+ function onSure(){
+ validateFields((error,values)=>{
+ if(!error){
+ onOk(values);
+ }
+ })
+ }
+ const layout = {
+ labelCol: { span: 5 },
+ wrapperCol: { span: 18 },
+ };
+ return(
+ 确定
+ }
+ centered
+ >
+
+
+ {
+ email ?
+ `平台已检测到您已绑定邮箱${email},请您确认如下操作`
+ :
+ "平台已检测到您未绑定邮箱,为不影响使用协同开发功能,请先绑定邮箱"
+ }
+
+
+ {getFieldDecorator("email",{
+ rules:[{required:true,message:"请输入邮箱账号"}]
+ })(
+
+ )}
+
+
+ {getFieldDecorator("password",{
+ rules:[{required:true,message:"请输入邮箱密码"}]
+ })(
+
+ )}
+
+
+
+
+ )
+}
+export default Form.create()(forwardRef(EducoderAccount));
\ No newline at end of file
diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js
index 0084c3334..309d4ec55 100644
--- a/src/modules/tpm/TPMIndexHOC.js
+++ b/src/modules/tpm/TPMIndexHOC.js
@@ -8,6 +8,7 @@ import './TPMIndex.css';
import LoginDialog from '../login/LoginDialog';
import AccountProfile from '../user/AccountProfile';
import AccountPhoneemail from '../user/AccountPhoneemail';
+import EducoderAccount from '../../forge/Component/EducoderAccount';
export function TPMIndexHOC(WrappedComponent) {
return class II extends React.Component {
@@ -28,6 +29,8 @@ export function TPMIndexHOC(WrappedComponent) {
dataquerys: {},
isloginCancel: undefined,
mygetHelmetapi: null,
+ giteaVisible:false,
+ email:undefined
}
}
@@ -165,6 +168,12 @@ export function TPMIndexHOC(WrappedComponent) {
if (this.props.match.path === "/" && response.data.login) {
this.props.history.push(`/users/${response.data.login}`);
}
+ if(!response.data.has_gitea_user){
+ this.setState({
+ giteaVisible:true,
+ email:response.data.email
+ })
+ }
}
}).catch((error) => {
console.log(error)
@@ -345,8 +354,27 @@ export function TPMIndexHOC(WrappedComponent) {
}
}
+ onOk =(values)=>{
+ let url = `/accounts/gitea_regsiter.json`;
+ const { email , current_user } = this.state;
+ if(email){
+ url = `/register.json`;
+ }
+ axios.post(url,{
+ login:current_user && current_user.login,
+ ...values
+ }).then(result=>{
+ if(result && result.data && result.data.status === 1){
+ this.setState({
+ giteaVisible:false,
+ email:undefined
+ })
+ window.location.reload();
+ }
+ }).catch(error=>{})
+ }
render() {
- let { Footerdown, isRender, AccountProfiletype, AccountPhoneemailtype, current_user } = this.state;
+ let { email , giteaVisible , Footerdown, isRender, AccountProfiletype, AccountPhoneemailtype, current_user } = this.state;
const common = {
showLoginDialog: this.showLoginDialog,
@@ -372,6 +400,7 @@ export function TPMIndexHOC(WrappedComponent) {
};
return (
+
{isRender === true ? this.hideLoginDialog()}
{...this.props}