mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-21 05:19:42 +08:00
fix: 私有项目有权限查看的bug
This commit is contained in:
parent
93ae9cabd5
commit
f2f0d98ce5
@ -52,10 +52,13 @@ export default class InterfaceColContent extends Component {
|
|||||||
result.payload.data.data.find(item => +item._id === +currColId) && +currColId ||
|
result.payload.data.data.find(item => +item._id === +currColId) && +currColId ||
|
||||||
result.payload.data.data[0]._id;
|
result.payload.data.data[0]._id;
|
||||||
this.props.history.push('/project/' + params.id + '/interface/col/' + currColId)
|
this.props.history.push('/project/' + params.id + '/interface/col/' + currColId)
|
||||||
|
if(currColId && currColId != 0){
|
||||||
this.props.fetchCaseList(currColId);
|
this.props.fetchCaseList(currColId);
|
||||||
this.props.setColData({currColId: +currColId, isShowCol: true})
|
this.props.setColData({currColId: +currColId, isShowCol: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
const { interfaceColList } = nextProps;
|
const { interfaceColList } = nextProps;
|
||||||
const { actionId: oldColId, id } = this.props.match.params
|
const { actionId: oldColId, id } = this.props.match.params
|
||||||
@ -63,9 +66,12 @@ export default class InterfaceColContent extends Component {
|
|||||||
if (!interfaceColList.find(item => +item._id === +newColId)) {
|
if (!interfaceColList.find(item => +item._id === +newColId)) {
|
||||||
this.props.history.push('/project/' + id + '/interface/col/' + interfaceColList[0]._id)
|
this.props.history.push('/project/' + id + '/interface/col/' + interfaceColList[0]._id)
|
||||||
} else if (oldColId !== newColId) {
|
} else if (oldColId !== newColId) {
|
||||||
|
if(newColId && newColId != 0){
|
||||||
this.props.fetchCaseList(newColId);
|
this.props.fetchCaseList(newColId);
|
||||||
this.props.setColData({currColId: +newColId, isShowCol: true})
|
this.props.setColData({currColId: +newColId, isShowCol: true})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
@ -4,7 +4,9 @@ import _ from 'underscore'
|
|||||||
import constants from '../../../../constants/variable.js'
|
import constants from '../../../../constants/variable.js'
|
||||||
import { handlePath, nameLengthLimit } from '../../../../common.js'
|
import { handlePath, nameLengthLimit } from '../../../../common.js'
|
||||||
import json5 from 'json5'
|
import json5 from 'json5'
|
||||||
import {message} from 'antd'
|
import { message, Tabs } from 'antd'
|
||||||
|
import Editor from 'wangeditor'
|
||||||
|
const TabPane = Tabs.TabPane;
|
||||||
|
|
||||||
const validJson = (json) => {
|
const validJson = (json) => {
|
||||||
try {
|
try {
|
||||||
@ -90,15 +92,16 @@ class InterfaceEditForm extends Component {
|
|||||||
res_body: '',
|
res_body: '',
|
||||||
desc: '',
|
desc: '',
|
||||||
res_body_mock: '',
|
res_body_mock: '',
|
||||||
|
jsonType: 'tpl',
|
||||||
mockUrl: this.props.mockUrl
|
mockUrl: this.props.mockUrl
|
||||||
}, curdata)
|
}, curdata)
|
||||||
}
|
}
|
||||||
|
|
||||||
handleSubmit = (e) => {
|
handleSubmit = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
this.props.form.validateFields((err, values) => {
|
this.props.form.validateFields((err, values) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
|
values.desc = this.editor.txt.html();
|
||||||
if (values.res_body_type === 'json') {
|
if (values.res_body_type === 'json') {
|
||||||
if (this.state.res_body && validJson(this.state.res_body) === false) {
|
if (this.state.res_body && validJson(this.state.res_body) === false) {
|
||||||
return message.error('返回body json格式有问题,请检查!')
|
return message.error('返回body json格式有问题,请检查!')
|
||||||
@ -112,8 +115,6 @@ class InterfaceEditForm extends Component {
|
|||||||
values.req_body_other = this.state.req_body_other;
|
values.req_body_other = this.state.req_body_other;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
values.method = this.state.method;
|
values.method = this.state.method;
|
||||||
values.req_params = values.req_params || [];
|
values.req_params = values.req_params || [];
|
||||||
let isfile = false, isHavaContentType = false;
|
let isfile = false, isHavaContentType = false;
|
||||||
@ -194,6 +195,9 @@ class InterfaceEditForm extends Component {
|
|||||||
data: resBodyEditor.curData.mockText,
|
data: resBodyEditor.curData.mockText,
|
||||||
readOnly: true
|
readOnly: true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
let editor = this.editor = new Editor('#desc');
|
||||||
|
editor.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
addParams = (name, data) => {
|
addParams = (name, data) => {
|
||||||
@ -214,6 +218,13 @@ class InterfaceEditForm extends Component {
|
|||||||
this.setState(newValue)
|
this.setState(newValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleJsonType = (key)=>{
|
||||||
|
key = key || 'tpl';
|
||||||
|
this.setState({
|
||||||
|
jsonType: key
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
handlePath = (e) => {
|
handlePath = (e) => {
|
||||||
let val = e.target.value, queue = [];
|
let val = e.target.value, queue = [];
|
||||||
val = handlePath(val)
|
val = handlePath(val)
|
||||||
@ -481,16 +492,6 @@ class InterfaceEditForm extends Component {
|
|||||||
)}
|
)}
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem
|
|
||||||
className="interface-edit-item"
|
|
||||||
{...formItemLayout}
|
|
||||||
label="接口描述"
|
|
||||||
>
|
|
||||||
{getFieldDecorator('desc', { initialValue: this.state.desc })(
|
|
||||||
<Input.TextArea placeholder="接口描述" />
|
|
||||||
)}
|
|
||||||
</FormItem>
|
|
||||||
|
|
||||||
<FormItem
|
<FormItem
|
||||||
className="interface-edit-item"
|
className="interface-edit-item"
|
||||||
{...formItemLayout}
|
{...formItemLayout}
|
||||||
@ -606,35 +607,28 @@ class InterfaceEditForm extends Component {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<Row className="interface-edit-item" style={{ display: this.props.form.getFieldValue('res_body_type') === 'json' ? 'block' : 'none' }}>
|
|
||||||
|
|
||||||
<Col span={17} offset={4} >
|
|
||||||
<h3>基于mockjs和json5,可直接写mock模板和注释,具体使用方法请查看文档</h3>
|
<Row className="interface-edit-item" style={{ display: this.props.form.getFieldValue('res_body_type') === 'json' ? 'block' : 'none' }}>
|
||||||
<div id="res_body_json" style={{ minHeight: "300px" }} ></div>
|
<Col span={18} offset={4} >
|
||||||
|
<Tabs defaultActiveKey="tpl" onChange={this.handleJsonType} >
|
||||||
|
<TabPane tab="模板" key="tpl">
|
||||||
|
|
||||||
|
</TabPane>
|
||||||
|
<TabPane tab="预览" key="preview">
|
||||||
|
|
||||||
|
</TabPane>
|
||||||
|
|
||||||
|
</Tabs>
|
||||||
|
<div>
|
||||||
|
<h3 style={{padding: '10px 0'}}>基于mockjs和json5,可直接写mock模板和注释,具体使用方法请查看文档</h3>
|
||||||
|
<div id="res_body_json" style={{ minHeight: "300px", display: this.state.jsonType === 'tpl'? 'block': 'none' }} ></div>
|
||||||
|
<div id="mock-preview" style={{ backgroundColor: "#eee", lineHeight: "20px", minHeight: "300px", display: this.state.jsonType === 'preview'? 'block': 'none' }}></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<FormItem
|
|
||||||
style={{ display: this.props.form.getFieldValue('res_body_type') === 'json' ? 'block' : 'none' }}
|
|
||||||
className="interface-edit-item"
|
|
||||||
{...formItemLayout}
|
|
||||||
label="mock地址"
|
|
||||||
>
|
|
||||||
<Input disabled onChange={() => { }} value={this.state.mockUrl} />
|
|
||||||
</FormItem>
|
|
||||||
|
|
||||||
<FormItem
|
|
||||||
style={{ display: this.props.form.getFieldValue('res_body_type') === 'json' ? 'block' : 'none' }}
|
|
||||||
className="interface-edit-item"
|
|
||||||
{...formItemLayout}
|
|
||||||
label="预览"
|
|
||||||
>
|
|
||||||
<div id="mock-preview" style={{ backgroundColor: "#eee", lineHeight: "20px", minHeight: "300px" }}>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</FormItem>
|
|
||||||
|
|
||||||
|
|
||||||
<Row className="interface-edit-item" style={{ display: this.props.form.getFieldValue('res_body_type') === 'raw' ? 'block' : 'none' }}>
|
<Row className="interface-edit-item" style={{ display: this.props.form.getFieldValue('res_body_type') === 'raw' ? 'block' : 'none' }}>
|
||||||
<Col span={18} offset={4} >
|
<Col span={18} offset={4} >
|
||||||
{getFieldDecorator('res_body', { initialValue: this.state.res_body })(
|
{getFieldDecorator('res_body', { initialValue: this.state.res_body })(
|
||||||
@ -645,12 +639,27 @@ class InterfaceEditForm extends Component {
|
|||||||
|
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
|
|
||||||
|
<FormItem
|
||||||
|
className="interface-edit-item"
|
||||||
|
{...formItemLayout}
|
||||||
|
label="备注"
|
||||||
|
>
|
||||||
|
<div id="desc" ></div>
|
||||||
|
{/* {getFieldDecorator('desc', { initialValue: this.state.desc })(
|
||||||
|
<Input.TextArea style={{minHeight: '200px'}} placeholder="接口备注信息" />
|
||||||
|
)} */}
|
||||||
|
</FormItem>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<FormItem
|
<FormItem
|
||||||
className="interface-edit-item"
|
className="interface-edit-item"
|
||||||
{...formItemLayout}
|
{...formItemLayout}
|
||||||
label="是否开启邮件通知"
|
label="是否开启邮件通知"
|
||||||
>
|
>
|
||||||
{getFieldDecorator('switch_notice', { valuePropName: 'checked', initialValue: false })(
|
{getFieldDecorator('switch_notice', { valuePropName: 'checked', initialValue: true })(
|
||||||
<Switch checkedChildren="开" unCheckedChildren="关" />
|
<Switch checkedChildren="开" unCheckedChildren="关" />
|
||||||
)}
|
)}
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
@ -278,8 +278,8 @@ class View extends Component {
|
|||||||
<span className="colValue">{location.protocol + '//' + location.hostname + (location.port !== "" ? ":" + location.port : "") + `/mock/${this.props.currProject._id}${this.props.currProject.basepath}${this.props.curData.path}`}</span>
|
<span className="colValue">{location.protocol + '//' + location.hostname + (location.port !== "" ? ":" + location.port : "") + `/mock/${this.props.currProject._id}${this.props.currProject.basepath}${this.props.curData.path}`}</span>
|
||||||
</div>
|
</div>
|
||||||
{this.props.curData.desc?<div className="colDesc">
|
{this.props.curData.desc?<div className="colDesc">
|
||||||
<span className="colKey">接口描述:</span>
|
<span className="colKey">接口备注:</span>
|
||||||
<span className="colValue">{this.props.curData.desc}</span>
|
<span className="colValue" dangerouslySetInnerHTML={{__html: this.props.curData.desc}}></span>
|
||||||
</div>:""}
|
</div>:""}
|
||||||
{req_dataSource.length?<div className="colHeader">
|
{req_dataSource.length?<div className="colHeader">
|
||||||
<span className="colKey">路径参数:</span>
|
<span className="colKey">路径参数:</span>
|
||||||
|
131
npm-shrinkwrap.json
generated
131
npm-shrinkwrap.json
generated
@ -240,7 +240,7 @@
|
|||||||
},
|
},
|
||||||
"are-we-there-yet": {
|
"are-we-there-yet": {
|
||||||
"version": "1.1.4",
|
"version": "1.1.4",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz",
|
||||||
"integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=",
|
"integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"delegates": "1.0.0",
|
"delegates": "1.0.0",
|
||||||
@ -428,7 +428,7 @@
|
|||||||
},
|
},
|
||||||
"async-foreach": {
|
"async-foreach": {
|
||||||
"version": "0.1.3",
|
"version": "0.1.3",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/async-foreach/-/async-foreach-0.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz",
|
||||||
"integrity": "sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI="
|
"integrity": "sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI="
|
||||||
},
|
},
|
||||||
"async-validator": {
|
"async-validator": {
|
||||||
@ -1664,7 +1664,7 @@
|
|||||||
},
|
},
|
||||||
"block-stream": {
|
"block-stream": {
|
||||||
"version": "0.0.9",
|
"version": "0.0.9",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/block-stream/-/block-stream-0.0.9.tgz",
|
"resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz",
|
||||||
"integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=",
|
"integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"inherits": "2.0.3"
|
"inherits": "2.0.3"
|
||||||
@ -2168,7 +2168,7 @@
|
|||||||
},
|
},
|
||||||
"cli-source-preview": {
|
"cli-source-preview": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/cli-source-preview/-/cli-source-preview-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/cli-source-preview/-/cli-source-preview-1.1.0.tgz",
|
||||||
"integrity": "sha1-BTA6sSeakJPq0aODez7iMfMAZUQ=",
|
"integrity": "sha1-BTA6sSeakJPq0aODez7iMfMAZUQ=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"chalk": "1.1.3"
|
"chalk": "1.1.3"
|
||||||
@ -2176,7 +2176,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": {
|
"chalk": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/chalk/-/chalk-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
|
||||||
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
|
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"ansi-styles": "2.2.1",
|
"ansi-styles": "2.2.1",
|
||||||
@ -2492,7 +2492,7 @@
|
|||||||
},
|
},
|
||||||
"console-control-strings": {
|
"console-control-strings": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/console-control-strings/-/console-control-strings-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
|
||||||
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
|
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
|
||||||
},
|
},
|
||||||
"consolidate": {
|
"consolidate": {
|
||||||
@ -2707,7 +2707,7 @@
|
|||||||
},
|
},
|
||||||
"cross-spawn": {
|
"cross-spawn": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/cross-spawn/-/cross-spawn-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz",
|
||||||
"integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=",
|
"integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"lru-cache": "4.1.1",
|
"lru-cache": "4.1.1",
|
||||||
@ -4495,7 +4495,7 @@
|
|||||||
},
|
},
|
||||||
"fs-promise": {
|
"fs-promise": {
|
||||||
"version": "0.5.0",
|
"version": "0.5.0",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/fs-promise/-/fs-promise-0.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/fs-promise/-/fs-promise-0.5.0.tgz",
|
||||||
"integrity": "sha1-Q0fWv2JGVacGGkMZITw5MnatPvM=",
|
"integrity": "sha1-Q0fWv2JGVacGGkMZITw5MnatPvM=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"any-promise": "1.3.0",
|
"any-promise": "1.3.0",
|
||||||
@ -4506,7 +4506,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fs-extra": {
|
"fs-extra": {
|
||||||
"version": "0.26.7",
|
"version": "0.26.7",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/fs-extra/-/fs-extra-0.26.7.tgz",
|
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.26.7.tgz",
|
||||||
"integrity": "sha1-muH92UiXeY7at20JGM9C0MMYT6k=",
|
"integrity": "sha1-muH92UiXeY7at20JGM9C0MMYT6k=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"graceful-fs": "4.1.11",
|
"graceful-fs": "4.1.11",
|
||||||
@ -5296,14 +5296,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"string_decoder": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz",
|
|
||||||
"integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=",
|
|
||||||
"requires": {
|
|
||||||
"safe-buffer": "5.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"string-width": {
|
"string-width": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||||
@ -5314,6 +5306,14 @@
|
|||||||
"strip-ansi": "3.0.1"
|
"strip-ansi": "3.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"string_decoder": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.1.tgz",
|
||||||
|
"integrity": "sha1-YuIA8DmVWmgQ2N8KM//A8BNmLZg=",
|
||||||
|
"requires": {
|
||||||
|
"safe-buffer": "5.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"stringstream": {
|
"stringstream": {
|
||||||
"version": "0.0.5",
|
"version": "0.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",
|
||||||
@ -5428,7 +5428,7 @@
|
|||||||
},
|
},
|
||||||
"fstream": {
|
"fstream": {
|
||||||
"version": "1.0.11",
|
"version": "1.0.11",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/fstream/-/fstream-1.0.11.tgz",
|
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz",
|
||||||
"integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=",
|
"integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"graceful-fs": "4.1.11",
|
"graceful-fs": "4.1.11",
|
||||||
@ -5444,7 +5444,7 @@
|
|||||||
},
|
},
|
||||||
"gauge": {
|
"gauge": {
|
||||||
"version": "2.7.4",
|
"version": "2.7.4",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/gauge/-/gauge-2.7.4.tgz",
|
"resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
|
||||||
"integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
|
"integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"aproba": "1.1.2",
|
"aproba": "1.1.2",
|
||||||
@ -6111,7 +6111,7 @@
|
|||||||
},
|
},
|
||||||
"has-unicode": {
|
"has-unicode": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/has-unicode/-/has-unicode-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
|
||||||
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk="
|
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk="
|
||||||
},
|
},
|
||||||
"hash-base": {
|
"hash-base": {
|
||||||
@ -6464,7 +6464,7 @@
|
|||||||
},
|
},
|
||||||
"in-publish": {
|
"in-publish": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/in-publish/-/in-publish-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz",
|
||||||
"integrity": "sha1-4g/146KvwmkDILbcVSaCqcf631E="
|
"integrity": "sha1-4g/146KvwmkDILbcVSaCqcf631E="
|
||||||
},
|
},
|
||||||
"indent-string": {
|
"indent-string": {
|
||||||
@ -8190,7 +8190,7 @@
|
|||||||
},
|
},
|
||||||
"lodash.clonedeep": {
|
"lodash.clonedeep": {
|
||||||
"version": "4.5.0",
|
"version": "4.5.0",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
|
||||||
"integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8="
|
"integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8="
|
||||||
},
|
},
|
||||||
"lodash.cond": {
|
"lodash.cond": {
|
||||||
@ -8312,7 +8312,7 @@
|
|||||||
},
|
},
|
||||||
"lodash.mergewith": {
|
"lodash.mergewith": {
|
||||||
"version": "4.6.0",
|
"version": "4.6.0",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/lodash.mergewith/-/lodash.mergewith-4.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.0.tgz",
|
||||||
"integrity": "sha1-FQzwoWeR9ZA7iJHqsVRgknS96lU="
|
"integrity": "sha1-FQzwoWeR9ZA7iJHqsVRgknS96lU="
|
||||||
},
|
},
|
||||||
"lodash.once": {
|
"lodash.once": {
|
||||||
@ -8948,7 +8948,7 @@
|
|||||||
},
|
},
|
||||||
"node-gyp": {
|
"node-gyp": {
|
||||||
"version": "3.6.2",
|
"version": "3.6.2",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/node-gyp/-/node-gyp-3.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.6.2.tgz",
|
||||||
"integrity": "sha1-m/vlRWIoYoSDjnUOrAUpWFP6HGA=",
|
"integrity": "sha1-m/vlRWIoYoSDjnUOrAUpWFP6HGA=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"fstream": "1.0.11",
|
"fstream": "1.0.11",
|
||||||
@ -8968,7 +8968,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"semver": {
|
"semver": {
|
||||||
"version": "5.3.0",
|
"version": "5.3.0",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/semver/-/semver-5.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
|
||||||
"integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8="
|
"integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9028,7 +9028,7 @@
|
|||||||
},
|
},
|
||||||
"node-sass-china": {
|
"node-sass-china": {
|
||||||
"version": "4.5.0",
|
"version": "4.5.0",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/node-sass-china/-/node-sass-china-4.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/node-sass-china/-/node-sass-china-4.5.0.tgz",
|
||||||
"integrity": "sha1-YnbBcNzqWBz14lwC/sqjUPcyx1Q=",
|
"integrity": "sha1-YnbBcNzqWBz14lwC/sqjUPcyx1Q=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"async-foreach": "0.1.3",
|
"async-foreach": "0.1.3",
|
||||||
@ -9053,7 +9053,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": {
|
"chalk": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/chalk/-/chalk-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
|
||||||
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
|
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"ansi-styles": "2.2.1",
|
"ansi-styles": "2.2.1",
|
||||||
@ -9065,7 +9065,7 @@
|
|||||||
},
|
},
|
||||||
"gaze": {
|
"gaze": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/gaze/-/gaze-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.2.tgz",
|
||||||
"integrity": "sha1-hHIkZ3rbiHDWeSV+0ziP22HkAQU=",
|
"integrity": "sha1-hHIkZ3rbiHDWeSV+0ziP22HkAQU=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"globule": "1.2.0"
|
"globule": "1.2.0"
|
||||||
@ -9073,7 +9073,7 @@
|
|||||||
},
|
},
|
||||||
"globule": {
|
"globule": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/globule/-/globule-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/globule/-/globule-1.2.0.tgz",
|
||||||
"integrity": "sha1-HcScaCLdnoovoAuiopUAboZkvQk=",
|
"integrity": "sha1-HcScaCLdnoovoAuiopUAboZkvQk=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"glob": "7.1.2",
|
"glob": "7.1.2",
|
||||||
@ -9083,7 +9083,7 @@
|
|||||||
},
|
},
|
||||||
"lodash.assign": {
|
"lodash.assign": {
|
||||||
"version": "4.2.0",
|
"version": "4.2.0",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/lodash.assign/-/lodash.assign-4.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz",
|
||||||
"integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc="
|
"integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9240,7 +9240,7 @@
|
|||||||
},
|
},
|
||||||
"nopt": {
|
"nopt": {
|
||||||
"version": "3.0.6",
|
"version": "3.0.6",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/nopt/-/nopt-3.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
|
||||||
"integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=",
|
"integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"abbrev": "1.1.0"
|
"abbrev": "1.1.0"
|
||||||
@ -12588,22 +12588,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"require_optional": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/require_optional/-/require_optional-1.0.1.tgz",
|
|
||||||
"integrity": "sha1-TPNaQkf2TKPfjC7yCMxJSxyo/C4=",
|
|
||||||
"requires": {
|
|
||||||
"resolve-from": "2.0.0",
|
|
||||||
"semver": "5.4.1"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"resolve-from": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/resolve-from/-/resolve-from-2.0.0.tgz",
|
|
||||||
"integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"require-directory": {
|
"require-directory": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/require-directory/-/require-directory-2.1.1.tgz",
|
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/require-directory/-/require-directory-2.1.1.tgz",
|
||||||
@ -12628,6 +12612,22 @@
|
|||||||
"resolve-from": "1.0.1"
|
"resolve-from": "1.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"require_optional": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/require_optional/-/require_optional-1.0.1.tgz",
|
||||||
|
"integrity": "sha1-TPNaQkf2TKPfjC7yCMxJSxyo/C4=",
|
||||||
|
"requires": {
|
||||||
|
"resolve-from": "2.0.0",
|
||||||
|
"semver": "5.4.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"resolve-from": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/resolve-from/-/resolve-from-2.0.0.tgz",
|
||||||
|
"integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"requires-port": {
|
"requires-port": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/requires-port/-/requires-port-1.0.0.tgz",
|
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/requires-port/-/requires-port-1.0.0.tgz",
|
||||||
@ -12785,7 +12785,7 @@
|
|||||||
},
|
},
|
||||||
"sass-graph": {
|
"sass-graph": {
|
||||||
"version": "2.2.4",
|
"version": "2.2.4",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/sass-graph/-/sass-graph-2.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz",
|
||||||
"integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=",
|
"integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"glob": "7.1.2",
|
"glob": "7.1.2",
|
||||||
@ -12827,7 +12827,7 @@
|
|||||||
},
|
},
|
||||||
"scss-tokenizer": {
|
"scss-tokenizer": {
|
||||||
"version": "0.2.3",
|
"version": "0.2.3",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz",
|
||||||
"integrity": "sha1-jrBtualyMzOCTT9VMGQRSYR85dE=",
|
"integrity": "sha1-jrBtualyMzOCTT9VMGQRSYR85dE=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"js-base64": "2.1.9",
|
"js-base64": "2.1.9",
|
||||||
@ -12836,7 +12836,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"source-map": {
|
"source-map": {
|
||||||
"version": "0.4.4",
|
"version": "0.4.4",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/source-map/-/source-map-0.4.4.tgz",
|
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
|
||||||
"integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
|
"integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"amdefine": "1.0.1"
|
"amdefine": "1.0.1"
|
||||||
@ -13244,7 +13244,7 @@
|
|||||||
},
|
},
|
||||||
"stdout-stream": {
|
"stdout-stream": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/stdout-stream/-/stdout-stream-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.0.tgz",
|
||||||
"integrity": "sha1-osfIWH5U2UJ+qe2zrD8s1SLfN4s=",
|
"integrity": "sha1-osfIWH5U2UJ+qe2zrD8s1SLfN4s=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"readable-stream": "2.3.3"
|
"readable-stream": "2.3.3"
|
||||||
@ -13301,14 +13301,6 @@
|
|||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
|
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz",
|
||||||
"integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM="
|
"integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM="
|
||||||
},
|
},
|
||||||
"string_decoder": {
|
|
||||||
"version": "1.0.3",
|
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/string_decoder/-/string_decoder-1.0.3.tgz",
|
|
||||||
"integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=",
|
|
||||||
"requires": {
|
|
||||||
"safe-buffer": "5.1.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"string-convert": {
|
"string-convert": {
|
||||||
"version": "0.2.1",
|
"version": "0.2.1",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/string-convert/-/string-convert-0.2.1.tgz",
|
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/string-convert/-/string-convert-0.2.1.tgz",
|
||||||
@ -13395,6 +13387,14 @@
|
|||||||
"strip-ansi": "3.0.1"
|
"strip-ansi": "3.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"string_decoder": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/string_decoder/-/string_decoder-1.0.3.tgz",
|
||||||
|
"integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=",
|
||||||
|
"requires": {
|
||||||
|
"safe-buffer": "5.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"stringstream": {
|
"stringstream": {
|
||||||
"version": "0.0.5",
|
"version": "0.0.5",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/stringstream/-/stringstream-0.0.5.tgz",
|
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/stringstream/-/stringstream-0.0.5.tgz",
|
||||||
@ -13651,7 +13651,7 @@
|
|||||||
},
|
},
|
||||||
"tar": {
|
"tar": {
|
||||||
"version": "2.2.1",
|
"version": "2.2.1",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/tar/-/tar-2.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz",
|
||||||
"integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=",
|
"integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"block-stream": "0.0.9",
|
"block-stream": "0.0.9",
|
||||||
@ -14436,6 +14436,11 @@
|
|||||||
"makeerror": "1.0.11"
|
"makeerror": "1.0.11"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"wangeditor": {
|
||||||
|
"version": "3.0.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/wangeditor/-/wangeditor-3.0.8.tgz",
|
||||||
|
"integrity": "sha1-qm5FetXmDiFbwuYE7uIB2TFdAXY="
|
||||||
|
},
|
||||||
"warning": {
|
"warning": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/warning/-/warning-3.0.0.tgz",
|
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/warning/-/warning-3.0.0.tgz",
|
||||||
@ -14674,7 +14679,7 @@
|
|||||||
},
|
},
|
||||||
"webpack-dev-middleware": {
|
"webpack-dev-middleware": {
|
||||||
"version": "1.12.0",
|
"version": "1.12.0",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/webpack-dev-middleware/-/webpack-dev-middleware-1.12.0.tgz",
|
"resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-1.12.0.tgz",
|
||||||
"integrity": "sha1-007++y7dp+HTtdvgcolRMhllFwk=",
|
"integrity": "sha1-007++y7dp+HTtdvgcolRMhllFwk=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"memory-fs": "0.4.1",
|
"memory-fs": "0.4.1",
|
||||||
@ -14686,7 +14691,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"time-stamp": {
|
"time-stamp": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/time-stamp/-/time-stamp-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-2.0.0.tgz",
|
||||||
"integrity": "sha1-lcakRTDhW6jW9KPsuMOj+sRto1c="
|
"integrity": "sha1-lcakRTDhW6jW9KPsuMOj+sRto1c="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -15210,7 +15215,7 @@
|
|||||||
},
|
},
|
||||||
"ykit-config-antd": {
|
"ykit-config-antd": {
|
||||||
"version": "0.1.3",
|
"version": "0.1.3",
|
||||||
"resolved": "https://repo.corp.qunar.com/artifactory/api/npm/npm-qunar/ykit-config-antd/-/ykit-config-antd-0.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/ykit-config-antd/-/ykit-config-antd-0.1.3.tgz",
|
||||||
"integrity": "sha1-qUWmV0EHgAd0OrPgz3eBbD9KPN4=",
|
"integrity": "sha1-qUWmV0EHgAd0OrPgz3eBbD9KPN4=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"antd": "2.12.8",
|
"antd": "2.12.8",
|
||||||
|
@ -93,6 +93,7 @@
|
|||||||
"universal-cookie": "^2.0.8",
|
"universal-cookie": "^2.0.8",
|
||||||
"url": "^0.11.0",
|
"url": "^0.11.0",
|
||||||
"validate-commit-msg": "^2.12.2",
|
"validate-commit-msg": "^2.12.2",
|
||||||
|
"wangeditor": "^3.0.8",
|
||||||
"webpack": "^3.5.5",
|
"webpack": "^3.5.5",
|
||||||
"webpack-dev-middleware": "^1.12.0",
|
"webpack-dev-middleware": "^1.12.0",
|
||||||
"ykit-config-antd": "^0.1.3",
|
"ykit-config-antd": "^0.1.3",
|
||||||
|
@ -191,13 +191,19 @@ class interfaceController extends baseController {
|
|||||||
*/
|
*/
|
||||||
async get(ctx) {
|
async get(ctx) {
|
||||||
let params = ctx.request.query;
|
let params = ctx.request.query;
|
||||||
|
|
||||||
if (!params.id) {
|
if (!params.id) {
|
||||||
return ctx.body = yapi.commons.resReturn(null, 400, '接口id不能为空');
|
return ctx.body = yapi.commons.resReturn(null, 400, '接口id不能为空');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let result = await this.Model.get(params.id);
|
let result = await this.Model.get(params.id);
|
||||||
|
let project = await this.projectModel.getBaseInfo(result.project_id);
|
||||||
|
if (project.project_type === 'private') {
|
||||||
|
if (await this.checkAuth(project._id, 'project', 'edit') !== true) {
|
||||||
|
return ctx.body = yapi.commons.resReturn(null, 406, '没有权限');
|
||||||
|
}
|
||||||
|
}
|
||||||
ctx.body = yapi.commons.resReturn(result);
|
ctx.body = yapi.commons.resReturn(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
ctx.body = yapi.commons.resReturn(null, 402, e.message);
|
ctx.body = yapi.commons.resReturn(null, 402, e.message);
|
||||||
@ -216,7 +222,12 @@ class interfaceController extends baseController {
|
|||||||
*/
|
*/
|
||||||
async list(ctx) {
|
async list(ctx) {
|
||||||
let project_id = ctx.request.query.project_id;
|
let project_id = ctx.request.query.project_id;
|
||||||
|
let project = await this.projectModel.getBaseInfo(project_id);
|
||||||
|
if (project.project_type === 'private') {
|
||||||
|
if (await this.checkAuth(project._id, 'project', 'edit') !== true) {
|
||||||
|
return ctx.body = yapi.commons.resReturn(null, 406, '没有权限');
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!project_id) {
|
if (!project_id) {
|
||||||
return ctx.body = yapi.commons.resReturn(null, 400, '项目id不能为空');
|
return ctx.body = yapi.commons.resReturn(null, 400, '项目id不能为空');
|
||||||
}
|
}
|
||||||
@ -235,7 +246,15 @@ class interfaceController extends baseController {
|
|||||||
return ctx.body = yapi.commons.resReturn(null, 400, 'catid不能为空');
|
return ctx.body = yapi.commons.resReturn(null, 400, 'catid不能为空');
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
let catdata = await this.catModel.get(catid);
|
||||||
|
let project = await this.projectModel.getBaseInfo(catdata.project_id);
|
||||||
|
if (project.project_type === 'private') {
|
||||||
|
if (await this.checkAuth(project._id, 'project', 'edit') !== true) {
|
||||||
|
return ctx.body = yapi.commons.resReturn(null, 406, '没有权限');
|
||||||
|
}
|
||||||
|
}
|
||||||
let result = await this.Model.listByCatid(catid)
|
let result = await this.Model.listByCatid(catid)
|
||||||
|
|
||||||
ctx.body = yapi.commons.resReturn(result);
|
ctx.body = yapi.commons.resReturn(result);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
ctx.body = yapi.commons.resReturn(null, 402, err.message);
|
ctx.body = yapi.commons.resReturn(null, 402, err.message);
|
||||||
@ -248,6 +267,14 @@ class interfaceController extends baseController {
|
|||||||
if (!project_id) {
|
if (!project_id) {
|
||||||
return ctx.body = yapi.commons.resReturn(null, 400, '项目id不能为空');
|
return ctx.body = yapi.commons.resReturn(null, 400, '项目id不能为空');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let project = await this.projectModel.getBaseInfo(project_id);
|
||||||
|
if (project.project_type === 'private') {
|
||||||
|
if (await this.checkAuth(project._id, 'project', 'edit') !== true) {
|
||||||
|
return ctx.body = yapi.commons.resReturn(null, 406, '没有权限');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let result = await this.catModel.list(project_id), newResult = [];
|
let result = await this.catModel.list(project_id), newResult = [];
|
||||||
for (let i = 0, item, list; i < result.length; i++) {
|
for (let i = 0, item, list; i < result.length; i++) {
|
||||||
@ -642,6 +669,12 @@ class interfaceController extends baseController {
|
|||||||
if (!project_id) {
|
if (!project_id) {
|
||||||
return ctx.body = yapi.commons.resReturn(null, 400, '项目id不能为空');
|
return ctx.body = yapi.commons.resReturn(null, 400, '项目id不能为空');
|
||||||
}
|
}
|
||||||
|
let project = await this.projectModel.getBaseInfo(project_id);
|
||||||
|
if (project.project_type === 'private') {
|
||||||
|
if (await this.checkAuth(project._id, 'project', 'edit') !== true) {
|
||||||
|
return ctx.body = yapi.commons.resReturn(null, 406, '没有权限');
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
let res = await this.catModel.list(project_id);
|
let res = await this.catModel.list(project_id);
|
||||||
return ctx.body = yapi.commons.resReturn(res);
|
return ctx.body = yapi.commons.resReturn(res);
|
||||||
|
@ -27,6 +27,12 @@ class interfaceColController extends baseController{
|
|||||||
async list(ctx){
|
async list(ctx){
|
||||||
try {
|
try {
|
||||||
let id = ctx.query.project_id;
|
let id = ctx.query.project_id;
|
||||||
|
let project = await this.projectModel.getBaseInfo(id);
|
||||||
|
if (project.project_type === 'private') {
|
||||||
|
if (await this.checkAuth(project._id, 'project', 'edit') !== true) {
|
||||||
|
return ctx.body = yapi.commons.resReturn(null, 406, '没有权限');
|
||||||
|
}
|
||||||
|
}
|
||||||
let result = await this.colModel.list(id);
|
let result = await this.colModel.list(id);
|
||||||
|
|
||||||
for(let i=0; i< result.length;i++){
|
for(let i=0; i< result.length;i++){
|
||||||
@ -110,8 +116,19 @@ class interfaceColController extends baseController{
|
|||||||
async getCaseList(ctx){
|
async getCaseList(ctx){
|
||||||
try {
|
try {
|
||||||
let id = ctx.query.col_id;
|
let id = ctx.query.col_id;
|
||||||
let inst = yapi.getInst(interfaceCaseModel);
|
if(!id || id == 0){
|
||||||
let result = await inst.list(id, 'all');
|
return ctx.body = yapi.commons.resReturn(null, 407, 'col_id不能为空')
|
||||||
|
}
|
||||||
|
let result = await this.caseModel.list(id, 'all');
|
||||||
|
let colData = await this.colModel.get(id);
|
||||||
|
let project = await this.projectModel.getBaseInfo(colData.project_id);
|
||||||
|
|
||||||
|
if (project.project_type === 'private') {
|
||||||
|
if (await this.checkAuth(project._id, 'project', 'edit') !== true) {
|
||||||
|
return ctx.body = yapi.commons.resReturn(null, 406, '没有权限');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for(let index=0; index< result.length; index++){
|
for(let index=0; index< result.length; index++){
|
||||||
|
|
||||||
result[index] = result[index].toObject();
|
result[index] = result[index].toObject();
|
||||||
|
@ -308,6 +308,11 @@ class projectController extends baseController {
|
|||||||
if (!result) {
|
if (!result) {
|
||||||
return ctx.body = yapi.commons.resReturn(null, 400, '不存在的项目');
|
return ctx.body = yapi.commons.resReturn(null, 400, '不存在的项目');
|
||||||
}
|
}
|
||||||
|
if (result.project_type === 'private') {
|
||||||
|
if (await this.checkAuth(result._id, 'project', 'edit') !== true) {
|
||||||
|
return ctx.body = yapi.commons.resReturn(null, 406, '没有权限');
|
||||||
|
}
|
||||||
|
}
|
||||||
result = result.toObject();
|
result = result.toObject();
|
||||||
let catInst = yapi.getInst(interfaceCatModel);
|
let catInst = yapi.getInst(interfaceCatModel);
|
||||||
let cat = await catInst.list(params.id);
|
let cat = await catInst.list(params.id);
|
||||||
|
Loading…
Reference in New Issue
Block a user