feat: 增加yapi文档部署公司

This commit is contained in:
gaoxiaolin.gao 2018-01-15 18:05:07 +08:00
parent db9e905cdc
commit 5915bbf1de
29 changed files with 300 additions and 47 deletions

View File

@ -10,7 +10,7 @@ import { updateProjectScript } from '../../../../reducer/modules/project';
@connect(
state => {
return {
projectMsg: state.project.projectMsg
projectMsg: state.project.currProject
}
},
{

View File

@ -3,4 +3,50 @@
var aList = $('.ydoc-nav').find('a');
$(aList[aList.length-1]).css('display','none');
}
</script>
</script>
# 部署使用 YApi 的公司
* ![去哪儿网](http://source.qunarzz.com/common/hf/logo.png)
在去哪儿网已有 200 多个项目 接近800位开发人员使用YApi
* ![携程](http://www.doyoe.com/pimg/ctrip.png)
携程已经部署 Yapi 并且开始使用
* ![艺龙](./images/elong.jpeg)
艺龙已经部署使用 YApi 来进行项目管理和接口管理
* ![京东](./images/jd.jpeg)
京东已部署使用 YApi 来管理项目接口
* ![唯品会](./images/vip.jpeg)
唯品会已部署使用 YApi 来管理项目接口
* ![链家网](./images/lianjia.jpeg)
链家网已部署使用 YApi 来管理项目接口
* ![快手](./images/kuaishou.jpeg)
快手已部署使用 YApi 来管理项目接口
* ![便利蜂](./images/bianlifeng.jpg)
便利蜂已部署使用 YApi
* ![百迈克生物科技](./images/dbbmklogo.jpg)
百迈克生物科技已部署使用 YApi
* ![学堂在线](./images/xuetangx.jpg)
学堂在线已部署使用 YApi
* ![收钱吧](./images/shouqian.png)
收钱吧已部署使用 YApi

BIN
doc/images/bianlifeng.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
doc/images/dbbmklogo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
doc/images/elong.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
doc/images/jd.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
doc/images/kuaishou.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
doc/images/lianjia.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

BIN
doc/images/shouqian.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
doc/images/vip.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
doc/images/xuetangx.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@ -198,4 +198,87 @@ body, h1, h2, h3, h4, h5, h6 {
.ydoc .ydoc-nav .navbar-left li:nth-child(1){
display: none;
}
}
/* 首页list样式 */
#readme .markdown-body{
text-align: center;
}
#readme .markdown-body h1{
border: 0;
}
#readme .markdown-body ul {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-webkit-justify-content: center;
-moz-box-pack: center;
-moz-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-flex-wrap: wrap;
-moz-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
padding: 0;
list-style: none;
}
#readme .markdown-body ul > li {
overflow: hidden;
width: 200px;
height: 200px;
margin: 20px 10px 0;
border: 1px solid #eee;
border-radius: 0.05rem;
-webkit-background-clip: padding-box !important;
-moz-background-clip: padding-box !important;
-ms-background-clip: padding-box !important;
background-clip: padding-box !important;
}
#readme .markdown-body ul > li:hover > p:not(:only-child):first-child {
margin-top: -198px;
}
#readme .markdown-body ul p {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-webkit-justify-content: center;
-moz-box-pack: center;
-moz-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
-moz-box-align: center;
-moz-align-items: center;
-ms-flex-align: center;
align-items: center;
width: 100%;
height: 100%;
-webkit-transition: margin-top 0.3s ease-in;
-moz-transition: margin-top 0.3s ease-in;
-ms-transition: margin-top 0.3s ease-in;
transition: margin-top 0.3s ease-in;
margin: 0;
}
#readme .markdown-body ul p:not(:only-child):last-child {
padding: .15rem;
background-color: #eee;
}
#readme .markdown-body ul img {
max-width: 100%;
max-height: 100%;
}

View File

