dev_aliyun2
harry 5 years ago
parent 9456783685
commit 34f15062f6

@ -1,10 +1,10 @@
import React, {Component} from "react";
import React, { Component } from "react";
import {
Input,
Button,
Divider,
Layout,
Spin
Input,
Button,
Divider,
Layout,
Spin
} from "antd";
import axios from 'axios';
import moment from 'moment';
@ -16,119 +16,118 @@ import beijintulogontwo from '../../../src/images/login/beijintulogontwo.png';
const { Header, Footer, Sider, Content } = Layout;
//educoder登入页面
var sectionStyle = {
"height": "100%",
"width": "100%",
"min-width": "1000px",
// makesure here is String确保这里是一个字符串以下是es6写法
"height": "100%",
"width": "100%",
"min-width": "1000px",
// makesure here is String确保这里是一个字符串以下是es6写法
};
var imgback = {
" background-size":"cover",
"background-repeat":"no-repeat",
backgroundImage: `url(${beijintulogontwo})`,
" background-size": "cover",
"background-repeat": "no-repeat",
backgroundImage: `url(${beijintulogontwo})`,
}
var imgmian ={
width: "100%",
background: `url(${beijintulogontwo})`,
position: "relative",
var imgmian = {
width: "100%",
background: `url(${beijintulogontwo})`,
position: "relative",
}
var newContainer={
// background: `url(${beijintulogontwo})`,
backgroundPosition: "center" ,
backgroundRepeat: "no-repeat",
backgroundAttachment: "fixed",
backgroundSize: "100% 100%",
height:" 100%",
width:" 100%",
position: "absolute",
top: "0px",
bottom: "0px",
minHeight: "100%",
paddingTop: "40px",
var newContainer = {
// background: `url(${beijintulogontwo})`,
backgroundPosition: "center",
backgroundRepeat: "no-repeat",
backgroundAttachment: "fixed",
backgroundSize: "100% 100%",
height: " 100%",
width: " 100%",
position: "absolute",
top: "0px",
bottom: "0px",
minHeight: "100%",
paddingTop: "40px",
}
class Loginqq extends Component {
constructor(props) {
super(props);
this.state={
login:undefined,
password:undefined,
data:undefined,
logintypes:undefined,
spinnings:true
}
constructor(props) {
super(props);
this.state = {
login: undefined,
password: undefined,
data: undefined,
logintypes: undefined,
spinnings: true
}
}
}
componentDidMount() {
componentDidMount() {
let url = `/users/get_user_info.json`
axios.get(url).then((result)=> {
console.log(result);
if(result){
this.setState({
data:result.data,
spinnings:false
})
}
}).catch((error)=>{
let url = `/users/get_user_info.json`
axios.get(url).then((result) => {
if (result) {
this.setState({
spinnings:false
data: result.data,
spinnings: false
})
}
}).catch((error) => {
this.setState({
spinnings: false
})
})
}
}
loginInputonChange=(e)=>{
if(e.target.value===undefined||e.target.value===""||e.target.value===null){
loginInputonChange = (e) => {
if (e.target.value === undefined || e.target.value === "" || e.target.value === null) {
}else{
if(this.state.logintypes==="username"){
this.setState({
logintypes:undefined
})
}
} else {
if (this.state.logintypes === "username") {
this.setState({
logintypes: undefined
})
}
this.setState({
login:e.target.value,
})
}
passwordonChange=(e)=>{
if(e.target.value===undefined||e.target.value===""||e.target.value===null){
}else{
if(this.state.logintypes==="password"){
this.setState({
logintypes:undefined
})
}
}
this.setState({
login: e.target.value,
})
}
passwordonChange = (e) => {
if (e.target.value === undefined || e.target.value === "" || e.target.value === null) {
this.setState({
password:e.target.value,
})
} else {
if (this.state.logintypes === "password") {
this.setState({
logintypes: undefined
})
}
}
postwechatlogin=(type,username,password)=>{
let query=this.props.location.search;
this.setState({
password: e.target.value,
})
}
postwechatlogin = (type, username, password) => {
let query = this.props.location.search;
const types = query.split('?type=');
if(type===false){
if(username===undefined||username===""||username===null){
this.setState({
logintypes:"username"
if (type === false) {
if (username === undefined || username === "" || username === null) {
this.setState({
logintypes: "username"
})
return
}
if(password===undefined||password===""||password===null){
if (password === undefined || password === "" || password === null) {
this.setState({
logintypes:"password"
logintypes: "password"
})
return
}
@ -137,63 +136,63 @@ class Loginqq extends Component {
let url = "/bind_user.json";
axios.post(url, {
type: types[1]==="qq"?"qq":'wechat',
not_bind:type,
username:username,
password:password
type: types[1] === "qq" ? "qq" : 'wechat',
not_bind: type,
username: username,
password: password
}).then((response) => {
if(response.data.status===0){
window.location.href="/"
if (response.data.status === 0) {
window.location.href = "/"
}
}).catch((error) => {
console.log(error)
});
}
render() {
let {data,logintypes,spinnings} = this.state;
let { data, logintypes, spinnings } = this.state;
console.log(logintypes)
return (
<div style={newContainer} className=" clearfix" >
<Spin size="large" spinning={spinnings} >
<style>
{
`
console.log(logintypes)
return (
<div style={newContainer} className=" clearfix" >
<Spin size="large" spinning={spinnings} >
<style>
{
`
#root{
background:#fff !important;
}
`
}
</style>
}
</style>
<div>
<div style={{
"width": "100%"
}}>
<div>
<style>
{
`
<div>
<div style={{
"width": "100%"
}}>
<div>
<style>
{
`
.ottherimg{
width: 106px;
height: 106px;
border-radius: 50%;
}
`
}
</style>
<div className={"textcenter"} >
{data===undefined?"":data.image_url===undefined||data.image_url===null||data.image_url===""?"":<img className={"ottherimg"} src={getImageUrl(`images/${data&&data.image_url}`)}/>}
}
</style>
<div className={"textcenter"} >
{data === undefined ? "" : data.image_url === undefined || data.image_url === null || data.image_url === "" ? "" : <img className={"ottherimg"} src={getImageUrl(`images/${data && data.image_url}`)} />}
</div>
<div className={"textcenter wechatloginfont"}>
为了更好的为您服务请关联一个EduCoder账号
</div>
<div className={"textcenter wechatloginfont"}>
为了更好的为您服务请关联一个EduCoder账号
</div>
</div>
</div>
<div className={"educontent clearfix wechatdivs"}>
<style>
{
`
<div className={"educontent clearfix wechatdivs"}>
<style>
{
`
.ant-layout,.ant-layout-sider,.ant-layout-content{
background: #FFF;
}
@ -219,73 +218,73 @@ class Loginqq extends Component {
border-radius:4px;
}
`
}
</style>
<p>
<Layout>
<Sider>
<div className={"wechatnewchat"}>
新用户
}
</style>
<p>
<Layout>
<Sider>
<div className={"wechatnewchat"}>
新用户
</div>
</Sider>
<Layout>
<Header>欢迎来到EduCoder新用户登录EduCoder可以到账号管理-安全设置中绑定手机/邮箱以后可以用绑定的手机/邮箱设置的密码登录EduCoder了</Header>
<Content className={"wechatContents"}>立即体验表示您已经同意我们的 <span><a href="https://forge.educoder.net/help?index=4" target="_blank" className={"color-blue"}> 服务协议条款</a></span></Content>
<Footer>
<Button className="login_btn font-16 wechattiyan" type="primary" style={{height:"46px"}} onClick={() => this.postwechatlogin(true)}
size={"large"}>立即体验</Button>
</Footer>
</Layout>
</Layout>
</p>
<Divider />
<p>
<Layout>
<Sider>
<div className={"wechatweoldchat"}>
老用户
</Sider>
<Layout>
<Header>欢迎来到EduCoder新用户登录EduCoder可以到账号管理-安全设置中绑定手机/邮箱以后可以用绑定的手机/邮箱设置的密码登录EduCoder了</Header>
<Content className={"wechatContents"}>立即体验表示您已经同意我们的 <span><a href="https://forge.educoder.net/help?index=4" target="_blank" className={"color-blue"}> 服务协议条款</a></span></Content>
<Footer>
<Button className="login_btn font-16 wechattiyan" type="primary" style={{ height: "46px" }} onClick={() => this.postwechatlogin(true)}
size={"large"}>立即体验</Button>
</Footer>
</Layout>
</Layout>
</p>
<Divider />
<p>
<Layout>
<Sider>
<div className={"wechatweoldchat"}>
老用户
</div>
</Sider>
<Layout>
<Header>已有EduCoder账号可以输入您的账号和密码将您的微信账号与EduCoder账号进行绑定</Header>
<Content className={"wechatContents"}>
</Sider>
<Layout>
<Header>已有EduCoder账号可以输入您的账号和密码将您的微信账号与EduCoder账号进行绑定</Header>
<Content className={"wechatContents"}>
<Input placeholder="请输入手机号/邮箱/登录名"
value={this.state.login}
onInput={this.loginInputonChange}
className={this.state.logintypes==="username"?"bor-red mb20 wechatpass":" mb20 wechatpass"}
></Input>
<Input placeholder="请输入手机号/邮箱/登录名"
value={this.state.login}
onInput={this.loginInputonChange}
className={this.state.logintypes === "username" ? "bor-red mb20 wechatpass" : " mb20 wechatpass"}
></Input>
<Input.Password value={this.state.password}
autoComplete="new-password"
onInput={this.passwordonChange}
className={this.state.logintypes==="password"?"bor-red wechatpass":" wechatpass"}
placeholder="请输入密码"
></Input.Password>
</Content>
{this.state.logintypes==="username"?<span className={"color-red ml50"}>请填写账号</span>:this.state.logintypes==="password"?<span className={"color-red ml50"}></span>:""}
<Footer>
<Button className="login_btn font-16 wechattiyan" type="primary" style={{height:"46px"}} onClick={() => this.postwechatlogin(false,this.state.login,this.state.password)}
size={"large"}>绑定</Button>
</Footer>
</Layout>
</Layout>
</p>
</div>
<Input.Password value={this.state.password}
autoComplete="new-password"
onInput={this.passwordonChange}
className={this.state.logintypes === "password" ? "bor-red wechatpass" : " wechatpass"}
placeholder="请输入密码"
></Input.Password>
</Content>
{this.state.logintypes === "username" ? <span className={"color-red ml50"}>请填写账号</span> : this.state.logintypes === "password" ? <span className={"color-red ml50"}></span> : ""}
<Footer>
<Button className="login_btn font-16 wechattiyan" type="primary" style={{ height: "46px" }} onClick={() => this.postwechatlogin(false, this.state.login, this.state.password)}
size={"large"}>绑定</Button>
</Footer>
</Layout>
</Layout>
</p>
</div>
</div>
<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>
</Spin>
</div>
)
}
</div>
<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>
</Spin>
</div>
)
}
}

@ -1,51 +1,28 @@
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { Redirect } from 'react-router';
import { Link } from "react-router-dom";
import AccountProfile from "../user/AccountProfile";
import PropTypes from 'prop-types';
import Certifiedprofessional from "../../modules/modals/Certifiedprofessional"
// import searchImg from '../../../../images/educoder/icon/search.svg'
// /images/educoder/icon/search.svg
import { getImageUrl, toPath, trigger, broadcastChannelPostMessage } from 'educoder'
import { getImageUrl } from 'educoder'
import axios from 'axios';
import { Modal, Checkbox, Radio, Input, message, notification, Popover } from 'antd';
import { Modal, Radio, Input, message, notification } from 'antd';
import Addcourses from '../courses/coursesPublic/Addcourses';
import LoginDialog from '../login/LoginDialog';
import Trialapplication from '../login/Trialapplication';
import GotoQQgroup from '../../modal/GotoQQgroup'
import 'antd/lib/modal/style/index.css';
import 'antd/lib/checkbox/style/index.css';
import 'antd/lib/radio/style/index.css';
import 'antd/lib/input/style/index.css';
import './TPMIndex.css';
const $ = window.$
// TODO 这部分脚本从公共脚本中直接调用
const RadioGroup = Radio.Group;
const { Search } = Input;
let old_url;
/*
_logined_header.html.erb
_unlogin_header.html.erb
*/
window._header_componentHandler = null;
class NewHeader extends Component {
constructor(props) {
@ -121,44 +98,9 @@ class NewHeader extends Component {
} catch (e) {
}
// axios.interceptors.response.use((response) => {
// if (response != undefined)
// if (response && response.data.status === -1) {
// if (response.data.message === "该课堂要求成员完成实名认证") {
//
// } else if (response.data.message === "该课堂要求成员完成职业认证") {
// console.log("该课堂要求成员完成职业认证");
// this.HideAddcoursestypess(2);
//
//
//
// return
// } else if (response.data.message === "该课堂要求成员完成实名和职业认证") {
// console.log("该课堂要求成员完成实名和职业认证");
// this.HideAddcoursestypess(3);
// return
//
// }
// }
// return response;
// }, (error) => {
//
// });
}
componentDidUpdate = (prevProps) => {
// if(prevProps.user!=this.props.user){
// // console.log("216")
// // console.log(prevProps.user);
// // console.log(this.props.user);
// if(this.props.user !== undefined){
// this.setState({
// user_phone_binded :this.props.user.user_phone_binded,
// })
// }
//
//
// }
}
openNotification = (messge) => {
@ -173,9 +115,6 @@ class NewHeader extends Component {
this.setState({
user: newProps.user
})
if (newProps.Headertop != undefined) {
old_url = newProps.Headertop.old_url
}
}
getCookie = (key) => {
@ -404,14 +343,6 @@ class NewHeader extends Component {
})
return
}
// }else if(value===0){
// if(tojoinclasstitle.length<5){
// this.setState({
// code_notice:true
// })
// return
// }
// }
if (tojoinclasstitle === "" || tojoinclasstitle === undefined) {
this.setState({
code_notice: true
@ -447,58 +378,9 @@ class NewHeader extends Component {
return
}
// if(value===0){
// let url="/courses/join_course_multi_role.json"
// const form = new FormData();
// form.append('invite_code', tojoinclasstitle);
// form.append('role', pamst);
// form.append('type', 1);
// axios.post(url,form,[true]
// ).then((response) => {
// if( response.data.state===0){
// this.submitstatevalue(0,"加入成功",response.data.course_id)
// }else if( response.data.state===1){
// }else if( response.data.state===2){
// this.submitstatevalue( 0,"课堂已过期! 请联系课堂管理员重启课堂。(在配置课堂处)")
// }else if( response.data.state===3){
// this.submitstatevalue( 0,"您已是课堂成员)",response.data.course_id)
// }else if( response.data.state===4){
// this.submitstatevalue( 0,"您输入的邀请码错误)")
// }else if( response.data.state===5){
// this.submitstatevalue( 0,"您还未登录")
// }else if( response.data.state===6){
// this.submitstatevalue( 0,"申请已提交,请等待审核")
// }else if( response.data.state===7){
// this.submitstatevalue( 0," 您已经发送过申请了,请耐心等待")
// }else if( response.data.state===8){
// this.submitstatevalue( 0,"您已经是该课堂的教师了",response.data.course_id)
// }else if( response.data.state==9){
// this.submitstatevalue( 0,"您已经是该课堂的教辅了",response.data.course_id)
// }else if( response.data.state==10){
// this.submitstatevalue(0,"您已经是该课堂的管理员了",response.data.course_id)
// }else if( response.data.state==11){
// this.submitstatevalue(0," 该课堂已归档,请联系老师")
// }else if( response.data.state==12){
// this.submitstatevalue(0,"您已经发送过申请了,请耐心等待师")
// }else if( response.data.state==13){
// this.submitstatevalue(0,"您申请已提交,请等待审核")
// }else if( response.data.state==14){
// this.submitstatevalue("此邀请码已停用,请与老师联系")
// }else if( response.data.state==15){
// this.submitstatevalue(0,"您已是课堂成员! 加入分班请在课堂具体分班页面进行")
// }else {
// this.submitstatevalue(0," 未知错误,请稍后再试")
// }
// })
//
// }
if (value === 1) {
let url = "/project_applies.json"
// const form = new FormData();
// form.append('code', tojoinclasstitle);
// form.append('role', RadioGroupvalue);
// form.append('type', 1);
axios.post(url, {
code: tojoinclasstitle,
role: RadioGroupvalue
@ -529,14 +411,6 @@ class NewHeader extends Component {
this.hidetojoinclass()
}
// trialapplications =()=>{
// console.log("点击了")
// this.setState({
// isRenders: true,
// showTrial:true,
// })
// }
// 关闭
cancelModulationModels = () => {
this.setState({ isRenders: false })

@ -1,18 +1,17 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import {Modal} from 'antd';
import { Modal } from 'antd';
import axios from 'axios';
class AccountProfile extends Component {
constructor(props) {
super(props);
this.state = {
AccountProfiletype:false
}
}
constructor(props) {
super(props);
this.state = {
AccountProfiletype: false
}
}
componentDidMount() {
if(this.props.AccountProfiletype!=undefined){
if (this.props.AccountProfiletype != undefined) {
this.setState({
AccountProfiletype:this.props.AccountProfiletype
AccountProfiletype: this.props.AccountProfiletype
})
}
@ -32,19 +31,19 @@ class AccountProfile extends Component {
}
gotoback=(type)=>{
if(type===true){
window.location.href="/";
}else{
if(this.props.AccountProfiletype!=undefined){
gotoback = (type) => {
if (type === true) {
window.location.href = "/";
} else {
if (this.props.AccountProfiletype != undefined) {
this.setState({
AccountProfiletype:false
AccountProfiletype: false
})
this.props.hideAccountProfile()
}else{
window.location.href="/";
} else {
window.location.href = "/";
this.setState({
AccountProfiletype:false
AccountProfiletype: false
})
}
}
@ -52,34 +51,34 @@ class AccountProfile extends Component {
}
/**
content: '您需要去完成您的职业认证,才能使用此功能',
okText: '立即完成',
okHref: '/account/certification'
*/
render() {
const { content, okText, okHref,cannelText,Accounturltype} = this.props;
return(
<Modal
keyboard={false}
title="提示"
visible={this.state.AccountProfiletype}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
width="530px"
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16"> {content || '您需要去完善您的个人资料,才能使用此功能'}</p>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={()=>this.gotoback(Accounturltype)}>{cannelText ||'稍后完善'}</a>
<a className="task-btn task-btn-orange" href={ okHref || "/account/profile/edit" }> {okText || '立即完善'}</a>
</div>
/**
content: '您需要去完成您的职业认证,才能使用此功能',
okText: '立即完成',
okHref: '/account/certification'
*/
render() {
const { content, okText, okHref, cannelText, Accounturltype } = this.props;
return (
<Modal
keyboard={false}
title="提示"
visible={this.state.AccountProfiletype}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
width="530px"
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16"> {content || '您需要去完善您的个人资料,才能使用此功能'}</p>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={() => this.gotoback(Accounturltype)}>{cannelText || '稍后完善'}</a>
<a className="task-btn task-btn-orange" href={okHref || "/account/profile/edit"}> {okText || '立即完善'}</a>
</div>
</Modal>
)
}
</div>
</Modal>
)
}
}
export default AccountProfile;

@ -33,7 +33,7 @@ async function requestTimestamp(proxy) {
}
export function setCookie(Cookies) {
Cookies.map((item,key)=>{
Cookies.map((item, key) => {
if (item.id === 'educoder_session') {
cookie.save('_educoder_session', item.value, { path: '/' });
cookie.save('_educoder_session', item.value, { domain: '.educoder.net', path: '/' });
@ -184,45 +184,12 @@ export function initAxiosInterceptors() {
})
}
initAxiosInterceptors()
export function exportMdtoHtml(md) {
var converter = new showdown.Converter()
return converter.makeHtml(md);
}
export function dataFetchReducer(state, action) {
switch (action.type) {
case 'FETCH_INIT':
return {
...state,
isLoading: true,
isError: false
}
case 'FETCH_SUCCESS':
return {
...state,
isLoading: false,
isError: false,
data: action.payload,
}
case 'FETCH_FAILURE':
return {
...state,
isLoading: false,
isError: true,
}
case 'FETCH_FINISH':
return {
...state,
isLoading: false,
isError: false,
}
default:
throw new Error();
}
}
export function debounce(func, wait, immediate) {
var timeout

Loading…
Cancel
Save