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

This commit is contained in:
waliang.wang 2017-07-31 19:43:12 +08:00
commit f9f32f90c0
15 changed files with 59 additions and 105 deletions

View File

@ -20,7 +20,6 @@ export default class BreadcrumbNavigation extends Component {
}
getBreadcrumb = (pathSnippets) => {
console.log(pathSnippets);
// 重置 state 中的 breadcrumb防止重复渲染
this.setState({
breadcrumb: []
@ -76,12 +75,9 @@ export default class BreadcrumbNavigation extends Component {
path: '/' + pathSnippets.join('/')
}]
});
} else {
console.log(2);
}
}
componentDidMount() {
console.log(location.hash);
const pathSnippets = location.hash.split('#')[1].split('/').filter(i => i);
this.getBreadcrumb(pathSnippets);
this.setState({

View File

@ -1,6 +1,8 @@
@import '../../styles/mixin.scss';
.add-interface-box {
@include row-width-limit;
margin: 0 auto;
-webkit-box-flex: 1;
min-height: 5rem;
font-size: .14rem;
@ -9,14 +11,12 @@
font-size: .12rem;
.content {
max-width: 11.7rem;
min-width: 11.7rem;
border-radius: 4px;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
background: #FFF;
padding: 10px 20px 0 20px;
margin: 0 auto;
.ant-tabs {
padding: 0 0 50px 0;
}
@ -24,7 +24,7 @@
.ant-tabs-content {
padding: 0 0 50px 0;
}
.border {
zoom: 1;
overflow: hidden;

View File

@ -7,7 +7,7 @@
/* .interface-box.css */
.interface-box {
@include row-width-limit;
margin: 24px auto;
margin: 0 auto .24rem;
border-radius: 4px;
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.20);
background: #FFF;
@ -62,4 +62,3 @@
body .interface-mode-box .add-user .ant-input {
width: 100%;
}

View File

@ -2,5 +2,5 @@
.g-doc {
@include row-width-limit;
margin: .24rem auto;
margin: 0 auto .24rem;
}

View File

@ -21,8 +21,7 @@ const deleteConfirm = (id, props) => {
delProject(id).then((res) => {
if (res.payload.data.errcode == 0) {
message.success('删除成功!')
fetchProjectList(currGroup._id).then((res) => {
console.log(res);
fetchProjectList(currGroup._id).then(() => {
});
} else {
message.error(res.payload.data.errmsg);
@ -155,7 +154,6 @@ class ProjectList extends Component {
changeTableLoading(true);
addProject(values).then((res) => {
console.log(res);
// 添加项目成功后再次请求列表
if (res.payload.data.errcode == 0) {
that.setState({
@ -163,16 +161,14 @@ class ProjectList extends Component {
});
form.resetFields();
message.success('创建成功! ');
fetchProjectList(currGroup._id, this.props.currPage).then((res) => {
fetchProjectList(currGroup._id, this.props.currPage).then(() => {
changeTableLoading(false);
console.log(131,res);
});
} else {
changeTableLoading(false);
message.error(res.payload.data.errmsg);
}
}).catch((err) => {
console.log(err);
}).catch(() => {
changeTableLoading(false);
});
}

View File

@ -81,17 +81,14 @@ class UpDateModal extends Component {
// 确认修改
handleOk = (e) => {
console.log('in');
e.preventDefault();
const { form, updateProject, changeUpdateModal, currGroup, projectList, handleUpdateIndex, fetchProjectList, changeTableLoading } = this.props;
form.validateFields((err, values) => {
console.log(values);
if (!err) {
// console.log(projectList[handleUpdateIndex]);
let assignValue = Object.assign(projectList[handleUpdateIndex], values);
values.protocol = this.state.protocol.split(':')[0];
assignValue.env = assignValue.envs.map((item, index) => {
console.log(values['envs-protocol-'+index]);
return {
name: values['envs-name-'+index],
domain: values['envs-protocol-'+index] + values['envs-domain-'+index]
@ -104,16 +101,14 @@ class UpDateModal extends Component {
if (res.payload.data.errcode == 0) {
changeUpdateModal(false, -1);
message.success('修改成功! ');
fetchProjectList(currGroup._id).then((res) => {
console.log(res);
fetchProjectList(currGroup._id).then(() => {
changeTableLoading(false);
});
} else {
changeTableLoading(false);
message.error(res.payload.data.errmsg);
}
}).catch((err) => {
console.log(err);
}).catch(() => {
changeTableLoading(false);
});
form.resetFields();
@ -121,13 +116,6 @@ class UpDateModal extends Component {
});
}
envProtocolChange = (value) => {
console.log(value);
// this.setState({
// envProtocolChange: value
// })
}
// 项目的修改操作 - 删除一项环境配置
remove = (id) => {
const { form } = this.props;
@ -142,7 +130,6 @@ class UpDateModal extends Component {
form.setFieldsValue({
envs: envs.filter(key => {
const realKey = key._id ? key._id : key
console.log(key);
return realKey !== id;
})
});
@ -184,7 +171,6 @@ class UpDateModal extends Component {
getFieldDecorator('envs', { initialValue: envMessage });
const envs = getFieldValue('envs');
const formItems = envs.map((k, index) => {
console.log(k);
const secondIndex = 'next' + index; // 为保证key的唯一性
return (
<Row key={index} type="flex" justify="space-between" align={index === 0 ? 'middle' : 'top'}>

View File

@ -1,29 +1,21 @@
@import '../../styles/mixin.scss';
.g-doc {
margin: .24rem auto;
margin: 0 auto .24rem;
}
/* .user-box.css */
.user-box {
@include row-width-limit;
padding: 0;
display: -webkit-box;
-webkit-box-flex: 1;
margin: .88rem auto 0 auto;
// font-size: 0.14rem;
margin-top: 40px;
margin-bottom: 55px;
margin: 0 auto;
.user-list {
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.20);
background: #FFF;
border-radius:4px;
min-height: 5rem;
margin-top: 15px;
.search{
padding: 5px;
background-color: #eee;
@ -54,7 +46,6 @@
border-radius: 4px;
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.20);
background: #FFF;
margin-top: 15px;
min-height: 5rem;
.ant-table-wrapper table {
// font-size: .14rem;
@ -68,7 +59,6 @@
.user-profile {
-webkit-box-flex: 1;
margin-top: 15px;
padding: 24px;
box-shadow: 0 2px 4px 0 rgba(0,0,0,0.20);
background: #FFF;

View File

@ -1,8 +1,9 @@
@mixin row-width-limit {
max-width: 11.7rem;
min-width: 9.7rem;
max-width: 12.2rem;
min-width: 10.2rem;
padding: 0 .24rem;
}
@mixin wrap-width-limit {
min-width: 9.7rem;
min-width: 10.2rem;
}

View File

@ -318,7 +318,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
@ -355,7 +355,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>
@ -453,7 +453,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
@ -549,7 +549,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
@ -637,7 +637,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"logout success..."</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
@ -676,7 +676,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token string">"ok"</span>
@ -767,7 +767,7 @@
<div>示例:</div>
<pre class="ydoc-example" ><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" ><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
@ -863,7 +863,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"logout success..."</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
@ -1224,7 +1224,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"ok"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>
@ -1314,7 +1314,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
@ -1451,7 +1451,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
@ -1546,7 +1546,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
@ -1630,7 +1630,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
@ -1702,7 +1702,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>
@ -1780,7 +1780,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
@ -1883,7 +1883,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
@ -2110,7 +2110,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
@ -2258,7 +2258,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code">
<pre class="ydoc-example" data-foldnumber=10><code>
<span class="token comment" spellcheck="true">//请求示例</span>
<span class="token punctuation">{</span>
<span class="token string">"id"</span><span class="token punctuation">:</span> <span class="token number">8</span><span class="token punctuation">,</span>
@ -2342,7 +2342,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"ok"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
@ -2616,7 +2616,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code">
<pre class="ydoc-example" data-foldnumber=10><code>
<span class="token comment" spellcheck="true">//请求 /interface/add</span>
<span class="token comment" spellcheck="true">//header Content-Type:application/json</span>
@ -2751,7 +2751,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">.</span><span class="token operator">/</span>api<span class="token operator">/</span><span class="token keyword">interface</span><span class="token operator">/</span><span class="token keyword">get</span><span class="token punctuation">.</span>json</code></pre>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">.</span><span class="token operator">/</span>api<span class="token operator">/</span><span class="token keyword">interface</span><span class="token operator">/</span><span class="token keyword">get</span><span class="token punctuation">.</span>json</code></pre>
</div>
@ -2816,7 +2816,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">.</span><span class="token operator">/</span>api<span class="token operator">/</span><span class="token keyword">interface</span><span class="token operator">/</span>list<span class="token punctuation">.</span>json</code></pre>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">.</span><span class="token operator">/</span>api<span class="token operator">/</span><span class="token keyword">interface</span><span class="token operator">/</span>list<span class="token punctuation">.</span>json</code></pre>
</div>
@ -3041,7 +3041,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
@ -3114,7 +3114,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
@ -3209,7 +3209,7 @@
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code class="js-code"><span class="token punctuation">{</span>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>

View File

@ -68,23 +68,23 @@
<div class="ydoc-container-content " id="readme">
<article class="markdown-body">
<h2 class="subject" id="快速开始">快速开始 <a class="hashlink" href="#快速开始">#</a></h2><h3 class="subject" id="1_接口管理架构">1 接口管理架构 <a class="hashlink" href="#1_接口管理架构">#</a></h3><p>平台以<strong>项目分组</strong> -&gt; <strong>项目</strong> -&gt; <strong>接口</strong>的划分进行接口组织管理。</p>
<h2 class="subject" id="快速开始">快速开始 <a class="hashlink" href="#快速开始">#</a></h2><h3 class="subject" id="1 接口管理架构">1 接口管理架构 <a class="hashlink" href="#1 接口管理架构">#</a></h3><p>平台以<strong>项目分组</strong> -&gt; <strong>项目</strong> -&gt; <strong>接口</strong>的划分进行接口组织管理。</p>
<p><img src="http://upload-images.jianshu.io/upload_images/842107-305ba49a60ee1ff5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center /></p>
<h4 class="subject" id="1.1_项目分组">1.1 项目分组 <a class="hashlink" href="#1.1_项目分组">#</a></h4><p>登录之后进到项目首页,左边侧边栏显示的即分组列表。</p>
<h4 class="subject" id="1.1 项目分组">1.1 项目分组 <a class="hashlink" href="#1.1 项目分组">#</a></h4><p>登录之后进到项目首页,左边侧边栏显示的即分组列表。</p>
<p><img src="http://upload-images.jianshu.io/upload_images/842107-d90ca4b3242fa760.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "200" style="margin-left:170px;display:block;" alt="图片名称" align=center /></p>
<p>管理员有权限添加或删除分组。</p>
<p><img src="http://upload-images.jianshu.io/upload_images/842107-a0d4d9a98003896a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "500" style="margin-left:170px;display:block;" alt="图片名称" align=center /></p>
<blockquote>
<p>分组名称具有唯一性</p>
</blockquote>
<h4 class="subject" id="1.2_项目">1.2 项目 <a class="hashlink" href="#1.2_项目">#</a></h4><p>选中不同的分组,右边会显示该分组下的项目列表。</p>
<h4 class="subject" id="1.2 项目">1.2 项目 <a class="hashlink" href="#1.2 项目">#</a></h4><p>选中不同的分组,右边会显示该分组下的项目列表。</p>
<p><img src="http://upload-images.jianshu.io/upload_images/842107-137bcae58b84715e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center /></p>
<p>创建项目需要填写项目名称,项目线上域名(添加完成后可配置项目其他环境域名),项目接口基本路径(接口路径前面相同的部分)以及项目描述。</p>
<p><img src="http://upload-images.jianshu.io/upload_images/842107-360a50ddb746f73d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center /></p>
<blockquote>
<p>项目『线上域名 + 基本路径』具有唯一性</p>
</blockquote>
<h4 class="subject" id="1.3_接口">1.3 接口 <a class="hashlink" href="#1.3_接口">#</a></h4><p>点击项目名称,进入该项目接口列表。</p>
<h4 class="subject" id="1.3 接口">1.3 接口 <a class="hashlink" href="#1.3 接口">#</a></h4><p>点击项目名称,进入该项目接口列表。</p>
<p><img src="http://upload-images.jianshu.io/upload_images/842107-e858005f714f4889.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center /></p>
<p>点击编辑,进入接口详情页(之后接口详情页和编辑也会分开),可以编辑接口或者请求测试真实接口。</p>
<p><img src="http://upload-images.jianshu.io/upload_images/842107-78c0ea839619d068.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center /></p>

View File

@ -70,15 +70,15 @@
<article class="markdown-body">
<h3 class="subject" id="Mock功能">Mock功能 <a class="hashlink" href="#Mock功能">#</a></h3> <p style='text-indent:2em;line-height:1.8em'>yapi的Mock功能可以根据用户的输入接口信息如协议、URL、接口名、请求头、请求参数、mock规则生成Mock接口这些接口会自动生成模拟数据支持复杂的生成逻辑创建者可以自由构造需要的数据。而且与常见的Mock方式如将Mock写在代码里和JS拦截等相比yapi的Mock在使用场景和效率和复杂度上是相差甚远的正是由于yapi的Mock是一个第三方平台那么在 团队开发时任何人都可以权限许可下创建、修改接口信息等操作,这对于团队开发是很有好处的。</p>
<h4 class="subject" id="1_添加接口">1 添加接口 <a class="hashlink" href="#1_添加接口">#</a></h4><p>通过点击页面上的&quot;+添加接口&quot;</p>
<h4 class="subject" id="1 添加接口">1 添加接口 <a class="hashlink" href="#1 添加接口">#</a></h4><p>通过点击页面上的&quot;+添加接口&quot;</p>
<p><img src="http://note.youdao.com/yws/api/personal/file/WEB613bd4f29db038f2b41c03dcfceda2b6?method=download&shareKey=29bfc2b855f6f26ce0079baf567e54cc" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center /></p>
<p> 输入协议、URL、接口名、请求头、请求参数、mock规则等信息然后点击右上角的&quot;Mock&quot;按钮。</p>
<p><img src="http://upload-images.jianshu.io/upload_images/842107-78c0ea839619d068.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center /></p>
<h4 class="subject" id="2_Mock">2 Mock <a class="hashlink" href="#2_Mock">#</a></h4><p>当点击&quot;Mock&quot;按钮之后就会在页面下方生成一个mock结果并产生一个API接口。点击&quot;复制&quot;按钮即可复制,用户拿到接口后就可以发请求了。</p>
<h4 class="subject" id="2 Mock">2 Mock <a class="hashlink" href="#2 Mock">#</a></h4><p>当点击&quot;Mock&quot;按钮之后就会在页面下方生成一个mock结果并产生一个API接口。点击&quot;复制&quot;按钮即可复制,用户拿到接口后就可以发请求了。</p>
<p><img src="http://note.youdao.com/yws/api/personal/file/WEBf9b154cb88d21daa8206e8c4a3d76042?method=download&shareKey=1999f6c2cf197b5b6d775c312e34073d" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center /></p>
<p>将请求的信息填写完善如请求方法post、get等、URL、请求头、请求的数据等。然后就点击&quot;发送&quot;,然后在&quot;返回结果&quot;出可以看到接口返回的数据。</p>
<p><img src="http://upload-images.jianshu.io/upload_images/842107-2ee7171d707e91ff.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center /></p>
<h4 class="subject" id="3_成员管理">3 成员管理 <a class="hashlink" href="#3_成员管理">#</a></h4><p>你也可以通过点击&quot;管理成员&quot;来添加和删除项目的成员,便于团队管理。</p>
<h4 class="subject" id="3 成员管理">3 成员管理 <a class="hashlink" href="#3 成员管理">#</a></h4><p>你也可以通过点击&quot;管理成员&quot;来添加和删除项目的成员,便于团队管理。</p>
<p><img src="http://note.youdao.com/yws/api/personal/file/WEB1b9defdf0cb884f46c2bd6c30ceb02fb?method=download&shareKey=218b9326659208ec564b9fff3ea8c6c3" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center /></p>
<h2 class="subject" id="未来计划推出功能">未来计划推出功能 <a class="hashlink" href="#未来计划推出功能">#</a></h2><ol>
<li>可视化JSON编辑器可定义JSON_Schema和mockjs</li><li>支持HTTP和RPC协议</li><li>自动化测试</li><li>多人协作</li></ol>

View File

@ -129,8 +129,7 @@ $(document).ready(function() {
});
$('.markdown-body pre').map(function(i, item) {
$(item).addClass('ydoc-example').append('<div class="ui-copy js-copy" data-clipboard-action="copy" data-clipboard-target=".js-code-' + i + '" data-copy-number="' + i + '">copy</div><div class="copy-tip copy-tip-' + i + '">已复制</div>');
$(item).children('code').addClass('js-code-'+i);
$(item).addClass('ydoc-example');
});
var winHeight = $(window).height() - 44,
@ -214,17 +213,4 @@ $(document).ready(function() {
return false;
}
}
// 代码复制功能
var clipboard = new Clipboard('.js-copy');
clipboard.on('success', function(e) {
var copyNumber = $(e.trigger).attr('data-copy-number');
$('.copy-tip-'+copyNumber).show();
setTimeout(function() {
$('.copy-tip-'+copyNumber).hide();
}, 1000);
e.clearSelection();
});
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long