Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev

This commit is contained in:
zwjamnsss 2017-08-25 11:29:48 +08:00
commit acb8c1e025
5 changed files with 13 additions and 22 deletions

View File

@ -67,7 +67,6 @@ class ProjectCard extends Component {
render() {
const { projectData, inFollowPage } = this.props;
console.log(projectData);
return (
<div className="card-container">
<Card bordered={false} className="m-card" onClick={() => this.props.history.push('/project/' + (projectData.projectid || projectData._id))}>

View File

@ -34,7 +34,6 @@ class Follows extends Component {
receiveRes = () => {
this.props.getFollowList(this.props.uid).then((res) => {
console.log(res);
if (res.payload.data.errcode === 0) {
this.setState({
data: res.payload.data.data.list
@ -44,9 +43,7 @@ class Follows extends Component {
}
async componentWillMount() {
console.log(this.props);
this.props.getFollowList(this.props.uid).then((res) => {
console.log(res);
if (res.payload.data.errcode === 0) {
this.setState({
data: res.payload.data.data.list

View File

@ -3,11 +3,12 @@
.follow-box{
padding: 24px;
background-color: #fff;
padding: 24px;
background-color: #fff;
}
.card-panel {
border-radius: 4px;
box-shadow: $box-shadow-panel;
min-height: 5rem;
}

View File

@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Form, Button, Input, Icon, message } from 'antd';
import { regActions } from '../../reducer/modules/user';
import { withRouter } from 'react-router'
const FormItem = Form.Item;
const formItemStyle = {
marginBottom: '.16rem'
@ -23,7 +23,7 @@ const changeHeight = {
regActions
}
)
@withRouter
class Reg extends Component {
constructor(props) {
super(props);
@ -34,6 +34,7 @@ class Reg extends Component {
static propTypes = {
form: PropTypes.object,
history: PropTypes.object,
regActions: PropTypes.func
}
@ -44,26 +45,18 @@ class Reg extends Component {
if (!err) {
this.props.regActions(values).then((res) => {
if (res.payload.data.errcode == 0) {
this.props.history.push('/group');
message.success('注册成功! ');
} else {
message.error(res.payload.data.errmsg);
}
}).catch((err) => {
message.error(err);
});
}
});
}
handleConfirmBlur = (e) => {
const value = e.target.value;
this.setState({ confirmDirty: this.state.confirmDirty || !!value });
}
checkPassword = (rule, value, callback) => {
const form = this.props.form;
if (value && value !== form.getFieldValue('password')) {
callback('Two passwords that you enter is inconsistent!');
callback('两次输入的密码不一致啊!');
} else {
callback();
}
@ -100,7 +93,7 @@ class Reg extends Component {
pattern: /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
}]
})(
<Input style={changeHeight} prefix={<Icon type="user" style={{ fontSize: 13 }} />} placeholder="Email" />
<Input style={changeHeight} prefix={<Icon type="mail" style={{ fontSize: 13 }} />} placeholder="Email" />
)}
</FormItem>

View File

@ -92,6 +92,7 @@ class ProjectMessage extends Component {
updateProject(assignValue).then((res) => {
if (res.payload.data.errcode == 0) {
this.props.getProjectMsg(this.props.projectId);
message.success('修改成功! ');
// this.props.history.push('/group');
} else {
@ -140,9 +141,9 @@ class ProjectMessage extends Component {
showConfirm = () => {
let that = this;
confirm({
title: "确认删除 " + that.props.projectMsg.name + " 分组吗?",
title: "确认删除 " + that.props.projectMsg.name + " 项目吗?",
content: <div style={{ marginTop: '10px', fontSize: '12px', lineHeight: '25px' }}>
<Alert message="警告:此操作非常危险,会删除该分组下面所有项目和接口,并且无法恢复!" type="warning" banner />
<Alert message="警告:此操作非常危险,会删除该项目下面所有接口,并且无法恢复!" type="warning" banner />
<div style={{ marginTop: '15px' }}>
<p style={{ marginBottom: '8px' }}><b>请输入项目名称确认此操作:</b></p>
<Input id="project_name" size="large" />
@ -151,7 +152,7 @@ class ProjectMessage extends Component {
onOk() {
let groupName = document.getElementById('project_name').value;
if (that.props.projectMsg.name !== groupName) {
message.error('分组名称有误')
message.error('项目名称有误')
return new Promise((resolve, reject) => {
reject('error')
})