mirror of
https://github.com/YMFE/yapi.git
synced 2025-04-06 15:00:26 +08:00
docs: opti
This commit is contained in:
parent
5863738f77
commit
140d7782c8
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 使用手册</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -142,15 +146,15 @@
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#Mock 期望">Mock 期望</a>
|
||||
<a href="#Mock_期望">Mock 期望</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#自定义 Mock 脚本">自定义 Mock 脚本</a>
|
||||
<a href="#自定义_Mock_脚本">自定义 Mock 脚本</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#Mock 优先级说明">Mock 优先级说明</a>
|
||||
<a href="#Mock_优先级说明">Mock 优先级说明</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@ -241,7 +245,7 @@ mockJson = <span class="token punctuation">{</span>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 </title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -4865,7 +4869,7 @@
|
||||
|
||||
<p>
|
||||
<small class="text-muted">源码位置:</small>
|
||||
<a href="./static/server/controllers/interfaceCol.js.html#371" target="_blank">./server/controllers/interfaceCol.js:371</a>
|
||||
<a href="./static/server/controllers/interfaceCol.js.html#370" target="_blank">./server/controllers/interfaceCol.js:370</a>
|
||||
</p>
|
||||
|
||||
|
||||
@ -4927,7 +4931,7 @@
|
||||
|
||||
<p>
|
||||
<small class="text-muted">源码位置:</small>
|
||||
<a href="./static/server/controllers/interfaceCol.js.html#438" target="_blank">./server/controllers/interfaceCol.js:438</a>
|
||||
<a href="./static/server/controllers/interfaceCol.js.html#437" target="_blank">./server/controllers/interfaceCol.js:437</a>
|
||||
</p>
|
||||
|
||||
|
||||
@ -5001,7 +5005,7 @@
|
||||
|
||||
<p>
|
||||
<small class="text-muted">源码位置:</small>
|
||||
<a href="./static/server/controllers/interfaceCol.js.html#482" target="_blank">./server/controllers/interfaceCol.js:482</a>
|
||||
<a href="./static/server/controllers/interfaceCol.js.html#481" target="_blank">./server/controllers/interfaceCol.js:481</a>
|
||||
</p>
|
||||
|
||||
|
||||
@ -5061,7 +5065,7 @@
|
||||
|
||||
<p>
|
||||
<small class="text-muted">源码位置:</small>
|
||||
<a href="./static/server/controllers/interfaceCol.js.html#514" target="_blank">./server/controllers/interfaceCol.js:514</a>
|
||||
<a href="./static/server/controllers/interfaceCol.js.html#513" target="_blank">./server/controllers/interfaceCol.js:513</a>
|
||||
</p>
|
||||
|
||||
|
||||
@ -5205,7 +5209,7 @@
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 使用手册</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -237,7 +241,7 @@ assert.equal(body.data.group_name<span class="token punctuation">,</span> 'testG
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 使用手册</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -158,15 +162,15 @@
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#Postman 数据导入">Postman 数据导入</a>
|
||||
<a href="#Postman_数据导入">Postman 数据导入</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#HAR 数据导入">HAR 数据导入</a>
|
||||
<a href="#HAR_数据导入">HAR 数据导入</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#Swagger 数据导入">Swagger 数据导入</a>
|
||||
<a href="#Swagger_数据导入">Swagger 数据导入</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@ -219,7 +223,7 @@
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 内网部署</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -112,11 +116,11 @@
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#方式一. 可视化部署[推荐]">方式一. 可视化部署[推荐]</a>
|
||||
<a href="#方式一._可视化部署[推荐]">方式一. 可视化部署[推荐]</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#方式二. 命令行部署">方式二. 命令行部署</a>
|
||||
<a href="#方式二._命令行部署">方式二. 命令行部署</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@ -130,7 +134,7 @@
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="#配置邮箱 (仅支持 SMTP)">配置邮箱 (仅支持 SMTP)</a>
|
||||
<a href="#配置邮箱__仅支持_SMTP_">配置邮箱 (仅支持 SMTP)</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@ -191,7 +195,7 @@ yapi update -v v1<span class="token number">.1</span>.<span class="token number"
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 使用手册</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -211,7 +215,7 @@
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 </title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -174,7 +178,7 @@
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 使用手册</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -198,7 +202,7 @@
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 使用手册</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -312,7 +316,7 @@
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 使用手册</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -140,19 +144,19 @@
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#定义 mock 数据示例">定义 mock 数据示例</a>
|
||||
<a href="#定义_mock_数据示例">定义 mock 数据示例</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#YApi-Mock 跟 Mockjs 区别">YApi-Mock 跟 Mockjs 区别</a>
|
||||
<a href="#YApi-Mock_跟_Mockjs_区别">YApi-Mock 跟 Mockjs 区别</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#如何使用 Mock">如何使用 Mock</a>
|
||||
<a href="#如何使用_Mock">如何使用 Mock</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#Mock 语法规范">Mock 语法规范</a>
|
||||
<a href="#Mock_语法规范">Mock 语法规范</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@ -190,14 +194,14 @@
|
||||
<p>注:项目 id 可以在项目设置里查看到</p>
|
||||
</blockquote>
|
||||
<h2 class="subject" id="定义_mock_数据示例">定义 mock 数据示例 <a class="hashlink" href="#定义_mock_数据示例">#</a></h2><pre><code><span class="token punctuation">{</span>
|
||||
<span class="token property">"status|0-1"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span> //接口状态
|
||||
"status|<span class="token number">0</span>-<span class="token number">1</span>"<span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span> //接口状态
|
||||
<span class="token property">"message"</span><span class="token operator">:</span> <span class="token string">"请求完成"</span><span class="token punctuation">,</span> //消息提示
|
||||
<span class="token property">"data"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
<span class="token property">"counts"</span><span class="token operator">:</span><span class="token string">"@integer"</span><span class="token punctuation">,</span> //统计数量
|
||||
<span class="token property">"totalSubjectType|4-10"</span><span class="token operator">:</span> <span class="token punctuation">[</span> //<span class="token number">4</span>-<span class="token number">10</span>意味着可以随机生成<span class="token number">4</span>-<span class="token number">10</span>组数据
|
||||
"totalSubjectType|<span class="token number">4</span>-<span class="token number">10</span>"<span class="token operator">:</span> <span class="token punctuation">[</span> //<span class="token number">4</span>-<span class="token number">10</span>意味着可以随机生成<span class="token number">4</span>-<span class="token number">10</span>组数据
|
||||
<span class="token punctuation">{</span>
|
||||
<span class="token property">"subjectName|regexp"</span><span class="token operator">:</span> <span class="token string">"大数据|机器学习|工具"</span><span class="token punctuation">,</span> //主题名
|
||||
<span class="token property">"subjectType|+1"</span><span class="token operator">:</span> <span class="token number">1</span> //类型
|
||||
"subjectName|regexp"<span class="token operator">:</span> "大数据|机器学习|工具<span class="token string">", //主题名
|
||||
"</span>subjectType|+<span class="token number">1</span>"<span class="token operator">:</span> <span class="token number">1</span> //类型
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">]</span><span class="token punctuation">,</span>
|
||||
<span class="token property">"data"</span><span class="token operator">:</span><span class="token punctuation">[</span>
|
||||
@ -211,8 +215,8 @@
|
||||
</code></pre><h2 class="subject" id="YApi-Mock_跟_Mockjs_区别">YApi-Mock 跟 Mockjs 区别 <a class="hashlink" href="#YApi-Mock_跟_Mockjs_区别">#</a></h2><p><a href="http://mockjs.com/examples.html">Mockjs 官网</a></p>
|
||||
<p>1 因为 yapi 基于 json 定义 mock ,无法使用 mockjs 原有的函数功能,正则表达式需要基于 rule 书写,示例如下:</p>
|
||||
<pre><code><span class="token punctuation">{</span>
|
||||
<span class="token property">"name|regexp"</span><span class="token operator">:</span> <span class="token string">"[a-z0-9_]+?"</span><span class="token punctuation">,</span>
|
||||
<span class="token property">"type|regexp"</span><span class="token operator">:</span> <span class="token string">"json|text|xml"</span> //枚举数据类型可这样实现
|
||||
"name|regexp"<span class="token operator">:</span> <span class="token string">"[a-z0-9_]+?"</span><span class="token punctuation">,</span>
|
||||
"type|regexp"<span class="token operator">:</span> "json|text|xml" //枚举数据类型可这样实现
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre><p>2 支持替换请求的 query, body 参数</p>
|
||||
<pre><code><span class="token punctuation">{</span>
|
||||
@ -249,9 +253,9 @@ $<span class="token punctuation">.</span><span class="token function">post</span
|
||||
<p><a href="#DPD">2. 数据占位符定义规范(Data Placeholder Definition,DPD)</a></p>
|
||||
<p><span id = "DTD"></span></p>
|
||||
<h3 class="subject" id="数据模板定义规范(Data_Template_Definition,DTD)">数据模板定义规范(Data Template Definition,DTD) <a class="hashlink" href="#数据模板定义规范(Data_Template_Definition,DTD)">#</a></h3><p>数据模板中的每个属性由 3 部分构成:属性名、生成规则、属性值:</p>
|
||||
<pre><code>// 属性名 name (与生成规则之间用 <span class="token string">"|"</span> 隔开)
|
||||
// 生成规则 rule(生成规则有<span class="token number">7</span>种详见下面的生成规则)
|
||||
// 属性值 value(可以含有 <span class="token string">"@占位符"</span> 同时也指定了最终值的初始值和类型)
|
||||
<pre><code>// 属性名 name (与生成规则之间用 "|<span class="token string">" 隔开)
|
||||
// 生成规则 rule(生成规则有7种详见下面的生成规则)
|
||||
// 属性值 value(可以含有 "</span>@占位符" 同时也指定了最终值的初始值和类型)
|
||||
|
||||
'name|rule'<span class="token operator">:</span> value
|
||||
|
||||
@ -360,7 +364,7 @@ name<span class="token operator">:</span> <span class="token punctuation">{</spa
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 插件 Wiki</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -126,7 +130,7 @@
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#index.js 配置说明">index.js 配置说明</a>
|
||||
<a href="#index.js_配置说明">index.js 配置说明</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
@ -198,7 +202,7 @@ listener //监听函数,可以是普通函数,也可以是 asyncFunction
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 插件 Wiki</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -124,11 +128,11 @@
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#后端 hookList">后端 hookList</a>
|
||||
<a href="#后端_hookList">后端 hookList</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#前端 hookList">前端 hookList</a>
|
||||
<a href="#前端_hookList">前端 hookList</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@ -331,7 +335,7 @@ hooks = <span class="token punctuation">{</span>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 插件 Wiki</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -161,7 +165,7 @@ yapi unplugin yapi-plugin-demo
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 插件 Wiki</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -172,7 +176,7 @@ window.onload = function(){
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 插件 Wiki</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -162,7 +166,7 @@ npm run dev //启动服务器后,请访问 <span class="token number">127.0</s
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 使用手册</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -202,7 +206,7 @@
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 常见问题</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -100,31 +104,31 @@
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="#Q1 怎样联系组长?">Q1 怎样联系组长?</a>
|
||||
<a href="#Q1_怎样联系组长?">Q1 怎样联系组长?</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="#Q2 怎么快速迁移旧项目?">Q2 怎么快速迁移旧项目?</a>
|
||||
<a href="#Q2_怎么快速迁移旧项目?">Q2 怎么快速迁移旧项目?</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="#Q3 忘记密码怎么办?">Q3 忘记密码怎么办?</a>
|
||||
<a href="#Q3_忘记密码怎么办?">Q3 忘记密码怎么办?</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="#Q4 发现了 Bug 怎么办?">Q4 发现了 Bug 怎么办?</a>
|
||||
<a href="#Q4_发现了_Bug_怎么办?">Q4 发现了 Bug 怎么办?</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="#Q5 可视化部署一直处于 github 压缩包下载状态怎么办?">Q5 可视化部署一直处于 github 压缩包下载状态怎么办?</a>
|
||||
<a href="#Q5_可视化部署一直处于_github_压缩包下载状态怎么办?">Q5 可视化部署一直处于 github 压缩包下载状态怎么办?</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@ -164,7 +168,7 @@
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 使用手册</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -212,7 +216,7 @@
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 插件 Wiki</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -118,7 +122,7 @@
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#启动 prd 环境服务器">启动 prd 环境服务器</a>
|
||||
<a href="#启动_prd_环境服务器">启动 prd 环境服务器</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@ -182,7 +186,7 @@ npm run dev //启动服务器后,请访问 <span class="token number">127.0</s
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 版本记录</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -167,7 +171,7 @@
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -33,7 +33,7 @@ const baseController = require('./base.js');
|
||||
const yapi = require('../yapi.js');
|
||||
const _ = require('underscore');
|
||||
|
||||
class interfaceColController extends baseController{
|
||||
class interfaceColController extends baseController {
|
||||
constructor(ctx) {
|
||||
super(ctx);
|
||||
this.colModel = yapi.getInst(interfaceColModel);
|
||||
@ -52,7 +52,7 @@ class interfaceColController extends baseController{
|
||||
* @returns {Object}
|
||||
* @example
|
||||
*/
|
||||
async list(ctx){
|
||||
async list(ctx) {
|
||||
try {
|
||||
let id = ctx.query.project_id;
|
||||
let project = await this.projectModel.getBaseInfo(id);
|
||||
@ -63,7 +63,7 @@ class interfaceColController extends baseController{
|
||||
}
|
||||
let result = await this.colModel.list(id);
|
||||
|
||||
for(let i=0; i< result.length;i++){
|
||||
for (let i = 0; i < result.length; i++) {
|
||||
result[i] = result[i].toObject();
|
||||
result[i].caseList = await this.caseModel.list(result[i]._id)
|
||||
}
|
||||
@ -86,8 +86,8 @@ class interfaceColController extends baseController{
|
||||
* @example
|
||||
*/
|
||||
|
||||
async addCol(ctx){
|
||||
try{
|
||||
async addCol(ctx) {
|
||||
try {
|
||||
let params = ctx.request.body;
|
||||
params = yapi.commons.handleParams(params, {
|
||||
name: 'string',
|
||||
@ -98,7 +98,7 @@ class interfaceColController extends baseController{
|
||||
if (!params.project_id) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, '项目id不能为空');
|
||||
}
|
||||
if(!params.name){
|
||||
if (!params.name) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, '名称不能为空');
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ class interfaceColController extends baseController{
|
||||
// this.projectModel.up(params.project_id,{up_time: new Date().getTime()}).then();
|
||||
ctx.body = yapi.commons.resReturn(result);
|
||||
|
||||
}catch(e){
|
||||
} catch (e) {
|
||||
ctx.body = yapi.commons.resReturn(null, 402, e.message);
|
||||
}
|
||||
}
|
||||
@ -142,43 +142,43 @@ class interfaceColController extends baseController{
|
||||
* @example
|
||||
*/
|
||||
|
||||
async getCaseList(ctx){
|
||||
async getCaseList(ctx) {
|
||||
try {
|
||||
let id = ctx.query.col_id;
|
||||
if(!id || id == 0){
|
||||
if (!id || id == 0) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 407, 'col_id不能为空')
|
||||
}
|
||||
let resultList = await this.caseModel.list(id, 'all');
|
||||
let colData = await this.colModel.get(id);
|
||||
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', 'view') !== true) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 406, '没有权限');
|
||||
}
|
||||
}
|
||||
|
||||
for(let index=0; index< resultList.length; index++){
|
||||
for (let index = 0; index < resultList.length; index++) {
|
||||
let result = resultList[index].toObject();
|
||||
let data = await this.interfaceModel.get(result.interface_id);
|
||||
if(!data){
|
||||
if (!data) {
|
||||
await this.caseModel.del(result._id);
|
||||
continue;
|
||||
}
|
||||
let projectData = await this.projectModel.getBaseInfo(data.project_id);
|
||||
}
|
||||
let projectData = await this.projectModel.getBaseInfo(data.project_id);
|
||||
result.path = projectData.basepath + data.path;
|
||||
result.method = data.method;
|
||||
result.req_body_type = data.req_body_type;
|
||||
result.req_headers = data.req_headers;
|
||||
result.req_headers = this.handleParamsValue(data.req_headers, result.req_headers);
|
||||
result.res_body = data.res_body;
|
||||
result.res_body_type = data.res_body_type;
|
||||
|
||||
result.req_body_form = this.handleParamsValue(data.req_body_form, result.req_body_form)
|
||||
|
||||
result.req_body_form = this.handleParamsValue(data.req_body_form, result.req_body_form)
|
||||
result.req_query = this.handleParamsValue(data.req_query, result.req_query)
|
||||
result.req_params = this.handleParamsValue(data.req_params, result.req_params)
|
||||
resultList[index] = result;
|
||||
}
|
||||
resultList = resultList.sort((a,b)=>{
|
||||
resultList = resultList.sort((a, b) => {
|
||||
return a.index - b.index;
|
||||
});
|
||||
let ctxBody = yapi.commons.resReturn(resultList);
|
||||
@ -210,8 +210,8 @@ class interfaceColController extends baseController{
|
||||
* @example
|
||||
*/
|
||||
|
||||
async addCase(ctx){
|
||||
try{
|
||||
async addCase(ctx) {
|
||||
try {
|
||||
let params = ctx.request.body;
|
||||
params = yapi.commons.handleParams(params, {
|
||||
casename: 'string',
|
||||
@ -226,7 +226,7 @@ class interfaceColController extends baseController{
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, '项目id不能为空');
|
||||
}
|
||||
|
||||
if(!params.interface_id){
|
||||
if (!params.interface_id) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, '接口id不能为空');
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ class interfaceColController extends baseController{
|
||||
}
|
||||
|
||||
|
||||
if(!params.casename){
|
||||
if (!params.casename) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, '用例名称不能为空');
|
||||
}
|
||||
|
||||
@ -251,7 +251,7 @@ class interfaceColController extends baseController{
|
||||
let result = await this.caseModel.save(params);
|
||||
let username = this.getUsername();
|
||||
|
||||
this.colModel.get(params.col_id).then((col)=>{
|
||||
this.colModel.get(params.col_id).then((col) => {
|
||||
yapi.commons.saveLog({
|
||||
content: `<a href="/user/profile/${this.getUid()}">${username}</a> 在接口集 <a href="/project/${params.project_id}/interface/col/${params.col_id}">${col.name}</a> 下添加了接口用例 <a href="/project/${params.project_id}/interface/case/${result._id}">${params.casename}</a>`,
|
||||
type: 'project',
|
||||
@ -260,23 +260,23 @@ class interfaceColController extends baseController{
|
||||
typeid: params.project_id
|
||||
});
|
||||
});
|
||||
this.projectModel.up(params.project_id,{up_time: new Date().getTime()}).then();
|
||||
this.projectModel.up(params.project_id, { up_time: new Date().getTime() }).then();
|
||||
|
||||
ctx.body = yapi.commons.resReturn(result);
|
||||
|
||||
}catch(e){
|
||||
} catch (e) {
|
||||
ctx.body = yapi.commons.resReturn(null, 402, e.message);
|
||||
}
|
||||
}
|
||||
|
||||
async addCaseList(ctx){
|
||||
try{
|
||||
async addCaseList(ctx) {
|
||||
try {
|
||||
let params = ctx.request.body;
|
||||
params = yapi.commons.handleParams(params, {
|
||||
project_id: 'number',
|
||||
col_id: 'number'
|
||||
});
|
||||
if(!params.interface_list || !Array.isArray(params.interface_list)){
|
||||
if (!params.interface_list || !Array.isArray(params.interface_list)) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, 'interface_list 参数有误');
|
||||
}
|
||||
|
||||
@ -303,7 +303,7 @@ class interfaceColController extends baseController{
|
||||
col_id: params.col_id
|
||||
}
|
||||
|
||||
for(let i=0; i<params.interface_list.length; i++){
|
||||
for (let i = 0; i < params.interface_list.length; i++) {
|
||||
let interfaceData = await this.interfaceModel.getBaseinfo(params.interface_list[i]);
|
||||
data.interface_id = params.interface_list[i];
|
||||
data.casename = interfaceData.title;
|
||||
@ -311,7 +311,7 @@ class interfaceColController extends baseController{
|
||||
data.req_body_type = interfaceData.req_body_type;
|
||||
await this.caseModel.save(data);
|
||||
let username = this.getUsername();
|
||||
this.colModel.get(params.col_id).then((col)=>{
|
||||
this.colModel.get(params.col_id).then((col) => {
|
||||
yapi.commons.saveLog({
|
||||
content: `<a href="/user/profile/${this.getUid()}">${username}</a> 在接口集 <a href="/project/${params.project_id}/interface/col/${params.col_id}">${col.name}</a> 下导入了接口 <a href="/project/${params.project_id}/interface/case/${data.interface_id}">${data.casename}</a>`,
|
||||
type: 'project',
|
||||
@ -322,11 +322,11 @@ class interfaceColController extends baseController{
|
||||
});
|
||||
}
|
||||
|
||||
this.projectModel.up(params.project_id,{up_time: new Date().getTime()}).then();
|
||||
this.projectModel.up(params.project_id, { up_time: new Date().getTime() }).then();
|
||||
|
||||
ctx.body = yapi.commons.resReturn('ok');
|
||||
|
||||
}catch(e){
|
||||
} catch (e) {
|
||||
ctx.body = yapi.commons.resReturn(null, 402, e.message);
|
||||
}
|
||||
}
|
||||
@ -351,8 +351,8 @@ class interfaceColController extends baseController{
|
||||
* @example
|
||||
*/
|
||||
|
||||
async upCase(ctx){
|
||||
try{
|
||||
async upCase(ctx) {
|
||||
try {
|
||||
let params = ctx.request.body;
|
||||
params = yapi.commons.handleParams(params, {
|
||||
id: 'number',
|
||||
@ -374,12 +374,11 @@ class interfaceColController extends baseController{
|
||||
//不允许修改接口id和项目id
|
||||
delete params.interface_id;
|
||||
delete params.project_id;
|
||||
|
||||
let result = await this.caseModel.up(params.id, params);
|
||||
let username = this.getUsername();
|
||||
this.colModel.get(caseData.col_id).then((col)=>{
|
||||
this.colModel.get(caseData.col_id).then((col) => {
|
||||
yapi.commons.saveLog({
|
||||
content:`<a href="/user/profile/${this.getUid()}">${username}</a> 在接口集 <a href="/project/${caseData.project_id}/interface/col/${caseData.col_id}">${col.name}</a> 更新了接口用例 <a href="/project/${caseData.project_id}/interface/case/${params.id}">${params.casename || caseData.casename}</a>`,
|
||||
content: `<a href="/user/profile/${this.getUid()}">${username}</a> 在接口集 <a href="/project/${caseData.project_id}/interface/col/${caseData.col_id}">${col.name}</a> 更新了接口用例 <a href="/project/${caseData.project_id}/interface/case/${params.id}">${params.casename || caseData.casename}</a>`,
|
||||
type: 'project',
|
||||
uid: this.getUid(),
|
||||
username: username,
|
||||
@ -387,11 +386,11 @@ class interfaceColController extends baseController{
|
||||
});
|
||||
});
|
||||
|
||||
this.projectModel.up(caseData.project_id,{up_time: new Date().getTime()}).then();
|
||||
this.projectModel.up(caseData.project_id, { up_time: new Date().getTime() }).then();
|
||||
|
||||
ctx.body = yapi.commons.resReturn(result);
|
||||
|
||||
}catch(e){
|
||||
} catch (e) {
|
||||
ctx.body = yapi.commons.resReturn(null, 402, e.message);
|
||||
}
|
||||
}
|
||||
@ -407,32 +406,32 @@ class interfaceColController extends baseController{
|
||||
* @example
|
||||
*/
|
||||
|
||||
async getCase(ctx){
|
||||
try{
|
||||
async getCase(ctx) {
|
||||
try {
|
||||
let id = ctx.query.caseid;
|
||||
let result = await this.caseModel.get(id);
|
||||
if(!result){
|
||||
if (!result) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, '不存在的case');
|
||||
}
|
||||
result = result.toObject();
|
||||
let data = await this.interfaceModel.get(result.interface_id);
|
||||
if(!data){
|
||||
let data = await this.interfaceModel.get(result.interface_id);
|
||||
if (!data) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, '找不到对应的接口,请联系管理员')
|
||||
}
|
||||
data = data.toObject();
|
||||
let projectData = await this.projectModel.getBaseInfo(data.project_id);
|
||||
let projectData = await this.projectModel.getBaseInfo(data.project_id);
|
||||
result.path = projectData.basepath + data.path;
|
||||
result.method = data.method;
|
||||
result.req_body_type = data.req_body_type;
|
||||
result.req_headers = data.req_headers;
|
||||
result.req_headers = this.handleParamsValue(data.req_headers, result.req_headers);
|
||||
result.res_body = data.res_body;
|
||||
result.res_body_type = data.res_body_type;
|
||||
result.res_body_type = data.res_body_type;
|
||||
result.req_body_form = this.handleParamsValue(data.req_body_form, result.req_body_form)
|
||||
result.req_query = this.handleParamsValue(data.req_query, result.req_query)
|
||||
result.req_params = this.handleParamsValue(data.req_params, result.req_params)
|
||||
|
||||
ctx.body = yapi.commons.resReturn(result);
|
||||
}catch(e){
|
||||
} catch (e) {
|
||||
ctx.body = yapi.commons.resReturn(null, 400, e.message)
|
||||
}
|
||||
}
|
||||
@ -442,21 +441,21 @@ class interfaceColController extends baseController{
|
||||
* @param {*} params 接口定义的参数
|
||||
* @param {*} val 接口case 定义的参数值
|
||||
*/
|
||||
handleParamsValue(params, val){
|
||||
handleParamsValue(params, val) {
|
||||
let value = {};
|
||||
try{
|
||||
try {
|
||||
params = params.toObject();
|
||||
}catch(e){ }
|
||||
if(params.length === 0 || val.length === 0){
|
||||
} catch (e) { }
|
||||
if (params.length === 0 || val.length === 0) {
|
||||
return params;
|
||||
}
|
||||
val.forEach((item, index)=>{
|
||||
val.forEach((item, index) => {
|
||||
value[item.name] = item;
|
||||
})
|
||||
params.forEach((item, index)=>{
|
||||
if(!value[item.name] || typeof value[item.name] !== 'object') return null;
|
||||
params.forEach((item, index) => {
|
||||
if (!value[item.name] || typeof value[item.name] !== 'object') return null;
|
||||
params[index].value = value[item.name].value;
|
||||
if(!_.isUndefined(value[item.name].enable)){
|
||||
if (!_.isUndefined(value[item.name].enable)) {
|
||||
params[index].enable = value[item.name].enable
|
||||
}
|
||||
})
|
||||
@ -475,15 +474,15 @@ class interfaceColController extends baseController{
|
||||
* @example
|
||||
*/
|
||||
|
||||
async upCol(ctx){
|
||||
try{
|
||||
async upCol(ctx) {
|
||||
try {
|
||||
let params = ctx.request.body;
|
||||
let id = params.col_id;
|
||||
if(!id){
|
||||
if (!id) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, '缺少 col_id 参数');
|
||||
}
|
||||
let colData = await this.colModel.get(id);
|
||||
if(!colData){
|
||||
if (!colData) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, '不存在');
|
||||
}
|
||||
let auth = await this.checkAuth(colData.project_id, 'project', 'edit')
|
||||
@ -500,9 +499,9 @@ class interfaceColController extends baseController{
|
||||
username: username,
|
||||
typeid: colData.project_id
|
||||
});
|
||||
|
||||
|
||||
ctx.body = yapi.commons.resReturn(result)
|
||||
}catch(e){
|
||||
} catch (e) {
|
||||
ctx.body = yapi.commons.resReturn(null, 400, e.message)
|
||||
}
|
||||
}
|
||||
@ -518,15 +517,15 @@ class interfaceColController extends baseController{
|
||||
* @example
|
||||
*/
|
||||
|
||||
async upCaseIndex(ctx){
|
||||
try{
|
||||
async upCaseIndex(ctx) {
|
||||
try {
|
||||
let params = ctx.request.body;
|
||||
if(!params || !Array.isArray(params)){
|
||||
ctx.body = yapi.commons.resReturn(null, 400, "请求参数必须是数组")
|
||||
if (!params || !Array.isArray(params)) {
|
||||
ctx.body = yapi.commons.resReturn(null, 400, "请求参数必须是数组")
|
||||
}
|
||||
params.forEach((item) => {
|
||||
if(item.id){
|
||||
this.caseModel.upCaseIndex(item.id, item.index).then((res) => {}, (err) => {
|
||||
if (item.id) {
|
||||
this.caseModel.upCaseIndex(item.id, item.index).then((res) => { }, (err) => {
|
||||
yapi.commons.log(err.message, 'error')
|
||||
})
|
||||
}
|
||||
@ -534,7 +533,7 @@ class interfaceColController extends baseController{
|
||||
});
|
||||
|
||||
return ctx.body = yapi.commons.resReturn('成功!')
|
||||
}catch(e){
|
||||
} catch (e) {
|
||||
ctx.body = yapi.commons.resReturn(null, 400, e.message)
|
||||
}
|
||||
}
|
||||
@ -550,17 +549,17 @@ class interfaceColController extends baseController{
|
||||
* @example
|
||||
*/
|
||||
|
||||
async delCol(ctx){
|
||||
try{
|
||||
async delCol(ctx) {
|
||||
try {
|
||||
let id = ctx.query.col_id;
|
||||
let colData = await this.colModel.get(id);
|
||||
if(!colData){
|
||||
ctx.body = yapi.commons.resReturn(null, 400, "不存在的id")
|
||||
if (!colData) {
|
||||
ctx.body = yapi.commons.resReturn(null, 400, "不存在的id")
|
||||
}
|
||||
|
||||
if(colData.uid !== this.getUid()){
|
||||
if (colData.uid !== this.getUid()) {
|
||||
let auth = await this.checkAuth(colData.project_id, 'project', 'danger')
|
||||
if(!auth){
|
||||
if (!auth) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, '没有权限');
|
||||
}
|
||||
}
|
||||
@ -575,7 +574,7 @@ class interfaceColController extends baseController{
|
||||
typeid: colData.project_id
|
||||
});
|
||||
return ctx.body = yapi.commons.resReturn(result);
|
||||
}catch(e){
|
||||
} catch (e) {
|
||||
yapi.commons.resReturn(null, 400, e.message)
|
||||
}
|
||||
}
|
||||
@ -585,17 +584,17 @@ class interfaceColController extends baseController{
|
||||
* @param {*} ctx
|
||||
*/
|
||||
|
||||
async delCase(ctx){
|
||||
try{
|
||||
async delCase(ctx) {
|
||||
try {
|
||||
let caseid = ctx.query.caseid;
|
||||
let caseData = await this.caseModel.get(caseid);
|
||||
if(!caseData){
|
||||
ctx.body = yapi.commons.resReturn(null, 400, "不存在的caseid")
|
||||
if (!caseData) {
|
||||
ctx.body = yapi.commons.resReturn(null, 400, "不存在的caseid")
|
||||
}
|
||||
|
||||
if(caseData.uid !== this.getUid()){
|
||||
if (caseData.uid !== this.getUid()) {
|
||||
let auth = await this.checkAuth(caseData.project_id, 'project', 'danger')
|
||||
if(!auth){
|
||||
if (!auth) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, '没有权限');
|
||||
}
|
||||
}
|
||||
@ -603,7 +602,7 @@ class interfaceColController extends baseController{
|
||||
let result = await this.caseModel.del(caseid);
|
||||
|
||||
let username = this.getUsername();
|
||||
this.colModel.get(caseData.col_id).then((col)=>{
|
||||
this.colModel.get(caseData.col_id).then((col) => {
|
||||
yapi.commons.saveLog({
|
||||
content: `<a href="/user/profile/${this.getUid()}">${username}</a> 删除了接口集 <a href="/project/${caseData.project_id}/interface/col/${caseData.col_id}">${col.name}</a> 下的接口 ${caseData.casename}`,
|
||||
type: 'project',
|
||||
@ -613,23 +612,23 @@ class interfaceColController extends baseController{
|
||||
});
|
||||
});
|
||||
|
||||
this.projectModel.up(caseData.project_id,{up_time: new Date().getTime()}).then();
|
||||
this.projectModel.up(caseData.project_id, { up_time: new Date().getTime() }).then();
|
||||
return ctx.body = yapi.commons.resReturn(result);
|
||||
|
||||
|
||||
}catch(e){
|
||||
} catch (e) {
|
||||
yapi.commons.resReturn(null, 400, e.message)
|
||||
}
|
||||
}
|
||||
|
||||
async runCaseScript(ctx){
|
||||
async runCaseScript(ctx) {
|
||||
let params = ctx.request.body;
|
||||
let script = params.script;
|
||||
if(!script){
|
||||
return ctx.body = yapi.commons.resReturn('ok');
|
||||
if (!script) {
|
||||
return ctx.body = yapi.commons.resReturn('ok');
|
||||
}
|
||||
|
||||
try{
|
||||
try {
|
||||
let result = yapi.commons.sandbox({
|
||||
assert: require('assert'),
|
||||
status: params.response.status,
|
||||
@ -640,11 +639,11 @@ class interfaceColController extends baseController{
|
||||
log: []
|
||||
}, script);
|
||||
return ctx.body = yapi.commons.resReturn(result);
|
||||
}catch(err){
|
||||
} catch (err) {
|
||||
let errArr = err.stack.split("\n");
|
||||
return ctx.body = yapi.commons.resReturn(errArr, 400, err.message)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<head>
|
||||
<title>YApi 接口管理平台 使用手册</title>
|
||||
<link rel="shortcut icon" href="./images/favicon.ico" />
|
||||
|
||||
<meta name="keywords" content="api管理,接口管理,接口文档,api文档">
|
||||
|
||||
|
||||
<meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
|
||||
<meta name="format-detection" content="telephone=no,email=no" />
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -191,7 +195,7 @@
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2017 <a href="https://github.com/ymfe">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
© 2017 <a href="https://ymfe.org">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
@ -8,8 +8,10 @@ module.exports = {
|
||||
"common": { // 通用默认配置,包括主页配置等
|
||||
"title": "YApi 接口管理平台", //page title
|
||||
"footer": "© 2017 <a href=\"https://ymfe.org\">YMFE</a> Team. Build by <a href=\"http://ued.qunar.com/ydoc/\">ydoc</a> ", // 通用尾
|
||||
"home": '<img src="./images/logo_header@2x.png" /> YAPI', // logo
|
||||
"homeUrl": "./index.html" // logourl
|
||||
"home": '<img src="./images/logo_header@2x.png" /> YAPI',
|
||||
"homeUrl": "./index.html",
|
||||
"keywords": "api管理,接口管理,接口文档,api文档",
|
||||
"description": "YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 API,YApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理。"
|
||||
},
|
||||
"options": {
|
||||
"foldcode": false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user