Compare commits

...

83 Commits

Author SHA1 Message Date
jasder 7407545d1f Merge pull request '冲突引起iconfont丢失' (#215) from caishi/forgeplus-react:standalone into standalone 2021-10-22 14:05:27 +08:00
caishi f0ffc9a29c iconfont + style 2021-10-22 13:56:34 +08:00
jasder 987eb39681 Merge pull request 'standalone merge problem' (#214) from caishi/forgeplus-react:standalone into standalone 2021-10-22 11:44:51 +08:00
caishi 848109afe8 settings 2021-10-22 11:40:41 +08:00
caishi d7bdb35bb7 merge bug 2021-10-22 11:28:22 +08:00
jasder b16e95923a Merge pull request 'FIX bug' (#211) from jasder/forgeplus-react:standalone into standalone 2021-10-22 10:11:03 +08:00
jasder 98a7f73c04 Merge branch 'master' into standalone 2021-10-22 10:09:53 +08:00
jasder b6a450a482 FIX 项目路由改造的bug 2021-10-22 10:04:39 +08:00
jasder 66c495d6b5 Merge pull request '合并代码后,变量重复引发错误' (#203) from caishi/forgeplus-react:standalone into standalone 2021-10-21 18:32:37 +08:00
caishi 42139ef998 settings多次声明 2021-10-21 18:30:28 +08:00
jasder 925d5ea356 Merge pull request '并入独立版本' (#202) from jasder/forgeplus-react:standalone into standalone 2021-10-21 18:28:15 +08:00
jasder ad1f0e29e7 FIX 合并主干分支代码并解决冲突 2021-10-21 18:24:06 +08:00
caishi cacb8c84ae 合并develop分支的个人中心改版-全部 2021-06-10 09:36:03 +08:00
caishi fb8ae3fcdf 小修 2021-06-09 18:08:49 +08:00
caishi a257d832cb issue 2021-06-09 18:08:01 +08:00
caishi ff7d191011 merge 2021-06-09 18:07:39 +08:00
caishi 9a2c3f1754 merge 2021-06-09 18:06:54 +08:00
caishi bcdf506e6c 数据统计三个时间筛选参数值必须是时间戳 2021-06-09 18:06:14 +08:00
caishi ccc6cb5d26 merge 2021-06-09 18:03:52 +08:00
caishi 0661c6b932 添加成员后要清除选中的成员 2021-06-09 18:03:24 +08:00
caishi 99947c0c87 merge 2021-06-09 17:56:51 +08:00
caishi 03cff6ec2e merge 2021-06-09 17:56:02 +08:00
caishi f86acfebdf merge冲突 2021-06-09 17:55:12 +08:00
caishi 9a62d7806e 同上-修改细节 2021-06-09 17:54:06 +08:00
caishi a7df6da5f0 merge 个人中心部分 冲突 2021-06-09 17:53:57 +08:00
caishi eab68ac270 概览页数据绑定完成,只差数据统计页 2021-06-09 17:52:43 +08:00
caishi a9e3513706 year 2021-06-09 17:52:31 +08:00
caishi 6b20391c72 merge 个人中心改版 2021-06-09 17:40:05 +08:00
caishi 3135300fe6 merge d029840874 2021-05-14 11:32:01 +08:00
caishi ecc6387113 no message 2021-05-08 17:22:44 +08:00
caishi 990c4e22b0 编辑合并请求-url地址错误 2021-05-08 14:35:51 +08:00
caishi 7eea9316dd detail+同步镜像type=2的才不需要合并请求 2021-05-07 17:41:01 +08:00
caishi 6a546c79e4 merge 2021-05-07 16:36:22 +08:00
caishi 4c48b6c77a merge 2021-05-07 16:35:17 +08:00
caishi 4d5430c3ed 统一项目简介、项目概览 2021-05-07 16:33:57 +08:00
caishi d49af735f1 merge 2021-05-06 17:21:19 +08:00
caishi 03370e8a07 merge 2021-05-06 17:19:09 +08:00
caishi 0b43fa8952 merge develop 2021-05-06 17:18:30 +08:00
caishi 465c4cc8c7 04-28休假期修改issue --需合并至其它分支(合并请求相关) 2021-04-28 20:23:57 +08:00
caishi 37668ddcd4 组织团队-无数据显示错误 2021-04-27 09:47:10 +08:00
caishi 7102594444 代码库编辑文件-切换到其它目录后要重新将编辑状态改为显示状态 2021-04-25 17:48:58 +08:00
caishi b2f2df65bb 样式覆盖 2021-04-23 18:07:15 +08:00
caishi 8a577fb263 资源库 2021-04-23 17:16:50 +08:00
caishi 5c491071b6 +上 关注后不需要提示 2021-04-23 16:37:16 +08:00
caishi c554237076 +上 贡献者悬浮框里增加的跳转链接不要新开页 2021-04-23 16:37:06 +08:00
caishi d22a741bf7 贡献者-悬浮内容增加跳转链接 2021-04-23 16:36:56 +08:00
caishi 383b3f5d74 imageUrl + / 2021-04-23 16:36:41 +08:00
caishi 63da7adcf9 个人中心关注-关注或者取消关注未更新状态 2021-04-23 16:36:31 +08:00
caishi 3243aeebc6 贡献者-悬浮卡片-测试版1 2021-04-23 16:36:22 +08:00
caishi 1a86a75345 发布评论者头像路径错误 2021-04-23 16:36:11 +08:00
caishi 3b6cc99d49 merge 2021-04-23 16:35:49 +08:00
caishi d872ffc606 merge 2021-04-23 16:31:15 +08:00
caishi 3b69c01ead merge 2021-04-23 16:30:45 +08:00
caishi 1e0608aa14 合并请求-提出申请者头像显示问题 2021-04-23 16:30:07 +08:00
caishi 9b6816e346 团队项目-团队项目管理-显示的name和跳转的login 2021-04-23 16:29:57 +08:00
caishi 6ee257231d 切换左侧目录,选择不同的文件时,文件详情没有更新 2021-04-23 16:29:46 +08:00
caishi 70edb73f6c all-默认头像(首字母加背景颜色) 2021-04-23 16:29:35 +08:00
caishi 5c7553d4aa merge 2021-04-23 16:29:16 +08:00
caishi 278701f24b 上线后的getImageURL也不用在前面加/ + 一些小样式修改 2021-04-23 16:27:56 +08:00
caishi 97ab819bf9 merge 2021-04-23 16:27:37 +08:00
caishi d870f17b85 readme-文件增加一个目录下拉icon 2021-04-23 16:26:02 +08:00
caishi 91ac6c2357 组织团队-新增一个团队标识 2021-04-23 16:25:47 +08:00
caishi 3702d1c1a5 merge 2021-04-23 16:25:35 +08:00
caishi 93d48c359e merge 2021-04-23 16:25:03 +08:00
caishi 80dace18e9 资源库不需要按引用次数排序 2021-04-23 16:24:23 +08:00
caishi 375cbb37df merge 2021-04-23 16:24:02 +08:00
caishi 10d933e037 merge develop 2021-04-23 16:23:29 +08:00
caishi 4fdd3f6f80 组织-团队列表的头像login为undefined 2021-04-23 16:22:36 +08:00
caishi 458b56e33b 去掉悬浮手册按钮 2021-04-23 16:22:22 +08:00
caishi c256887132 注册成功后跳转到首页 2021-03-31 15:13:32 +08:00
caishi 6a588db7f6 清理代码 2021-03-31 15:03:16 +08:00
caishi 6c4e1c6665 Merge branch 'standalone' into dev_local 2021-03-31 14:42:24 +08:00
caishi c554d2c00d 重置settings为undefined 2021-03-31 14:35:23 +08:00
caishi b69bf5974a remove 2021-03-31 14:28:22 +08:00
caishi ecb1691b4d Trustie 2021-03-31 14:17:48 +08:00
caishi 6a9f2b31a6 注册页面logo和底部信息 2021-03-31 14:04:09 +08:00
caishi 4947cd8456 浏览器ico要用trustie的logo 2021-03-31 12:07:11 +08:00
caishi 8429effe16 没logo时会将setting重置为空 2021-03-31 12:02:38 +08:00
caishi 49ebe450be 合并测试版分支 2021-03-31 11:21:07 +08:00
caishi e3c926da77 注册 2021-03-29 17:37:16 +08:00
caishi af48da2eb3 href 2021-03-29 17:14:56 +08:00
caishi 6630309466 Merge branch 'develop' into dev_local 2021-03-29 16:58:48 +08:00
caishi a7c3dee7e3 2020-11-26 10:55:03 +08:00
19 changed files with 1603 additions and 748 deletions

1179
.idea/workspace.xml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -6705,10 +6705,13 @@ p{
right: 0px; right: 0px;
top:4px; top:4px;
color: #999; color: #999;
<<<<<<< HEAD
=======
} }
.ant-input, .ant-input .ant-input-suffix{ .ant-input, .ant-input .ant-input-suffix{
background-color: #fff!important; background-color: #fff!important;
} }
.has-error .ant-input{ .has-error .ant-input{
background-color: #FEF1F0!important; background-color: #FEF1F0!important;
>>>>>>> pre_develop
} }

View File

@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 2340181 */ font-family: "iconfont"; /* Project id 2340181 */
src: url('iconfont.woff2?t=1632964996877') format('woff2'), src: url('iconfont.woff2?t=1634881729644') format('woff2'),
url('iconfont.woff?t=1632964996877') format('woff'), url('iconfont.woff?t=1634881729644') format('woff'),
url('iconfont.ttf?t=1632964996877') format('truetype'); url('iconfont.ttf?t=1634881729644') format('truetype');
} }
.iconfont { .iconfont {

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
public/favicon-.ico Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -10,7 +10,7 @@ import {
import axios from 'axios'; import axios from 'axios';
import LoginDialog from './modules/login/LoginDialog'; import LoginDialog from './modules/login/LoginDialog';
import 'babel-polyfill'; import 'babel-polyfill';
import Loading from './Loading' import Loading from './Loading';
import Loadable from 'react-loadable'; import Loadable from 'react-loadable';
import marked from './common/marked'; import marked from './common/marked';

View File

@ -73,7 +73,6 @@ export default ((props)=>{
<Menu.Item key={'1'}><a href={tar_url}>TAR.GZ</a></Menu.Item> <Menu.Item key={'1'}><a href={tar_url}>TAR.GZ</a></Menu.Item>
</Menu> </Menu>
) )
return( return(
<React.Fragment> <React.Fragment>
<div className="main"> <div className="main">

View File

@ -575,8 +575,8 @@ class Detail extends Component {
</span> </span>
} }
</div> </div>
</AlignCenter> </AlignTop>
<div className="mt6" style={{minHeight:"20px"}}> {/* <div className="mt6" style={{minHeight:"20px"}}>
{ {
projectDetail && projectDetail.forked_from_project_id && projectDetail.fork_info ? projectDetail && projectDetail.forked_from_project_id && projectDetail.fork_info ?
this.textFunc(projectDetail.forked_from_project_id,projectDetail.fork_info) this.textFunc(projectDetail.forked_from_project_id,projectDetail.fork_info)
@ -587,7 +587,7 @@ class Detail extends Component {
<span className="color-grey-9">镜像自 <a className="color-blue hoverLine" target="_blank" href={projectDetail.mirror_url}>{projectDetail.mirror_url}</a></span> <span className="color-grey-9">镜像自 <a className="color-blue hoverLine" target="_blank" href={projectDetail.mirror_url}>{projectDetail.mirror_url}</a></span>
:"" :""
} }
</div> </div> */}
{ {
firstSync ? "" : firstSync ? "" :
<DetailBanner <DetailBanner

View File

@ -157,6 +157,17 @@ export default Form.create()(
setAuth(params.target.value) setAuth(params.target.value)
} }
function checkname(rule, value, callback){
if(!value){
callback();
}
if(value && !value.match(/^[a-zA-Z][a-zA-Z\d]{3,14}$/)){
callback("只能使用英文字母和数字以字母开头长度为4到15个字符");
}
callback();
}
function checkname(rule, value, callback){ function checkname(rule, value, callback){
if(!value){ if(!value){
callback(); callback();

View File

@ -0,0 +1,122 @@
import React, { Component } from "react";
import { Link } from 'react-router-dom';
import { Spin } from 'antd';
import NoneData from '../Nodata';
import './version.css';
import axios from 'axios';
import RenderHtml from '../../components/render-html';
/**
* issue_chosen:下拉的筛选列表,
* data:列表接口返回的所有数据,
* issues:列表数组,
* isSpin:加载中,
*/
class version extends Component {
constructor(props) {
super(props);
this.state = {
issue_chosen: undefined,
data: undefined,
releases:undefined,
issues: undefined,
isSpin: true,
search: undefined,
search_count: undefined,
}
}
componentDidMount = () => {
this.getIssueList();
}
// 获取列表数据
getIssueList = () => {
const { projectsId, owner } = this.props.match.params;
const url = `/${owner}/${projectsId}/releases.json`;
axios.get(url).then((result) => {
if (result) {
this.setState({
data: result.data,
releases:result.data.releases,
issues: result.data.issues,
isSpin: false
})
}
}).catch((error) => {
console.log(error);
})
}
// 显示版本描述
showBody=(key,flag)=>{
let { releases } = this.state;
releases[key].bodyshow = !flag;
this.setState({
releases
})
}
renderList = (releases) => {
const { projectsId , owner } = this.props.match.params;
if (releases && releases.length > 0) {
return (
releases.map((item, key) => {
return (
<div className="versionInfo" key={key}>
<span className="versionInfo_left">
<span className={`${item.draft === "稳定" ?"versionTag green":"versionTag yellow"}`}>{item.draft}</span>
<span className="mt10">{item.created_at}</span>
<span className="color-grey-8">
<i className="iconfont icon-biaoqian3 mr3 font-14"></i>
{item.tag_name}
</span>
</span>
<div className="versionInfo_right">
<span className="versionName">
<span className="task-hide">{item.name}</span>
<Link to={`/projects/${owner}/${projectsId}/releases/${item.version_id}/update`} className="color-blue ml3 font-12">编辑</Link>
</span>
<span className="color-grey-3">
<i className={`${item.bodyshow ? "iconfont icon-sanjiaoxing-down color-grey-8 mr3 font-14":"iconfont icon-triangle color-grey-8 mr3 font-14"}`} onClick={()=>this.showBody(key,item.bodyshow)}></i>
{item.user_name}:<span className="color-grey-8">发布了这个版本并在发布后提交给{item.target_commitish}</span>
</span>
{
item.bodyshow && <RenderHtml className="break_word_comments imageLayerParent" value={item.body} url={this.props.history.location}/>
}
<RenderHtml />
<p className="mt10 pl3">
<a href={item.tarball_url} style={{color:"#4CC1DA"}} className="mr30"><i className="iconfont icon-TAR font-18 mr5"></i>TAR</a>
<a href={item.zipball_url} style={{color:"#28BD6C"}}><i className="iconfont icon-ZIP font-18 mr5"></i>ZIP</a>
</p>
</div>
</div>
)
})
)
} else if (releases && releases.length === 0) {
return ( <NoneData _html="暂时还没有相关数据!" /> )
}
}
render() {
const { projectsId ,owner } = this.props.match.params;
const { data , releases , isSpin } = this.state
return (
<div className="main" style={{padding:"0px"}}>
<div className="topWrapper" style={{padding:"15px 20px"}}>
<span className="font-18 color-grey-3">版本发布</span>
{
data && data.user_permission ?
<Link to={`/projects/${owner}/${projectsId}/releases/new`} className="topWrapper_btn_new">+ 发布新版</Link>
: ''
}
</div>
<div className="releasesVersion">
<Spin spinning={isSpin}><div>{this.renderList(releases)}</div></Spin>
</div>
</div>
)
}
}
export default version;

View File

@ -123,6 +123,8 @@ class Infos extends Component {
}); });
const { current_user } = this.props; const { current_user } = this.props;
const { username } = this.props.match.params; const { username } = this.props.match.params;
const { pathname } = this.props.location;
const { notice } = this.state;
let url = `/users/${username || (current_user && current_user.login)}.json`; let url = `/users/${username || (current_user && current_user.login)}.json`;
axios.get(url).then((result) => { axios.get(url).then((result) => {

View File

@ -48,7 +48,6 @@ function Team(props){
</Menu> </Menu>
) )
return( return(
<div> <div>
<div className="headerbox"> <div className="headerbox">

BIN
src/images/login/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -5,7 +5,7 @@ import '../courses/css/members.css';
import "../courses/common/formCommon.css"; import "../courses/common/formCommon.css";
import '../courses/css/Courses.css'; import '../courses/css/Courses.css';
import beijintulogontwo from '../../../src/images/login/beijintulogontwo.png'; import beijintulogontwo from '../../../src/images/login/beijintulogontwo.png';
import educodernet from '../../../src/images/login/educodernet.png'; import educodernet from '../../../src/images/login/logo.png';
import LoginRegisterComponent from '../user/LoginRegisterComponent'; import LoginRegisterComponent from '../user/LoginRegisterComponent';
import FindPasswordComponent from '../user/FindPasswordComponent'; import FindPasswordComponent from '../user/FindPasswordComponent';
//educoder登入页面 //educoder登入页面
@ -47,7 +47,6 @@ class EducoderLogin extends Component {
} }
}else if(props.match.url === "/register"){ }else if(props.match.url === "/register"){
// showbool: 1,
this.state = { this.state = {
showbool: 1, showbool: 1,
loginstatus:false, loginstatus:false,
@ -64,18 +63,14 @@ class EducoderLogin extends Component {
loginstatus:true, loginstatus:true,
} }
} }
} }
} }
Setlogins=(i)=>{ Setlogins=(i)=>{
console.log("96ye");
console.log(i)
this.setState({ this.setState({
logini:i logini:i
}) })
} }
gohome=()=>{ gohome=()=>{
window.location.href="/" window.location.href="/"
@ -94,29 +89,18 @@ class EducoderLogin extends Component {
render() { render() {
let {showbool,loginstatus,logini} = this.state; let { showbool } = this.state;
const { mygetHelmetapi } = this.props;
return ( return (
<div style={newContainer} className=" clearfix" > <div style={newContainer} className=" clearfix" >
<div style={{"justify-content": "center","align-items": "center","width": "100%",textAlign:"center"}}>
<div >
<div style={{
"display": "flex",
"justify-content": "center",
"align-items": "center",
"width": "100%"
}}>
<div style={{cursor:"pointer"}}> <div style={{cursor:"pointer"}}>
{this.props.mygetHelmetapi === null ? "" {
mygetHelmetapi && mygetHelmetapi.login_logo_url ?
<img style={{cursor:"pointer"}} alt="" onClick={()=>this.gohome()} width="80px" src={getImageUrl(mygetHelmetapi.login_logo_url)}/>
: :
this.props.mygetHelmetapi===undefined||this.props.mygetHelmetapi.login_logo_url===null|| this.props.mygetHelmetapi.login_logo_url===undefined? <img style={{cursor:"pointer"}} alt="" onClick={()=>this.gohome()} src={educodernet} width="80px"/>
<img style={{cursor:"pointer"}} onClick={()=>this.gohome()} src={educodernet}/>
:
<img style={{cursor:"pointer"}} onClick={()=>this.gohome()} src={getImageUrl(this.props.mygetHelmetapi.login_logo_url)}/>
} }
</div>
</div> </div>
{ {
showbool === 1 ? showbool === 1 ?
@ -127,51 +111,17 @@ class EducoderLogin extends Component {
marginTop: "25px", marginTop: "25px",
}}> }}>
<div> <div>
<LoginRegisterComponent {...this.props} {...this.state} Setshowbool={(e)=>this.Setshowbool(e)} ></LoginRegisterComponent>
<LoginRegisterComponent {...this.props} {...this.state}
Setshowbool={(e)=>this.Setshowbool(e)} ></LoginRegisterComponent>
</div> </div>
</div> </div>
: :
<div style={{ <div style={{display: "flex",justifyContent: "center",width: "100%",marginTop: "25px",}}>
display: "flex",
justifyContent: "center",
width: "100%",
marginTop: "25px",
}}>
<div> <div>
<FindPasswordComponent {...this.props} {...this.state} <FindPasswordComponent {...this.props} {...this.state} Setshowbool={(e)=>this.Setshowbool(e)}></FindPasswordComponent>
Setshowbool={(e)=>this.Setshowbool(e)}></FindPasswordComponent>
</div> </div>
</div> </div>
} }
{this.props.mygetHelmetapi === null ? <div style={{ <div className="font-14 color-grey-9 " style={{marginTop:"20px"}}><span className="font-18">©</span>&nbsp;{moment().year()}&nbsp;Trustie<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div>
display: "flex",
justifyContent: "center",
width: "100%",
}}>
<div className="font-14 color-grey-9 " style={{marginTop:"20px"}}><span className="font-18">©</span>&nbsp;{moment().year()}&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div>
</div>:
this.props.mygetHelmetapi===undefined||this.props.mygetHelmetapi.main_site===null|| this.props.mygetHelmetapi.main_site===undefined? <div style={{
display: "flex",
justifyContent: "center",
width: "100%",
}}>
<div className="font-14 color-grey-9 " style={{marginTop:"20px"}}><span className="font-18">©</span>&nbsp;{moment().year()}&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div>
</div>:this.props.mygetHelmetapi.main_site===true?
<div style={{
display: "flex",
justifyContent: "center",
width: "100%",
}}>
<div className="font-14 color-grey-9 " style={{marginTop:"20px"}}><span className="font-18">©</span>&nbsp;{moment().year()}&nbsp;EduCoder<span className="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside.</div>
</div>
:""
}
</div> </div>
</div> </div>
) )

View File

@ -169,6 +169,14 @@ export function TPMIndexHOC(WrappedComponent) {
}) })
} }
} }
if(response.data && response.data.login){
if(response.data.need_edit_info){
this.setState({
giteaVisible:true,
email:response.data.email
})
}
}
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)

View File

@ -24,13 +24,7 @@ class LoginRegisterComponent extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
//
// console.log("LoginRegisterComponent");
// console.log("29");
// console.log(props.loginstatus);
if (props.loginstatus === true) { if (props.loginstatus === true) {
// console.log(props.loginstatus);
this.state = { this.state = {
tab: ["0"], tab: ["0"],
classpass: "text", classpass: "text",
@ -147,24 +141,14 @@ class LoginRegisterComponent extends Component {
this.setState({ this.setState({
isphone: flag isphone: flag
}) })
// console.log("componentDidUpdate");
// console.log(this.props);
let pcipns = this.IsPC(); let pcipns = this.IsPC();
if (this.props.match.url === "/login") { if (this.props.match.url === "/login") {
// this.state = {
// tab:["0"],
//
// }
this.setState({ this.setState({
tab: ["0"] tab: ["0"]
}) })
} else if (this.props.match.url === "/register") { } else if (this.props.match.url === "/register") {
// this.state = {
// tab:["1"],
//
// }
this.setState({ this.setState({
tab: ["1"] tab: ["1"]
}) })
@ -198,8 +182,6 @@ class LoginRegisterComponent extends Component {
StudyMakeMoney = () => { // 调用父组件方法 StudyMakeMoney = () => { // 调用父组件方法
// this.props.Setlogins(3);
this.setState({ this.setState({
login: "", login: "",
password: "", password: "",
@ -400,11 +382,6 @@ class LoginRegisterComponent extends Component {
} }
// if(response.data.profile_completed !== null || response.data.profile_completed === false){
// this.setMyEduCoderModals();
// return;
// }
if (response.status === 200) { if (response.status === 200) {
if (response.data.status === 402) { if (response.data.status === 402) {
window.location.href = response.data.url; window.location.href = response.data.url;
@ -435,23 +412,6 @@ class LoginRegisterComponent extends Component {
} }
//注册接口 //注册接口
postregistered = () => { postregistered = () => {
// if (this.state.logins === undefined || this.state.logins === "") {
// this.openNotification(`请输入登录手机号码或邮箱`,2);
//
// return
// } else if (this.state.dragOk === false) {
// this.openNotification(`请拖动滑块验证`,2);
// return
// } else if (this.state.codes === undefined || this.state.codes == "") {
// this.openNotification(`请输入验证码`,2);
// return
// } else if (this.state.passwords === undefined || this.state.passwords == "") {
// this.openNotification(`请输入密码`,2);
// return
// } else if (this.state.Agreetotheterms === false) {
// this.openNotification(`请同意服务协议条款`,2);
// return;
// }
if (this.state.logins === undefined || this.state.logins === "" || this.state.logins.length === 0) { if (this.state.logins === undefined || this.state.logins === "" || this.state.logins.length === 0) {
this.setState({ this.setState({
Phonenumberisnotcos: "账号不能为空", Phonenumberisnotcos: "账号不能为空",
@ -461,25 +421,8 @@ class LoginRegisterComponent extends Component {
}) })
return return
} }
if(this.state.pciphone===true){
if (this.state.dragOk === false) {
// this.openNotification(`请拖动滑块完成验证`,2);
this.setState({
Phonenumberisnotcosytdhk:"请拖动滑块完成验证",
dragOk:false,
Whethertoverify:this.state.Whethertoverify===true?false:true,
})
return
}
}
if (this.state.codes === undefined || this.state.codes == ""||this.state.codes.length===0) { if (this.state.passwords === undefined || this.state.passwords == "" || this.state.passwords.length === 0) {
// this.openNotification(`请输入验证码`,2);
this.setState({
Phonenumberisnotcosyzm:"验证码不能为空",
})
return
} else if (this.state.passwords === undefined || this.state.passwords == "" ||this.state.passwords.length===0) {
this.setState({ this.setState({
Phonenumberisnotcosymmm: "密码不能为空", Phonenumberisnotcosymmm: "密码不能为空",
}) })
@ -494,9 +437,6 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcosymmm: "密码不能超过16位", Phonenumberisnotcosymmm: "密码不能超过16位",
}) })
return return
} else if (this.state.Agreetotheterms === false) {
this.openNotification(`请同意服务协议条款`,2);
return;
} }
let url; let url;
@ -511,34 +451,9 @@ class LoginRegisterComponent extends Component {
password: this.state.passwords, password: this.state.passwords,
code: this.state.codes, code: this.state.codes,
}).then((result) => { }).then((result) => {
if(result){ if (result && result.data) {
if(result.data.status===-2){ this.openNotification("注册成功!");
if(result.data.message==="验证码不正确"){ this.props.history.push('/');
this.setState({
Phonenumberisnotcosyzm:"验证码不正确",
})
return;
}else if(result.data.message==="验证码已失效"){
this.setState({
Phonenumberisnotcosyzm:"验证码不正确",
})
return;
}else {
this.openNotification(result.data.message);
return;
}
}else {
// this.setState({
// logins: "",
// dragOk: false,
// codes: "",
// passwords: "",
// Agreetotheterms: "",
// })
this.setMyEduCoderModals();
}
} }
}).catch((error) => { }).catch((error) => {
@ -758,12 +673,9 @@ class LoginRegisterComponent extends Component {
}) })
return; return;
} }
// var telephone = $("#telephoneAdd.tianjia_phone").val();
var regph = /^[1][3,4,5,6,7,8,9][0-9]{9}$/; var regph = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
// var email = $("#add_email.tianjia_email").val();
var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
// [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
var stringdata = undefined; var stringdata = undefined;
if (!regph.test(e.target.value)) { if (!regph.test(e.target.value)) {
stringdata = "手机号格式不正确"; stringdata = "手机号格式不正确";
@ -809,7 +721,6 @@ class LoginRegisterComponent extends Component {
} }
//获取登入密码 //获取登入密码
passwordonChange = (e) => { passwordonChange = (e) => {
// console.log(e.target.value);
var stirngt; var stirngt;
if (e.target.value.length > 0) { if (e.target.value.length > 0) {
var str = e.target.value.replace(/\s*/g, "") var str = e.target.value.replace(/\s*/g, "")
@ -822,9 +733,6 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcodmm: undefined, Phonenumberisnotcodmm: undefined,
Phonenumberisnotcodmms: undefined, Phonenumberisnotcodmms: undefined,
}) })
// this.setState({
// password: e.target.value
// })
} }
//获取注册登入 //获取注册登入
loginInputonChanges = (e) => { loginInputonChanges = (e) => {
@ -881,7 +789,6 @@ class LoginRegisterComponent extends Component {
this.setState({ this.setState({
tab: e.key tab: e.key
}) })
if (e.key === 0) { if (e.key === 0) {
this.setState({ this.setState({
Phonenumberisnotcos: undefined Phonenumberisnotcos: undefined
@ -890,26 +797,8 @@ class LoginRegisterComponent extends Component {
this.setState({ this.setState({
Phonenumberisnotco: undefined Phonenumberisnotco: undefined
}) })
} }
// this.props.history.push(`/classrooms/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/student_exercise_list?tab=`+e.key)
} }
loginonkeyup =(e)=>{
if(e.keyCode==32){
return false;
}
};
setNotcompleteds=()=>{
this.setState({
Notcompleteds:true,
MyEduCoderModals:false,
registered:undefined,
})
};
setMyEduCoderModals = () => { setMyEduCoderModals = () => {
this.setState({ this.setState({
MyEduCoderModals: true, MyEduCoderModals: true,
@ -917,70 +806,10 @@ class LoginRegisterComponent extends Component {
}) })
}; };
openweixinlogin=()=>{
this.setState({
weixinlogin:true
})
}
hideweixinlogin=()=>{
this.setState({
weixinlogin:false,
qqlogin:false,
tab:["0"]
})
}
openqqlogin=()=>{
this.setState({
qqlogin:true
})
//window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2f${window.location.host}%2otherloginqq&response_type=code`
window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginqq&state=null,${window.location.host}&response_type=code`
// window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&tp=qq&response_type=code`
}
openphoneqqlogin=()=>{
window.open(
`https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginqq&state=null,${window.location.host}&response_type=code`
)
}
render() { render() {
const { const {passopens,Agreetotheterms,Phonenumberisnotcos,tab,classpassbool,Phonenumberisnotcosymmm} = this.state
// 登录
autoLogin,
classpass,
passopens,
seconds,
getverificationcodes,
Agreetotheterms,
Phonenumberisnotco,
Phonenumberisnotcos,
codes,
tab,
dragOk,
Whethertoverify,
classpassbool,
Phonenumberisnotcosytdhk,
Phonenumberisnotcosyzm,
Phonenumberisnotcosymmm,
Phonenumberisnotcodmm,
// 注册
readAgreement,
pciphone,
Phonenumberisnotcodmms,
weixinlogin
} = this.state
// height: 346px;
if (this.state.seconds === 0) {
// window.location.href='http://www.cnblogs.com/a-cat/';
}
return ( return (
<div className={"login_register_content login_register_contents"}>
<div className={this.props.weixinlogin?"weixinregister":"login_register_content login_register_contents"}
// style={ parseInt(tab[0])==0?{height: "366px"} :{height: "510px"}}
>
<style> <style>
{ {
` `
@ -993,134 +822,16 @@ class LoginRegisterComponent extends Component {
</style> </style>
<div> <div>
{weixinlogin===false&&this.props.weixinlogin===undefined?<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab} className="mt20"> <Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab} className="mt20">
<Menu.Item key="0" className={tab===0?"active font-18":"font-18"} > 登录</Menu.Item> <Menu.Item key="1" className={"active font-18"} style={{ marginLeft: "10px" }} >注册</Menu.Item>
<Menu.Item key="1" className={tab===1?"active font-18 ":"font-18 "} style={{marginLeft:"10px"}} >注册</Menu.Item> </Menu>
</Menu>:""}
{
weixinlogin===false&&parseInt(tab[0])==0 &&
<div style={{ width: '340px' }}> <div style={{ width: '340px' }}>
<style> <Input placeholder="请输入邮箱账号进行注册"
{
`
.ant-input {
font-family: "Monospaced Number", "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
list-style: none;
position: relative;
display: inline-block;
padding: 4px 11px;
width: 100%;
height: 38px;
font-size: 14px;
line-height: 1.5;
color: rgba(0, 0, 0, 0.65);
background-color: #fff;
background-image: none;
border: 1px solid #d9d9d9;
border-radius: 4px;
-webkit-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
}
.loginInputzhuche{
width: 100%;
background-color: #fff!important;
height: 45px !important;
padding: 5px;
}
`
}
</style>
<Input placeholder="请输入登录手机号码或邮箱" value={this.state.login}
onChange={this.loginInputonChange}
name="username"
className={Phonenumberisnotco && Phonenumberisnotco !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
onBlur={(e) => this.inputOnBlur(e, 1)}
style={{marginTop: '30px', height: '38px'}}
onPressEnter={() => this.postLogin()}
></Input>
{
Phonenumberisnotco && Phonenumberisnotco != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotco}</span>
</p>
: <div style={{height:"25px"}}></div>
}
<Input type="password" name="password" id="password" value={this.state.password}
onChange={this.passwordonChange}
onPressEnter={() => this.postLogin()}
className={Phonenumberisnotcodmm && Phonenumberisnotcodmm !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
placeholder="密码"></Input>
{
Phonenumberisnotcodmm && Phonenumberisnotcodmm != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcodmm}</span>
</p>
: (Phonenumberisnotcodmms=== undefined?<div style={{height:"25px"}}></div>:"")
}
{
Phonenumberisnotcodmms && Phonenumberisnotcodmms != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcodmms}</span>
</p>
: ""
}
<div className="left_right font-12 " style={{color: '#676767'}}>
<Checkbox onChange={this.onAutoLoginChange} checked={autoLogin}>下次自动登录</Checkbox>
<a onClick={()=>this.StudyMakeMoney()}
className="mr3 color-grey-9 mt3 font-12">找回密码</a>
</div>
<Button className="login_btn font-16" type="primary" style={{height:"46px"}} onClick={() => this.postLogin()}
size={"large"}>登录</Button>
{this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?this.state.isphone===true?<p className="clearfix mb10 textcenter">
<span className={"startlogin"}> 快速登录 </span>
<div className={"mt10"}>
<a onClick={()=>this.openweixinlogin()}>
<img src={require('./img/WeChat.png')} alt="微信登录"/>
</a>
<a onClick={()=>this.openqqlogin()} className={"ml10"}>
<img src={require('./img/qq.png')} alt="qq登录"/>
</a>
</div>
</p>:<p className="clearfix mb10 textcenter">
<span className={"startlogin"}> 快速登录 </span>
<div className={"mt10"}>
{/*<a onClick={()=>this.openweixinlogin()}>*/}
{/*<img src={require('./WeChat.png')} alt="微信登录"/>*/}
{/*</a>*/}
<a onClick={()=>this.openphoneqqlogin()}>
<img src={require('./img/qq.png')} alt="qq登录"/>
</a>
</div>
</p>:""}
</div>
}
{
weixinlogin===false&&parseInt(tab[0])==1 &&
<div style={{width: '340px'}}>
<Input placeholder="请使用手机号/邮箱账号进行注册"
className={Phonenumberisnotcos && Phonenumberisnotcos !== "" ? " color-grey-9 loginInputzhucheyslass bor-reds" : " color-grey-9 loginInputzhuche"} className={Phonenumberisnotcos && Phonenumberisnotcos !== "" ? " color-grey-9 loginInputzhucheyslass bor-reds" : " color-grey-9 loginInputzhuche"}
value={this.state.logins} value={this.state.logins}
type="text" autoComplete="off" type="text" autoComplete="off"
onChange={this.loginInputonChanges} onChange={this.loginInputonChanges}
// onBlur={(e) => this.inputOnBlurzhuche(e, 2)}
style={{ marginTop: '30px', height: '38px', color: '#999999', fontSize: "14px" }}></Input> style={{ marginTop: '30px', height: '38px', color: '#999999', fontSize: "14px" }}></Input>
{ {
Phonenumberisnotcos && Phonenumberisnotcos !== "" ? Phonenumberisnotcos && Phonenumberisnotcos !== "" ?
@ -1130,88 +841,6 @@ class LoginRegisterComponent extends Component {
: <div style={{ height: "25px" }}></div> : <div style={{ height: "25px" }}></div>
} }
{this.state.MyEduCoderModals===true? <Notcompletedysl
modalsType={this.state.MyEduCoderModals}
registered={this.state.registered}
setNotcompleteds={()=>{this.setNotcompleteds()}}
/>:""}
{
Whethertoverify===false&&pciphone===true?
<CheckInputysl1
dragOkCallback={this.dragOkCallback}
>
</CheckInputysl1>
:
""
}
{
Whethertoverify===true&&pciphone===true?
<CheckInputysl2
dragOkCallback={this.dragOkCallback}
>
</CheckInputysl2>
:
""
}
<div>
{
pciphone===true?
(
Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk !== "" ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosytdhk}</span>
</p>
: <div style={{height:"25px"}}></div>
)
:""
}
</div>
<div className="yslbutondls">
<Input
className={Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ?" mr5 font-14 color-grey-9 loginInputzhucheyslass bor-reds":" mr5 font-14 color-grey-9 loginInputzhuche"}
name="codes" type="text" autoComplete="off" readonly
onfocus="this.removeAttribute('readonly')" style={{
width:'210px',
height:'38px',
}} placeholder="请输入验证码"
onChange={this.codesonChange}
value={codes}
>
</Input>
{
getverificationcodes === undefined ?
<Button className=" ml5 font-14" disabled style={{"width": "120px","text-align":"center", "height": "45px",}}
size={"large"}>重新发送{seconds}s</Button>
: getverificationcodes === true ?
<Button className=" ml5 font-14" type="primary" style={{"width": "120px","text-align":"center", "height": "45px",}}
onClick={() => this.getverificationcode()} size={"large"}>获取验证码</Button>
:
<Button className=" ml5 font-14 " type="primary" style={{"width": "120px","text-align":"center", "height": "45px",}}
onClick={() => this.getverificationcode()} size={"large"}>重新发送</Button>
}
</div>
<div>
{
Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcosyzm}</span>
</p>
: <div style={{height:"25px"}}></div>
}
</div>
<style> <style>
{ {
` `
@ -1249,57 +878,10 @@ class LoginRegisterComponent extends Component {
: <div style={{ height: "25px" }}></div> : <div style={{ height: "25px" }}></div>
} }
{this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?<Checkbox onChange={this.onChange} <Button className=" font-16 mb20" type="primary" style={this.props.settings && this.props.settings.main_site === true ? { height: "46px", width: "100%", marginTop: "26px" } : { height: "46px", width: "100%" }} onClick={() => this.postregistered()}
checked={Agreetotheterms}
><span className="font-14 " style={{
color: '#676767',
}}>我已阅读并同意
<span>
<a href={'https://forge.educoder.net/help?index=4'} target="_blank" className={"color-blue"}>服务协议条款</a>
</span></span></Checkbox>:""}
<Button className=" font-16 mb20" type="primary" style={this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?{height:"46px", width: "100%",marginTop:"26px"}:{height:"46px", width: "100%"}} onClick={() => this.postregistered()}
size={"large"}>{this.props.weixinlogin ? "注册并绑定" : "注册"}</Button> size={"large"}>{this.props.weixinlogin ? "注册并绑定" : "注册"}</Button>
{this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?this.state.isphone===true?<p className="clearfix mb10 textcenter">
<span className={"startlogin"}> 快速登录 </span>
<div className={"mt10"}>
<a onClick={()=>this.openweixinlogin()}>
<img src={require('./img/WeChat.png')} alt="微信登录"/>
</a>
<a onClick={()=>this.openqqlogin()} className={"ml10"}>
<img src={require('./img/qq.png')} alt="qq登录"/>
</a>
</div> </div>
</p>:<p className="clearfix mb10 textcenter">
<span className={"startlogin"}> 快速登录 </span>
<div className={"mt10"}>
{/*<a onClick={()=>this.openweixinlogin()}>*/}
{/*<img src={require('./WeChat.png')} alt="微信登录"/>*/}
{/*</a>*/}
<a onClick={()=>this.openphoneqqlogin()}>
<img src={require('./img/qq.png')} alt="qq登录"/>
</a>
</div> </div>
</p>:""
}
</div>
}
{weixinlogin===true?<iframe
className={"weixinheight390 mt20"}
frameBorder="0"
sandbox="allow-scripts allow-same-origin allow-top-navigation"
scrolling="no"
src={`https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&response_type=code&scope=snsapi_login&state=null,${window.location.host}#wechat_redirect`}></iframe>:""}
{weixinlogin===true?<p className="clearfix mb20 textcenter">
<a className={"startlogin color-blue"} onClick={()=>this.hideweixinlogin()}>返回登录注册</a>
</p>:""}
</div>
</div> </div>
); );
} }