import React from 'react'; import { Input, Button, Form, Icon, Spin, message } from 'antd'; import './base.less'; import ajax from 'jquery/src/ajax/xhr.js' import $ from 'jquery/src/ajax'; import ChangePw from './changePassword.jsx'; const FormItem = Form.Item; import weixin from '../../../../image/weixin-w.png'; import qq from '../../../../image/qq-w.png'; import weibo from '../../../../image/weibo-w.png'; const BaseFrom = Form.create()(React.createClass({ getData() { this.props.spinState(true); $.ajax({ method: "get", dataType: "json", url: globalConfig.context + "/api/user/base", success: function (data) { if (data.data) { this.setState({ id:data.data.id, fixedTel: data.data.fixedTel, firstContacts: data.data.firstContacts, firstMobile: data.data.firstMobile, secondContacts: data.data.secondContacts, secondMobile: data.data.secondMobile, thirdContacts: data.data.thirdContacts, thirdMobile: data.data.thirdMobile, qq: data.data.qq, address: data.data.postalAddress, postcode: data.data.postcode, legalPerson: data.data.legalPerson, email: data.data.email, }); }; }.bind(this), }).done(function (data) { if (data.error.length) { message.warning(data.error[0].message); } }.bind(this)).always(function () { this.props.spinState(false); }.bind(this)); }, getInitialState() { return { }; }, componentWillMount() { this.getData(); }, handleSubmit(e) { e.preventDefault(); this.props.form.validateFields((err, values) => { if (!err) { this.props.spinState(true); $.ajax({ method: "POST", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/user/orgIdentity", data: { "id":this.state.id, "firstContacts": values.firstContacts, "firstMobile": values.firstMobile, "secondContacts": values.secondContacts, "secondMobile": values.secondMobile, "thirdContacts": values.thirdContacts, "thirdMobile": values.thirdMobile, "email": values.email, "fixedTel": values.telephone, "qq": values.qq, "postalAddress": values.address, "postcode": values.postcode, "moblie": values.moblie, "legalPerson": values.legalPerson } }).done(function (data) { if (!data.error.length) { message.success('保存成功!'); this.getData(); } else { message.warning(data.error[0].message); } }.bind(this)).always(function () { this.props.spinState(false); }.bind(this)); } }); }, checkidNum(rule, value, callback) { const form = this.props.form; if (value && value !== form.getFieldValue('password')) { callback('Two passwords that you enter is inconsistent!'); } else { callback(); } }, checkUpload(file) { const isJPG = file.type === 'image/jpeg'; if (!isJPG) { callback('You can only upload JPG file!'); } const isLt2M = file.size / 1024 / 1024 < 2; if (!isLt2M) { callback('Image must smaller than 2MB!'); } return isJPG && isLt2M; }, checkPhone(rule, value, callback) { const form = this.props.form; if (value && value.length !== 0 && !(/^1[34578]\d{9}$/.test(value))) { callback('请输入正确的手机号码!'); } else { callback(); } }, render() { const { getFieldDecorator } = this.props.form; const formItemLayout = { labelCol: { span: 4 }, wrapperCol: { span: 12 }, }; return (
); }, })); //绑定账号 绑定后,可使用第三方账号直接登录阿凡提网
请确认您的联系信息