fix accountbasic bug

dev_aliyun2
harry 6 years ago
parent be519f87e1
commit a691b82a7e

@ -1,7 +1,5 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Spin } from 'antd';
class Loading extends Component { class Loading extends Component {
render() { render() {
return ( return (
@ -15,7 +13,7 @@ class Loading extends Component {
` `
} }
</style> </style>
<Spin size="large" className={"margintop"} /> <p>loading...</p>
</div> </div>
); );
} }

@ -486,7 +486,7 @@ class LoginDialog extends Component {
} }
return ( return (
<Modal visible={true} id="DialogID" <Modal visible={isRender} id="DialogID"
className="zindextest" className="zindextest"
onClose={() => this.handleDialogClose()} onClose={() => this.handleDialogClose()}
> >
@ -516,7 +516,6 @@ class LoginDialog extends Component {
<div id="log_reg_content" > <div id="log_reg_content" >
{weixinlogin === true ? "" : <ul className="log_nav clearfix"> {weixinlogin === true ? "" : <ul className="log_nav clearfix">
<li className={login == 0 ? 'active' : ''} onClick={() => { this.enter(0) }}>登录</li> <li className={login == 0 ? 'active' : ''} onClick={() => { this.enter(0) }}>登录</li>
{/*<li className={speedy==0?'active':''} onClick={()=>{this.register(0)}}>快捷登录</li>*/}
</ul>} </ul>}

@ -1,7 +1,5 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { Spin } from 'antd'; import { Spin } from 'antd';
import axios from 'axios'; import axios from 'axios';
class Otherloginqq extends Component { class Otherloginqq extends Component {
@ -13,10 +11,12 @@ class Otherloginqq extends Component {
const types = type[1].split('&state='); const types = type[1].split('&state=');
const typeshref = types[1].split('%2C'); const typeshref = types[1].split('%2C');
let codeurl = `/auth/qq/callback`; let codeurl = `/auth/qq/callback`;
axios.get(codeurl,{params:{ axios.get(codeurl, {
params: {
code: types[0], code: types[0],
redirect_uri: `https://www.educoder.net/otherloginqq` redirect_uri: `https://www.educoder.net/otherloginqq`
}}).then((result)=> { }
}).then((result) => {
if (result) { if (result) {
if (result.data.status === 0) { if (result.data.status === 0) {
if (result.data.new_user === true) { if (result.data.new_user === true) {

@ -1,7 +1,5 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { Spin } from 'antd'; import { Spin } from 'antd';
import axios from 'axios'; import axios from 'axios';
class Otherloginstart extends Component { class Otherloginstart extends Component {
@ -20,9 +18,11 @@ class Otherloginstart extends Component {
window.location.href = `https://${typeshref[1]}/otherloginstart?code=${types[0]}&state=null,""`; window.location.href = `https://${typeshref[1]}/otherloginstart?code=${types[0]}&state=null,""`;
} }
let codeurl = `/auth/wechat/callback.json` let codeurl = `/auth/wechat/callback.json`
axios.get(codeurl,{params:{ axios.get(codeurl, {
params: {
code: types[0] code: types[0]
}}).then((result)=> { }
}).then((result) => {
if (result) { if (result) {
if (result.data.status === 0) { if (result.data.status === 0) {
if (result.data.new_user === true) { if (result.data.new_user === true) {

@ -10,12 +10,10 @@ import TPMIndexHOC from '../tpm/TPMIndexHOC';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
import AccountNav from './account/AccountNav' import AccountNav from './account/AccountNav'
import AccountBasic from './account/AccountBasic'
import axios from 'axios' import axios from 'axios'
console.log(AccountBasic, '00000000')
const AccountBasic = Loadable({
loader: () => import('./account/AccountBasic'),
loading: Loading,
})
const AccountBasicEdit = Loadable({ const AccountBasicEdit = Loadable({
loader: () => import('./account/AccountBasicEdit'), loader: () => import('./account/AccountBasicEdit'),
loading: Loading, loading: Loading,
@ -62,7 +60,6 @@ class AccountPage extends Component {
if (result.data && result.data.base_info_completed == false) { if (result.data && result.data.base_info_completed == false) {
this.props.history.push(`/account/profile/edit`); this.props.history.push(`/account/profile/edit`);
} }
// "authentication": "uncertified", // "uncertified" | "applying" | "certified"
this.setState({ this.setState({
basicInfo: Object.assign({}, { ...result.data }, { basicInfo: Object.assign({}, { ...result.data }, {
avatar_url: `${result.data.avatar_url}`, avatar_url: `${result.data.avatar_url}`,

@ -1,27 +1,17 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { SnackbarHOC, getImageUrl, City } from 'educoder'; import { Form, Button } from 'antd'
import { Form, Button, Input, Radio, Select, Tooltip, Icon } from 'antd'
import './common.css' import './common.css'
import { getHiddenName } from './AccountBasicEdit' import { getHiddenName } from './AccountBasicEdit'
const identityMap = { "teacher": "教师", "student": "学生", "professional": "专业人士" }
const RadioGroup = Radio.Group;
const Option = Select.Option
const radioOptions = [
{ label: '男', value: 'boy' },
{ label: '女', value: 'girl' },
];
export const identityMap={"teacher":"教师", "student":"学生", "professional":"专业人士"}
class AccountBasicEdit extends Component { class AccountBasicEdit extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
} }
render() { render() {
const { getFieldDecorator } = this.props.form;
const { basicInfo } = this.props const { basicInfo } = this.props
const showRealName = false;
return ( return (
<div> <div>
<div className="basicForm"> <div className="basicForm">

@ -1,16 +1,13 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { SnackbarHOC, getImageUrl, City, ConditionToolTip } from 'educoder'; import { City, ConditionToolTip } from 'educoder';
import { Form, Button, Input, Radio, Select, Tooltip, Icon, AutoComplete } from 'antd' import { Form, Button, Input, Radio, Tooltip } from 'antd'
import ApplyForAddOrgModal from '../modal/ApplyForAddOrgModal' import ApplyForAddOrgModal from '../modal/ApplyForAddOrgModal'
import ApplyForAddChildOrgModal from '../modal/ApplyForAddChildOrgModal' import ApplyForAddChildOrgModal from '../modal/ApplyForAddChildOrgModal'
import AccountBasicEditItem from './AccountBasicEditItem'; import AccountBasicEditItem from './AccountBasicEditItem';
import axios from 'axios' import axios from 'axios'
import { identityMap } from './AccountBasic'
const RadioGroup = Radio.Group; const RadioGroup = Radio.Group;
const Option = Select.Option;
const map = identityMap // {"teacher":"教师", "student":"学生", "professional":"专业人士"}
export function getHiddenName(name) { export function getHiddenName(name) {
if (!name) return '' if (!name) return ''
let len = parseInt(name.length) - 1; let len = parseInt(name.length) - 1;

@ -1,6 +1,4 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { SnackbarHOC, getImageUrl } from 'educoder';
import AccountImg from './AccountImg' import AccountImg from './AccountImg'
class AccountNav extends Component { class AccountNav extends Component {
toBasic = () => { toBasic = () => {

Loading…
Cancel
Save