mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-24 13:14:16 +08:00
Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev
This commit is contained in:
commit
8d89a869a1
BIN
doc/images/usage/api_res.png
Normal file
BIN
doc/images/usage/api_res.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 54 KiB |
@ -2,4 +2,12 @@
|
||||
|
||||
## 接口配置
|
||||
|
||||
#### 4.3 接口编辑
|
||||
添加完接口点击新添加的接口,跳转到接口预览页面,可看到刚才填写的信息。接口的详细信息点击编辑功能进行添加
|
||||
|
||||
#### 4.4 测试接口
|
||||
点击运行tab,可进入到接口测试页面,首先安装chrome crossRequest扩展,才可正常使用此功能
|
||||
<img src="./images/interface_run.png" width="800" style="margin:0px auto;display:block;" alt="图片名称" align=center />
|
||||
点击保存按钮可把当前测试保存到测试集,方便下次调试
|
||||
|
||||
## 接口调试
|
||||
|
@ -4,14 +4,16 @@
|
||||
|
||||
新建接口分几步?也是三步:
|
||||
|
||||
* [获取权限](#获取权限)
|
||||
* [找到一个项目](#选择项目)
|
||||
* [新建接口](#新建_编辑接口)
|
||||
* [点击 `保存`](#保存)
|
||||
|
||||
搞定~
|
||||
|
||||
|
||||
## 获取权限
|
||||
|
||||
- 登录后查看项目,如果找不到对应分组或项目,需要联系组长获取项目权限。
|
||||
|
||||
## 选择项目
|
||||
|
||||
@ -35,23 +37,6 @@
|
||||
|
||||
> 如果没有新建项目权限,请联系组长
|
||||
|
||||
## 保存
|
||||
- 恭喜你!创建了第一个YApi的接口,你可以看到在左侧看到接口名称,右侧有该接口的信息预览。
|
||||
|
||||
#### 添加接口分类
|
||||
|
||||
|
||||
|
||||
添加完成后可以在左侧列表看到新添加的接口分类
|
||||
|
||||
#### 4.2 添加接口
|
||||
鼠标移动到接口分类的菜单icon,点击添加接口
|
||||
|
||||
<img src="./images/interface_add.png" width="400" style="margin:0px auto;display:block;" alt="图片名称" align=center />
|
||||
|
||||
#### 4.3 接口编辑
|
||||
添加完接口点击新添加的接口,跳转到接口预览页面,可看到刚才填写的信息。接口的详细信息点击编辑功能进行添加
|
||||
|
||||
#### 4.4 测试接口
|
||||
点击运行tab,可进入到接口测试页面,首先安装chrome crossRequest扩展,才可正常使用此功能
|
||||
<img src="./images/interface_run.png" width="800" style="margin:0px auto;display:block;" alt="图片名称" align=center />
|
||||
点击保存按钮可把当前测试保存到测试集,方便下次调试
|
||||
<img src="./images/usage/api_res.png" />
|
||||
|
@ -29,6 +29,16 @@ body, h1, h2, h3, h4, h5, h6 {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* 覆盖掉 Interface 下的标题样式 */
|
||||
.markdown-body blockquote.api {
|
||||
background-color: transparent;
|
||||
}
|
||||
.markdown-body blockquote.api:before {
|
||||
content: '';
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* markdown 的注释样式 */
|
||||
.markdown-body blockquote {
|
||||
border-left: 4px solid #ff561b;
|
||||
background-color: #f8f8f8;
|
||||
|
@ -1201,7 +1201,7 @@
|
||||
|
||||
<p>
|
||||
<small class="text-muted">源码位置:</small>
|
||||
<a href="./static/server/controllers/user.js.html#162" target="_blank">./server/controllers/user.js:162</a>
|
||||
<a href="./static/server/controllers/user.js.html#160" target="_blank">./server/controllers/user.js:160</a>
|
||||
</p>
|
||||
|
||||
|
||||
@ -1297,7 +1297,7 @@
|
||||
|
||||
<p>
|
||||
<small class="text-muted">源码位置:</small>
|
||||
<a href="./static/server/controllers/user.js.html#227" target="_blank">./server/controllers/user.js:227</a>
|
||||
<a href="./static/server/controllers/user.js.html#225" target="_blank">./server/controllers/user.js:225</a>
|
||||
</p>
|
||||
|
||||
|
||||
@ -1394,7 +1394,7 @@
|
||||
|
||||
<p>
|
||||
<small class="text-muted">源码位置:</small>
|
||||
<a href="./static/server/controllers/user.js.html#301" target="_blank">./server/controllers/user.js:301</a>
|
||||
<a href="./static/server/controllers/user.js.html#299" target="_blank">./server/controllers/user.js:299</a>
|
||||
</p>
|
||||
|
||||
|
||||
@ -1464,7 +1464,7 @@
|
||||
|
||||
<p>
|
||||
<small class="text-muted">源码位置:</small>
|
||||
<a href="./static/server/controllers/user.js.html#329" target="_blank">./server/controllers/user.js:329</a>
|
||||
<a href="./static/server/controllers/user.js.html#327" target="_blank">./server/controllers/user.js:327</a>
|
||||
</p>
|
||||
|
||||
|
||||
@ -1526,7 +1526,7 @@
|
||||
|
||||
<p>
|
||||
<small class="text-muted">源码位置:</small>
|
||||
<a href="./static/server/controllers/user.js.html#368" target="_blank">./server/controllers/user.js:368</a>
|
||||
<a href="./static/server/controllers/user.js.html#366" target="_blank">./server/controllers/user.js:366</a>
|
||||
</p>
|
||||
|
||||
|
||||
@ -1588,7 +1588,7 @@
|
||||
|
||||
<p>
|
||||
<small class="text-muted">源码位置:</small>
|
||||
<a href="./static/server/controllers/user.js.html#399" target="_blank">./server/controllers/user.js:399</a>
|
||||
<a href="./static/server/controllers/user.js.html#397" target="_blank">./server/controllers/user.js:397</a>
|
||||
</p>
|
||||
|
||||
|
||||
@ -1680,7 +1680,7 @@
|
||||
|
||||
<p>
|
||||
<small class="text-muted">源码位置:</small>
|
||||
<a href="./static/server/controllers/user.js.html#454" target="_blank">./server/controllers/user.js:454</a>
|
||||
<a href="./static/server/controllers/user.js.html#452" target="_blank">./server/controllers/user.js:452</a>
|
||||
</p>
|
||||
|
||||
|
||||
@ -1742,7 +1742,7 @@
|
||||
|
||||
<p>
|
||||
<small class="text-muted">源码位置:</small>
|
||||
<a href="./static/server/controllers/user.js.html#497" target="_blank">./server/controllers/user.js:497</a>
|
||||
<a href="./static/server/controllers/user.js.html#495" target="_blank">./server/controllers/user.js:495</a>
|
||||
</p>
|
||||
|
||||
|
||||
@ -1804,7 +1804,7 @@
|
||||
|
||||
<p>
|
||||
<small class="text-muted">源码位置:</small>
|
||||
<a href="./static/server/controllers/user.js.html#529" target="_blank">./server/controllers/user.js:529</a>
|
||||
<a href="./static/server/controllers/user.js.html#527" target="_blank">./server/controllers/user.js:527</a>
|
||||
</p>
|
||||
|
||||
|
||||
@ -1882,7 +1882,7 @@
|
||||
|
||||
<p>
|
||||
<small class="text-muted">源码位置:</small>
|
||||
<a href="./static/server/controllers/user.js.html#574" target="_blank">./server/controllers/user.js:574</a>
|
||||
<a href="./static/server/controllers/user.js.html#572" target="_blank">./server/controllers/user.js:572</a>
|
||||
</p>
|
||||
|
||||
|
||||
|
BIN
static/doc/images/usage/api_res.png
Normal file
BIN
static/doc/images/usage/api_res.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 54 KiB |
@ -136,11 +136,9 @@ class userController extends baseController {
|
||||
}
|
||||
|
||||
async loginByToken(ctx) {
|
||||
let config = this.thirdQunarLogin();
|
||||
let token = ctx.request.body[config.tokenField] || ctx.request.query[config.tokenField];
|
||||
|
||||
//let config = this.thirdQunarLogin();
|
||||
try {
|
||||
let ret = await config.request(token);
|
||||
let ret = await yapi.emitHook('third_login', ctx);
|
||||
let login = await this.handleThirdLogin(ret.email, ret.username);
|
||||
|
||||
if (login === true) {
|
||||
|
@ -29,6 +29,16 @@ body, h1, h2, h3, h4, h5, h6 {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* 覆盖掉 Interface 下的标题样式 */
|
||||
.markdown-body blockquote.api {
|
||||
background-color: transparent;
|
||||
}
|
||||
.markdown-body blockquote.api:before {
|
||||
content: '';
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* markdown 的注释样式 */
|
||||
.markdown-body blockquote {
|
||||
border-left: 4px solid #ff561b;
|
||||
background-color: #f8f8f8;
|
||||
|
@ -90,6 +90,10 @@
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#获取权限">获取权限</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#选择项目">选择项目</a>
|
||||
</li>
|
||||
@ -97,10 +101,6 @@
|
||||
<li >
|
||||
<a href="#新建接口">新建接口</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#保存">保存</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
@ -137,8 +137,10 @@
|
||||
<h3 class="subject" id="如何创建项目?">如何创建项目? <a class="hashlink" href="#如何创建项目?">#</a></h3><p>把大象装进冰箱分几步?三步:把冰箱门打开,把大象装进去,关门,搞定~</p>
|
||||
<p>新建接口分几步?也是三步:</p>
|
||||
<ul>
|
||||
<li><a href="#选择项目">找到一个项目</a></li><li><a href="#新建_编辑接口">新建接口</a></li><li><a href="#保存">点击 <code>保存</code></a></li></ul>
|
||||
<li><a href="#获取权限">获取权限</a></li><li><a href="#选择项目">找到一个项目</a></li><li><a href="#新建_编辑接口">新建接口</a></li></ul>
|
||||
<p>搞定~</p>
|
||||
<h2 class="subject" id="获取权限">获取权限 <a class="hashlink" href="#获取权限">#</a></h2><ul>
|
||||
<li>登录后查看项目,如果找不到对应分组或项目,需要联系组长获取项目权限。</li></ul>
|
||||
<h2 class="subject" id="选择项目">选择项目 <a class="hashlink" href="#选择项目">#</a></h2><ul>
|
||||
<li><p>如果你已经登录,会在首页右侧看到一些项目 (可以在左侧的分组列表切换分组来查看不同分组下的项目)。</p>
|
||||
</li><li><p>点击一个项目,进入该项目的详情页。</p>
|
||||
@ -151,15 +153,14 @@
|
||||
<li>点击左侧接口分组右侧的菜单按钮,选择 <code>添加接口</code>,或者点击接口列表右上角的 <code>添加接口</code>。</li></ul>
|
||||
<p><img src="./images/usage/api_add_btn.png" /></p>
|
||||
<ul>
|
||||
<li>选择接口分类,输入接口名称和接口路径,点击 <code>确定</code>。</li></ul>
|
||||
<li>选择接口分类,输入接口名称和接口路径,点击 <code>提交</code>。</li></ul>
|
||||
<p><img src="./images/usage/api_add_panel.png" /></p>
|
||||
<h2 class="subject" id="保存">保存 <a class="hashlink" href="#保存">#</a></h2><h4 class="subject" id="添加接口分类">添加接口分类 <a class="hashlink" href="#添加接口分类">#</a></h4><p>添加完成后可以在左侧列表看到新添加的接口分类</p>
|
||||
<h4 class="subject" id="4.2_添加接口">4.2 添加接口 <a class="hashlink" href="#4.2_添加接口">#</a></h4><p>鼠标移动到接口分类的菜单icon,点击添加接口</p>
|
||||
<p><img src="./images/interface_add.png" width="400" style="margin:0px auto;display:block;" alt="图片名称" align=center /></p>
|
||||
<h4 class="subject" id="4.3_接口编辑">4.3 接口编辑 <a class="hashlink" href="#4.3_接口编辑">#</a></h4><p>添加完接口点击新添加的接口,跳转到接口预览页面,可看到刚才填写的信息。接口的详细信息点击编辑功能进行添加</p>
|
||||
<h4 class="subject" id="4.4_测试接口">4.4 测试接口 <a class="hashlink" href="#4.4_测试接口">#</a></h4><p>点击运行tab,可进入到接口测试页面,首先安装chrome crossRequest扩展,才可正常使用此功能
|
||||
<img src="./images/interface_run.png" width="800" style="margin:0px auto;display:block;" alt="图片名称" align=center />
|
||||
点击保存按钮可把当前测试保存到测试集,方便下次调试</p>
|
||||
<blockquote>
|
||||
<p>如果没有新建项目权限,请联系组长</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li>恭喜你!创建了第一个YApi的接口,你可以看到在左侧看到接口名称,右侧有该接口的信息预览。</li></ul>
|
||||
<p><img src="./images/usage/api_res.png" /></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -134,7 +134,11 @@
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
|
||||
<h2 class="subject" id="介绍">介绍 <a class="hashlink" href="#介绍">#</a></h2><h2 class="subject" id="接口配置">接口配置 <a class="hashlink" href="#接口配置">#</a></h2><h2 class="subject" id="接口调试">接口调试 <a class="hashlink" href="#接口调试">#</a></h2>
|
||||
<h2 class="subject" id="介绍">介绍 <a class="hashlink" href="#介绍">#</a></h2><h2 class="subject" id="接口配置">接口配置 <a class="hashlink" href="#接口配置">#</a></h2><h4 class="subject" id="4.3_接口编辑">4.3 接口编辑 <a class="hashlink" href="#4.3_接口编辑">#</a></h4><p>添加完接口点击新添加的接口,跳转到接口预览页面,可看到刚才填写的信息。接口的详细信息点击编辑功能进行添加</p>
|
||||
<h4 class="subject" id="4.4_测试接口">4.4 测试接口 <a class="hashlink" href="#4.4_测试接口">#</a></h4><p>点击运行tab,可进入到接口测试页面,首先安装chrome crossRequest扩展,才可正常使用此功能
|
||||
<img src="./images/interface_run.png" width="800" style="margin:0px auto;display:block;" alt="图片名称" align=center />
|
||||
点击保存按钮可把当前测试保存到测试集,方便下次调试</p>
|
||||
<h2 class="subject" id="接口调试">接口调试 <a class="hashlink" href="#接口调试">#</a></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user