@ -617,6 +617,7 @@ class projectController extends baseController {
if (!_.isUndefined(params.icon)) data.icon = params.icon;
if (!_.isUndefined(params.pre_script)) data.pre_script = params.pre_script;
if (!_.isUndefined(params.after_script)) data.after_script = params.after_script;
let result = await this.Model.up(id, data);
let username = this.getUsername();
yapi.commons.saveLog({

View File

@ -1336,7 +1336,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/user.js.html#196" target="_blank">./server/controllers/user.js:196</a>
<a href="./static/server/controllers/user.js.html#195" target="_blank">./server/controllers/user.js:195</a>
</p>
@ -1432,7 +1432,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/user.js.html#274" target="_blank">./server/controllers/user.js:274</a>
<a href="./static/server/controllers/user.js.html#273" target="_blank">./server/controllers/user.js:273</a>
</p>
@ -1529,7 +1529,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/user.js.html#350" target="_blank">./server/controllers/user.js:350</a>
<a href="./static/server/controllers/user.js.html#349" target="_blank">./server/controllers/user.js:349</a>
</p>
@ -1599,7 +1599,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/user.js.html#379" target="_blank">./server/controllers/user.js:379</a>
<a href="./static/server/controllers/user.js.html#378" target="_blank">./server/controllers/user.js:378</a>
</p>
@ -1661,7 +1661,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/user.js.html#418" target="_blank">./server/controllers/user.js:418</a>
<a href="./static/server/controllers/user.js.html#417" target="_blank">./server/controllers/user.js:417</a>
</p>
@ -1723,7 +1723,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/user.js.html#451" target="_blank">./server/controllers/user.js:451</a>
<a href="./static/server/controllers/user.js.html#450" target="_blank">./server/controllers/user.js:450</a>
</p>
@ -1815,7 +1815,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/user.js.html#520" target="_blank">./server/controllers/user.js:520</a>
<a href="./static/server/controllers/user.js.html#519" target="_blank">./server/controllers/user.js:519</a>
</p>
@ -1877,7 +1877,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/user.js.html#563" target="_blank">./server/controllers/user.js:563</a>
<a href="./static/server/controllers/user.js.html#562" target="_blank">./server/controllers/user.js:562</a>
</p>
@ -1939,7 +1939,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/user.js.html#595" target="_blank">./server/controllers/user.js:595</a>
<a href="./static/server/controllers/user.js.html#594" target="_blank">./server/controllers/user.js:594</a>
</p>
@ -2017,7 +2017,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/user.js.html#640" target="_blank">./server/controllers/user.js:640</a>
<a href="./static/server/controllers/user.js.html#639" target="_blank">./server/controllers/user.js:639</a>
</p>
@ -2235,7 +2235,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#192" target="_blank">./server/controllers/project.js:192</a>
<a href="./static/server/controllers/project.js.html#199" target="_blank">./server/controllers/project.js:199</a>
</p>
@ -2319,7 +2319,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#249" target="_blank">./server/controllers/project.js:249</a>
<a href="./static/server/controllers/project.js.html#256" target="_blank">./server/controllers/project.js:256</a>
</p>
@ -2403,7 +2403,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#304" target="_blank">./server/controllers/project.js:304</a>
<a href="./static/server/controllers/project.js.html#311" target="_blank">./server/controllers/project.js:311</a>
</p>
@ -2481,7 +2481,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#326" target="_blank">./server/controllers/project.js:326</a>
<a href="./static/server/controllers/project.js.html#333" target="_blank">./server/controllers/project.js:333</a>
</p>
@ -2564,7 +2564,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#359" target="_blank">./server/controllers/project.js:359</a>
<a href="./static/server/controllers/project.js.html#366" target="_blank">./server/controllers/project.js:366</a>
</p>
@ -2780,7 +2780,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#418" target="_blank">./server/controllers/project.js:418</a>
<a href="./static/server/controllers/project.js.html#425" target="_blank">./server/controllers/project.js:425</a>
</p>
@ -2852,7 +2852,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#448" target="_blank">./server/controllers/project.js:448</a>
<a href="./static/server/controllers/project.js.html#455" target="_blank">./server/controllers/project.js:455</a>
</p>
@ -2938,7 +2938,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#495" target="_blank">./server/controllers/project.js:495</a>
<a href="./static/server/controllers/project.js.html#502" target="_blank">./server/controllers/project.js:502</a>
</p>
@ -3027,7 +3027,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#540" target="_blank">./server/controllers/project.js:540</a>
<a href="./static/server/controllers/project.js.html#547" target="_blank">./server/controllers/project.js:547</a>
</p>
@ -3145,7 +3145,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#628" target="_blank">./server/controllers/project.js:628</a>
<a href="./static/server/controllers/project.js.html#636" target="_blank">./server/controllers/project.js:636</a>
</p>
@ -3247,7 +3247,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#689" target="_blank">./server/controllers/project.js:689</a>
<a href="./static/server/controllers/project.js.html#697" target="_blank">./server/controllers/project.js:697</a>
</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
static/doc/images/jd.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
static/doc/images/vip.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@ -101,7 +101,7 @@
<p class="home-version">当前版本v1.3.3</p>
<p class="home-version">当前版本v1.3.4</p>
</div>
@ -165,6 +165,32 @@
$(aList[aList.length-1]).css('display','none');
}
</script>
<h1 class="subject" id="部署使用_YApi_的公司">部署使用 YApi 的公司 <a class="hashlink" href="#部署使用_YApi_的公司">#</a></h1><ul>
<li><p><img src="http://source.qunarzz.com/common/hf/logo.png" alt="去哪儿网"></p>
<p> 在去哪儿网已有 200 多个项目 接近800位开发人员使用YApi</p>
</li><li><p><img src="http://www.doyoe.com/pimg/ctrip.png" alt="携程"></p>
<p> 携程已经部署 Yapi 并且开始使用</p>
</li><li><p><img src="./images/elong.jpeg" alt="艺龙"></p>
<p> 艺龙已经部署使用 YApi 来进行项目管理和接口管理</p>
</li><li><p><img src="./images/jd.jpeg" alt="京东"></p>
<p> 京东已部署使用 YApi 来管理项目接口</p>
</li><li><p><img src="./images/vip.jpeg" alt="唯品会"></p>
<p> 唯品会已部署使用 YApi 来管理项目接口</p>
</li><li><p><img src="./images/lianjia.jpeg" alt="链家网"></p>
<p> 链家网已部署使用 YApi 来管理项目接口</p>
</li><li><p><img src="./images/kuaishou.jpeg" alt="快手"></p>
<p> 快手已部署使用 YApi 来管理项目接口</p>
</li><li><p><img src="./images/bianlifeng.jpg" alt="便利蜂"></p>
<p> 便利蜂已部署使用 YApi</p>
</li><li><p><img src="./images/dbbmklogo.jpg" alt="百迈克生物科技"></p>
<p> 百迈克生物科技已部署使用 YApi</p>
</li><li><p><img src="./images/xuetangx.jpg" alt="学堂在线"></p>
<p> 学堂在线已部署使用 YApi</p>
</li><li><p><img src="./images/shouqian.png" alt="收钱吧"></p>
<p> 收钱吧已部署使用 YApi</p>
</li></ul>
</article>
</div>

View File

@ -97,6 +97,10 @@
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
<ul class="nav docs-sidenav">
<li >
<a href="#v1.3.4">v1.3.4</a>
</li>
<li >
<a href="#v1.3.3">v1.3.3</a>
</li>
@ -169,7 +173,11 @@
<div class="content-right markdown-body use-sidebar" role="main">
<h3 class="subject" id="v1.3.3">v1.3.3 <a class="hashlink" href="#v1.3.3">#</a></h3><h4 class="subject" id="Feature">Feature <a class="hashlink" href="#Feature">#</a></h4><ul>
<h3 class="subject" id="v1.3.4">v1.3.4 <a class="hashlink" href="#v1.3.4">#</a></h3><h4 class="subject" id="Feature">Feature <a class="hashlink" href="#Feature">#</a></h4><ul>
<li>进入project页面加入loading</li><li>接口list页table中加入分页</li><li>项目添加者自动变成项目组长</li></ul>
<h4 class="subject" id="Bug_Fixed">Bug Fixed <a class="hashlink" href="#Bug_Fixed">#</a></h4><ul>
<li>修复无权限进入项目bug</li><li>修复复制接口query 等参数无法复制bug</li><li>修复导出html markdown参数丢失问题</li></ul>
<h3 class="subject" id="v1.3.3">v1.3.3 <a class="hashlink" href="#v1.3.3">#</a></h3><h4 class="subject" id="Feature">Feature <a class="hashlink" href="#Feature">#</a></h4><ul>
<li>邮件功能中: 1接口信息改动增加通知对应项目所有的成员2默认开启接口改动邮件提醒3) 增加邮件内容的jsondiff信息</li></ul>
<h4 class="subject" id="Bug_Fixed">Bug Fixed <a class="hashlink" href="#Bug_Fixed">#</a></h4><ul>
<li>优化接口运行页面插件提醒</li><li>完善 log 记录不到的问题</li><li>修复接口内容改动不发送邮件问题</li><li>修复部分swagger数据导入丢失问题</li></ul>

View File

@ -818,7 +818,6 @@ class interfaceController extends baseController {
const users = this.arrUnique(projectMenbers, starUsers);
const usersInfo = await this.userModel.findByUids(users)
const emails = usersInfo.map(item => item.email).join(',');
console.log('emails', emails);
try {
yapi.commons.sendMail({

View File

@ -207,11 +207,18 @@ class projectController extends baseController {
up_time: yapi.commons.time()
})
}
let uid = this.getUid();
// 将项目添加者变成项目组长,除admin以外
if (this.getRole() !== 'admin') {
let userdata = await this.getUserdata(uid, 'owner')
await this.Model.addMember(result._id, [userdata])
}
let username = this.getUsername();
yapi.commons.saveLog({
content: `<a href="/user/profile/${this.getUid()}">${username}</a> 添加了项目 <a href="/project/${result._id}">${params.name}</a>`,
type: 'project',
uid: this.getUid(),
uid,
username: username,
typeid: result._id
});
@ -365,7 +372,7 @@ class projectController extends baseController {
async get(ctx) {
let params = ctx.params;
let result = await this.Model.getBaseInfo(params.id);
if (!result) {
return ctx.body = yapi.commons.resReturn(null, 400, '不存在的项目');
}
@ -637,6 +644,7 @@ class projectController extends baseController {
if (!_.isUndefined(params.icon)) data.icon = params.icon;
if (!_.isUndefined(params.pre_script)) data.pre_script = params.pre_script;
if (!_.isUndefined(params.after_script)) data.after_script = params.after_script;
let result = await this.Model.up(id, data);
let username = this.getUsername();
yapi.commons.saveLog({

View File

@ -159,23 +159,22 @@ class userController extends baseController {
try {
const { email, password } = ctx.request.body;
const username = email.split(/\@/g)[0]
const isValid = await ldap.ldapQuery(email, password);
console.log('isVaild', isValid);
let login = await this.handleThirdLogin(email, username);
if (login === true) {
let userInst = yapi.getInst(userModel); //创建user实体
let result = await userInst.findByEmail(email);
return ctx.body = yapi.commons.resReturn({
username: result.username,
role: result.role,
uid: result._id,
email: result.email,
add_time: result.add_time,
up_time: result.up_time,
type: 'site',
study: result.study
}, 0, 'logout success...');
}
await ldap.ldapQuery(email, password);
let login = await this.handleThirdLogin(email, username);
if (login === true) {
let userInst = yapi.getInst(userModel); //创建user实体
let result = await userInst.findByEmail(email);
return ctx.body = yapi.commons.resReturn({
username: result.username,
role: result.role,
uid: result._id,
email: result.email,
add_time: result.add_time,
up_time: result.up_time,
type: 'site',
study: result.study
}, 0, 'logout success...');
}
} catch (e) {
yapi.commons.log(e.message, 'error');
return ctx.body = yapi.commons.resReturn(null, 401, e.message);

View File

@ -198,4 +198,87 @@ body, h1, h2, h3, h4, h5, h6 {
.ydoc .ydoc-nav .navbar-left li:nth-child(1){
display: none;
}
}
/* 首页list样式 */
#readme .markdown-body{
text-align: center;
}
#readme .markdown-body h1{
border: 0;
}
#readme .markdown-body ul {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-webkit-justify-content: center;
-moz-box-pack: center;
-moz-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-flex-wrap: wrap;
-moz-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
padding: 0;
list-style: none;
}
#readme .markdown-body ul > li {
overflow: hidden;
width: 200px;
height: 200px;
margin: 20px 10px 0;
border: 1px solid #eee;
border-radius: 0.05rem;
-webkit-background-clip: padding-box !important;
-moz-background-clip: padding-box !important;
-ms-background-clip: padding-box !important;
background-clip: padding-box !important;
}
#readme .markdown-body ul > li:hover > p:not(:only-child):first-child {
margin-top: -198px;
}
#readme .markdown-body ul p {
display: -webkit-box;
display: -webkit-flex;
display: -moz-box;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-webkit-justify-content: center;
-moz-box-pack: center;
-moz-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
-moz-box-align: center;
-moz-align-items: center;
-ms-flex-align: center;
align-items: center;
width: 100%;
height: 100%;
-webkit-transition: margin-top 0.3s ease-in;
-moz-transition: margin-top 0.3s ease-in;
-ms-transition: margin-top 0.3s ease-in;
transition: margin-top 0.3s ease-in;
margin: 0;
}
#readme .markdown-body ul p:not(:only-child):last-child {
padding: .15rem;
background-color: #eee;
}
#readme .markdown-body ul img {
max-width: 100%;
max-height: 100%;
}