mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-06 12:45:22 +08:00
Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev
This commit is contained in:
commit
0f02d4df50
@ -461,6 +461,7 @@ export default class Run extends Component {
|
||||
</InputGroup>
|
||||
<Tooltip placement="bottom" title="请求真实接口">
|
||||
<Button
|
||||
disabled={!hasPlugin}
|
||||
onClick={this.reqRealInterface}
|
||||
type="primary"
|
||||
style={{marginLeft: 10}}
|
||||
|
@ -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))}>
|
||||
|
@ -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
|
||||
@ -69,7 +66,7 @@ class Follows extends Component {
|
||||
path: '/follow'
|
||||
}]}/>
|
||||
<div className="g-row">
|
||||
<Row gutter={24} className="follow-box card-panel">
|
||||
<Row gutter={24} className="follow-box card-panel pannel-without-tab">
|
||||
{data.length ? data.map((item, index) => {
|
||||
return (
|
||||
<Col span={8} key={index}>
|
||||
|
@ -3,8 +3,8 @@
|
||||
|
||||
|
||||
.follow-box{
|
||||
padding: 24px;
|
||||
background-color: #fff;
|
||||
padding: 24px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.card-panel {
|
||||
|
@ -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>
|
||||
|
||||
|
@ -172,7 +172,7 @@ class View extends Component {
|
||||
dataSource.push({
|
||||
key: i,
|
||||
name: item.name,
|
||||
required: item.required,
|
||||
required: item.required?"必须":"非必须",
|
||||
value: item.value,
|
||||
desc: item.desc
|
||||
})
|
||||
@ -243,6 +243,18 @@ class View extends Component {
|
||||
delete: {
|
||||
bac: "#57cf27",
|
||||
color: "#57cf27"
|
||||
},
|
||||
head: {
|
||||
bac: "#d4d5f7",
|
||||
color: "#0b47ef"
|
||||
},
|
||||
patch: {
|
||||
bac: "#f9f4e1",
|
||||
color: "#fac200"
|
||||
},
|
||||
options: {
|
||||
bac: "#f7cdf5",
|
||||
color: "#fa00f2"
|
||||
}
|
||||
}
|
||||
methodColor = methodColor[this.props.curData.method?this.props.curData.method.toLowerCase():"get"];
|
||||
|
@ -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')
|
||||
})
|
||||
@ -265,16 +266,16 @@ class ProjectMessage extends Component {
|
||||
validator(rule, value, callback) {
|
||||
if (value) {
|
||||
if (value.length === 0) {
|
||||
callback('请输入环境域名');
|
||||
} else if (!/\S/.test(value)) {
|
||||
callback('请输入环境域名');
|
||||
} else if (!/^([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}$/.test(value)) {
|
||||
callback('域名格式错误');
|
||||
callback('请输入环境域名!');
|
||||
} else if (/\s/.test(value)) {
|
||||
callback('环境域名不允许出现空格!');
|
||||
} else if (/\//.test(value)) {
|
||||
callback('环境域名不允许出现‘\/’!');
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
} else {
|
||||
callback('请输入环境域名');
|
||||
callback('请输入环境域名!');
|
||||
}
|
||||
}
|
||||
}]
|
||||
|
@ -88,3 +88,7 @@ em {
|
||||
.card-panel {
|
||||
padding: .36rem .24rem 0;
|
||||
}
|
||||
|
||||
.pannel-without-tab {
|
||||
min-height: 5rem;
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ var interfaceColController = function (_baseController) {
|
||||
(0, _createClass3.default)(interfaceColController, [{
|
||||
key: 'list',
|
||||
value: function () {
|
||||
var _ref = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee(ctx) {
|
||||
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(ctx) {
|
||||
var id, result, i;
|
||||
return _regenerator2.default.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
@ -149,7 +149,7 @@ var interfaceColController = function (_baseController) {
|
||||
}, {
|
||||
key: 'addCol',
|
||||
value: function () {
|
||||
var _ref2 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee2(ctx) {
|
||||
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(ctx) {
|
||||
var params, auth, result, username;
|
||||
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
||||
while (1) {
|
||||
@ -255,7 +255,7 @@ var interfaceColController = function (_baseController) {
|
||||
}, {
|
||||
key: 'getCaseList',
|
||||
value: function () {
|
||||
var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(ctx) {
|
||||
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(ctx) {
|
||||
var id, inst, result;
|
||||
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
||||
while (1) {
|
||||
@ -319,7 +319,7 @@ var interfaceColController = function (_baseController) {
|
||||
}, {
|
||||
key: 'addCase',
|
||||
value: function () {
|
||||
var _ref4 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4(ctx) {
|
||||
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(ctx) {
|
||||
var _this2 = this;
|
||||
|
||||
var params, auth, result, username;
|
||||
@ -448,7 +448,7 @@ var interfaceColController = function (_baseController) {
|
||||
}, {
|
||||
key: 'upCase',
|
||||
value: function () {
|
||||
var _ref5 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee5(ctx) {
|
||||
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(ctx) {
|
||||
var _this3 = this;
|
||||
|
||||
var params, caseData, auth, result, username;
|
||||
@ -561,7 +561,7 @@ var interfaceColController = function (_baseController) {
|
||||
}, {
|
||||
key: 'getCase',
|
||||
value: function () {
|
||||
var _ref6 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee6(ctx) {
|
||||
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(ctx) {
|
||||
var id, result;
|
||||
return _regenerator2.default.wrap(function _callee6$(_context6) {
|
||||
while (1) {
|
||||
@ -615,7 +615,7 @@ var interfaceColController = function (_baseController) {
|
||||
}, {
|
||||
key: 'upCol',
|
||||
value: function () {
|
||||
var _ref7 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee7(ctx) {
|
||||
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(ctx) {
|
||||
var params, id, colData, auth, result, username;
|
||||
return _regenerator2.default.wrap(function _callee7$(_context7) {
|
||||
while (1) {
|
||||
@ -700,7 +700,7 @@ var interfaceColController = function (_baseController) {
|
||||
}, {
|
||||
key: 'upCaseIndex',
|
||||
value: function () {
|
||||
var _ref8 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee8(ctx) {
|
||||
var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(ctx) {
|
||||
var _this4 = this;
|
||||
|
||||
var params;
|
||||
@ -769,7 +769,7 @@ var interfaceColController = function (_baseController) {
|
||||
}, {
|
||||
key: 'delCol',
|
||||
value: function () {
|
||||
var _ref9 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee9(ctx) {
|
||||
var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(ctx) {
|
||||
var id, colData, auth, result, username;
|
||||
return _regenerator2.default.wrap(function _callee9$(_context9) {
|
||||
while (1) {
|
||||
@ -855,7 +855,7 @@ var interfaceColController = function (_baseController) {
|
||||
}, {
|
||||
key: 'delCase',
|
||||
value: function () {
|
||||
var _ref10 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee10(ctx) {
|
||||
var _ref10 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(ctx) {
|
||||
var _this5 = this;
|
||||
|
||||
var caseid, caseData, auth, result, username;
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 22 KiB |
Binary file not shown.
Before Width: | Height: | Size: 170 KiB |
Loading…
Reference in New Issue
Block a user