mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-30 13:20:24 +08:00
Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev
This commit is contained in:
commit
bfa7e2f0b3
@ -175,12 +175,12 @@ export default class HeaderCom extends Component {
|
|||||||
return (
|
return (
|
||||||
<Header className="header-box m-header">
|
<Header className="header-box m-header">
|
||||||
<div className="content g-row">
|
<div className="content g-row">
|
||||||
<div className="logo">
|
<Link onClick={this.relieveLink} to="/group" className="logo">
|
||||||
<Link to="/group" onClick={this.relieveLink} className="href">
|
<div className="href">
|
||||||
<span className="img">{logoSVG('32px')}</span>
|
<span className="img">{logoSVG('32px')}</span>
|
||||||
{/*<span className="logo-name">YApi</span>*/}
|
{/*<span className="logo-name">YApi</span>*/}
|
||||||
</Link>
|
|
||||||
</div>
|
</div>
|
||||||
|
</Link>
|
||||||
<Breadcrumb />
|
<Breadcrumb />
|
||||||
<div className="user-toolbar">
|
<div className="user-toolbar">
|
||||||
{login?
|
{login?
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import Mock from 'mockjs'
|
import Mock from 'mockjs'
|
||||||
import { Button, Input, Select, Card, Alert, Spin, Icon, Collapse, Tooltip, message, AutoComplete } from 'antd'
|
import { Button, Input, Select, Alert, Spin, Icon, Collapse, Tooltip, message, AutoComplete } from 'antd'
|
||||||
import { autobind } from 'core-decorators';
|
import { autobind } from 'core-decorators';
|
||||||
import constants from '../../constants/variable.js'
|
import constants from '../../constants/variable.js'
|
||||||
|
|
||||||
@ -517,7 +517,7 @@ export default class Run extends Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="interface-test postman">
|
<div className="interface-test postman">
|
||||||
<div className="has-plugin">
|
<div className={ hasPlugin? null : 'has-plugin' } >
|
||||||
{hasPlugin ? '' : <Alert
|
{hasPlugin ? '' : <Alert
|
||||||
message={
|
message={
|
||||||
<div>
|
<div>
|
||||||
@ -547,7 +547,10 @@ export default class Run extends Component {
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Card title={<Tooltip placement="top" title="在 '设置->环境配置' 配置 domain">请求部分 <Icon type="question-circle-o" /></Tooltip>} noHovering className="req-part">
|
|
||||||
|
<h2 className="interface-title" style={{ marginTop: 0 }}>请求部分
|
||||||
|
<Tooltip placement="top" title="在 '设置->环境配置' 配置 domain"><Icon type="question-circle-o" /></Tooltip>
|
||||||
|
</h2>
|
||||||
<div className="url">
|
<div className="url">
|
||||||
|
|
||||||
<InputGroup compact style={{ display: 'flex' }}>
|
<InputGroup compact style={{ display: 'flex' }}>
|
||||||
@ -717,9 +720,8 @@ export default class Run extends Component {
|
|||||||
*/}
|
*/}
|
||||||
</Panel>
|
</Panel>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
</Card>
|
|
||||||
|
|
||||||
<Card title="返回结果" noHovering className="resp-part">
|
<h2 className="interface-title">返回结果</h2>
|
||||||
<Spin spinning={this.state.loading}>
|
<Spin spinning={this.state.loading}>
|
||||||
<div className="res-code"></div>
|
<div className="res-code"></div>
|
||||||
<Collapse defaultActiveKey={['0', '1']} bordered={true}>
|
<Collapse defaultActiveKey={['0', '1']} bordered={true}>
|
||||||
@ -744,7 +746,6 @@ export default class Run extends Component {
|
|||||||
</Panel>
|
</Panel>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
</Spin>
|
</Spin>
|
||||||
</Card>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -14,3 +14,6 @@
|
|||||||
min-height: 200px;
|
min-height: 200px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.interface-test {
|
||||||
|
padding: .24rem;
|
||||||
|
}
|
||||||
|
@ -101,6 +101,9 @@ export default class GroupList extends Component {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
newGroupName: '',
|
||||||
|
group_name: '',
|
||||||
|
owner_uid: 0,
|
||||||
addGroupModalVisible: false
|
addGroupModalVisible: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -111,6 +114,9 @@ export default class GroupList extends Component {
|
|||||||
const res = await axios.post('/api/group/add', { group_name, group_desc, owner_uid })
|
const res = await axios.post('/api/group/add', { group_name, group_desc, owner_uid })
|
||||||
if (!res.data.errcode) {
|
if (!res.data.errcode) {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
newGroupName: '',
|
||||||
|
group_name: '',
|
||||||
|
owner_uid: 0,
|
||||||
addGroupModalVisible: false
|
addGroupModalVisible: false
|
||||||
});
|
});
|
||||||
await this.props.fetchGroupList();
|
await this.props.fetchGroupList();
|
||||||
|
@ -189,7 +189,7 @@ class InterfaceMenu extends Component {
|
|||||||
that.props.history.push('/project/' + that.props.match.params.id + '/interface/api')
|
that.props.history.push('/project/' + that.props.match.params.id + '/interface/api')
|
||||||
|
|
||||||
},
|
},
|
||||||
async onCancel() {
|
onCancel() {
|
||||||
ref.destroy()
|
ref.destroy()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
.interface-test {
|
.interface-test {
|
||||||
.has-plugin, .req-part, .resp-part {
|
.has-plugin, .req-part, .resp-part {
|
||||||
margin: 8px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
.url {
|
.url {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -25,7 +25,7 @@
|
|||||||
margin-left: 6px;
|
margin-left: 6px;
|
||||||
}
|
}
|
||||||
.icon-btn:hover {
|
.icon-btn:hover {
|
||||||
color: #108ee9;
|
color: #2395f1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.add-col-modal {
|
.add-col-modal {
|
||||||
@ -41,7 +41,8 @@
|
|||||||
background: #fa0;
|
background: #fa0;
|
||||||
}
|
}
|
||||||
.col-item.selected {
|
.col-item.selected {
|
||||||
background: #108ee9;
|
background: #2395f1;
|
||||||
|
color: rgba(255, 255, 255, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,6 +120,6 @@
|
|||||||
transform: translate(0, -50%);
|
transform: translate(0, -50%);
|
||||||
}
|
}
|
||||||
.user-name {
|
.user-name {
|
||||||
padding-left: .32rem;
|
padding-left: .38rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,14 +67,18 @@ class groupController extends baseController {
|
|||||||
return ctx.body = yapi.commons.resReturn(null, 400, '项目分组名不能为空');
|
return ctx.body = yapi.commons.resReturn(null, 400, '项目分组名不能为空');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!params.owner_uid) {
|
// if (!params.owner_uid) {
|
||||||
return ctx.body = yapi.commons.resReturn(null, 400, '项目分组必须添加一个组长');
|
// return ctx.body = yapi.commons.resReturn(null, 400, '项目分组必须添加一个组长');
|
||||||
}
|
// }
|
||||||
|
|
||||||
let groupUserdata = await this.getUserdata(params.owner_uid, 'owner');
|
let groupUserdata = null;
|
||||||
|
if (params.owner_uid) {
|
||||||
|
groupUserdata = await this.getUserdata(params.owner_uid, 'owner');
|
||||||
if (groupUserdata === null) {
|
if (groupUserdata === null) {
|
||||||
return ctx.body = yapi.commons.resReturn(null, 400, '组长uid不存在')
|
return ctx.body = yapi.commons.resReturn(null, 400, '组长uid不存在')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let groupInst = yapi.getInst(groupModel);
|
let groupInst = yapi.getInst(groupModel);
|
||||||
|
|
||||||
let checkRepeat = await groupInst.checkRepeat(params.group_name);
|
let checkRepeat = await groupInst.checkRepeat(params.group_name);
|
||||||
@ -89,7 +93,7 @@ class groupController extends baseController {
|
|||||||
uid: this.getUid(),
|
uid: this.getUid(),
|
||||||
add_time: yapi.commons.time(),
|
add_time: yapi.commons.time(),
|
||||||
up_time: yapi.commons.time(),
|
up_time: yapi.commons.time(),
|
||||||
members: [groupUserdata]
|
members: groupUserdata ? [groupUserdata] : []
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user