fix: 修改yapi 教程

This commit is contained in:
gaoxiaolin.gao 2018-07-13 11:43:18 +08:00
parent 4ee7165fc0
commit 6fd03d93c0
26 changed files with 53 additions and 38 deletions

View File

@ -6,6 +6,7 @@
* 测试接口导入支持状态过滤
* json schema 增加枚举备注功能
* 左侧菜单栏可以支持单独滚动条
* 支持新版本通知
#### Bug Fixed

View File

@ -1,7 +1,7 @@
.postman-dataImport{
display: flex;
.dataImportCon{
min-width: 274px;
min-width: 304px;
background-color: #ececec;
padding: 16px;
border-radius: 4px;

View File

@ -36,6 +36,9 @@
<br />
1.生成 JSON 语言编写的 Swagger API 文档文件<div> 例如这样的数据 <a href="http://petstore.swagger.io/v2/swagger.json" target="blank">http://petstore.swagger.io/v2/swagger.json</a>),可以将其内容复制到 JSON 文件中。</div>
<br />
> Tips: v1.3.19 版本开始支持swagger url 导入功能
2.打开yapi平台进入到项目页面点击数据管理选择相应的分组和swagger导入方式,选择刚才的文件,开始导入数据
@ -45,6 +48,9 @@
<div><img class="doc-img" style="width:90%" src="./images/usage/chrome-6.jpg" /></div>
## YApi接口JSON数据导入
该功能在 v1.3.12 版本上线,可导入在 yapi 平台导出的 json 接口数据。

View File

@ -184,7 +184,7 @@ class wikiController extends baseController {
}
break;
case 'editor':
let userInst, userinfo, data;``
let userInst, userinfo, data;
if (result && result.edit_uid !== 0 && result.edit_uid !== this.getUid()) {
userInst = yapi.getInst(userModel);
userinfo = await userInst.findById(result.edit_uid);

View File

@ -1,4 +1,4 @@
<html lang="zh-CN"><head><meta charSet="UTF-8"/><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-status-bar-style" content="black"/><link rel="apple-touch-icon" sizes="180x180" href="../ydoc/images/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="../ydoc/images/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="../ydoc/images/favicon-16x16.png"/><link rel="manifest" href="../ydoc/images/manifest.json"/><link rel="mask-icon" href="../ydoc/images/safari-pinned-tab.svg" color="#5bbad5"/><meta name="theme-color" content="#ffffff"/><meta http-equiv="Cache-Control" content="no-transform"/><meta http-equiv="Cache-Control" content="no-siteapp"/><title>内网部署</title><link rel="stylesheet" href="../ydoc/styles/style.css"/><meta name="author" content="ymfe"/><meta name="keywords" content="api管理,接口管理,接口文档,api文档"/><meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 APIYApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理"/><meta id="releativePath" content=".."/><link rel="stylesheet" href="../ydoc/ydoc-plugin-search/search.css"/><link rel="stylesheet" href="../ydoc/ydoc-plugin-search/search.css"/><link rel="stylesheet" href="../ydoc/ydoc-plugin-img-view/imgView.css"/><link rel="stylesheet" href="../web.css"/></head><body><div class="g-doc"><div class="m-aside"><div class="m-summary" id="js-menu"><div class="m-summary-content" id="js-menu-content"><div class="m-summary-block"><ul class="m-summary-list"><li class="item"><a href="index.html#%e5%ae%89%e8%a3%85" class="href">安装</a></li><li class="item"><a href="index.html#%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%ae%a1%e7%90%86" class="href">服务器管理</a></li><li class="item"><a href="index.html#%e5%8d%87%e7%ba%a7" class="href">升级</a></li><li class="item"><a href="index.html#%e9%85%8d%e7%bd%ae%e9%82%ae%e7%ae%b1" class="href">配置邮箱</a></li><li class="item"><a href="index.html#%e9%85%8d%e7%bd%aeldap%e7%99%bb%e5%bd%95" class="href">配置LDAP登录</a></li><li class="item"><a href="index.html#%e7%a6%81%e6%ad%a2%e6%b3%a8%e5%86%8c" class="href">禁止注册</a></li></ul></div></div></div><div class="m-summary-switch" id="js-summary-switch"><svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="15" height="15" class="bottom"><g transform="translate(904.92214,-879.1482)"><path d="m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,-55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,0 79.8637,78.60862 175.9427,174.68583 l 174.6892,174.6858 174.6892,-174.6858 c 96.079,-96.07721 175.253196,-174.68583 175.942696,-174.68583 0.6895,0 26.281,25.03215 56.8701,55.627 l 55.6165,55.627 -231.245496,231.24803 c -127.185,127.1864-231.5279,231.248 -231.873,231.248 -0.3451,0 -104.688,-104.0616 -231.873,-231.248 z" fill="#fff"></path></g></svg><svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="15" height="15" class="top"><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="aaa" fill="#fff" fill-rule="nonzero"><path d="M231.2455,342.502 L0,111.25397 L55.6165,55.62697 C86.2056,25.03212 111.7971,-2.99999998e-05 112.4866,-2.99999998e-05 C113.176,-2.99999998e-05 192.3503,78.60859 288.4293,174.6858 L463.1185,349.3716 L637.8077,174.6858 C733.8867,78.60859 813.060896,-2.99999997e-05 813.750396,-2.99999997e-05 C814.439896,-2.99999997e-05 840.031396,25.03212 870.620496,55.62697 L926.236996,111.25397 L694.9915,342.502 C567.8065,469.6884 463.4636,573.75 463.1185,573.75 C462.7734,573.75 358.4305,469.6884 231.2455,342.502 Z" id="Shape" transform="translate(463.118498, 286.874985) scale(1, -1) translate(-463.118498, -286.874985) "></path></g></g></svg></div></div><div class="m-main" id="js-panel"><header class="m-header" id="js-header"><div class="m-header-title js-logo"><a href="../index.html" target="_self"><img class="logo" width="36" src="../documents/images/logo_header@2x.png"/><h6 class="name">YApi</h6></a></div><div><div class="m-search">
<html lang="zh-CN"><head><meta charSet="UTF-8"/><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-status-bar-style" content="black"/><link rel="apple-touch-icon" sizes="180x180" href="../ydoc/images/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="../ydoc/images/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="../ydoc/images/favicon-16x16.png"/><link rel="manifest" href="../ydoc/images/manifest.json"/><link rel="mask-icon" href="../ydoc/images/safari-pinned-tab.svg&quot;" color="#5bbad5"/><meta name="theme-color" content="#ffffff"/><meta http-equiv="Cache-Control" content="no-transform"/><meta http-equiv="Cache-Control" content="no-siteapp"/><title>内网部署</title><link rel="stylesheet" href="../ydoc/styles/style.css"/><meta name="author" content="ymfe"/><meta name="keywords" content="api管理,接口管理,接口文档,api文档"/><meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 APIYApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理"/><meta id="releativePath" content=".."/><link rel="stylesheet" href="../ydoc/ydoc-plugin-search/search.css"/><link rel="stylesheet" href="../ydoc/ydoc-plugin-search/search.css"/><link rel="stylesheet" href="../ydoc/ydoc-plugin-img-view/imgView.css"/><link rel="stylesheet" href="../web.css"/></head><body><div class="g-doc"><div class="m-aside"><div class="m-summary" id="js-menu"><div class="m-summary-content" id="js-menu-content"><div class="m-summary-block"><ul class="m-summary-list"><li class="item"><a href="index.html#%e5%ae%89%e8%a3%85" class="href">安装</a></li><li class="item"><a href="index.html#%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%ae%a1%e7%90%86" class="href">服务器管理</a></li><li class="item"><a href="index.html#%e5%8d%87%e7%ba%a7" class="href">升级</a></li><li class="item"><a href="index.html#%e9%85%8d%e7%bd%ae%e9%82%ae%e7%ae%b1" class="href">配置邮箱</a></li><li class="item"><a href="index.html#%e9%85%8d%e7%bd%aeldap%e7%99%bb%e5%bd%95" class="href">配置LDAP登录</a></li><li class="item"><a href="index.html#%e7%a6%81%e6%ad%a2%e6%b3%a8%e5%86%8c" class="href">禁止注册</a></li></ul></div></div></div><div class="m-summary-switch" id="js-summary-switch"><svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="15" height="15" class="bottom"><g transform="translate(904.92214,-879.1482)"><path d="m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,-55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,0 79.8637,78.60862 175.9427,174.68583 l 174.6892,174.6858 174.6892,-174.6858 c 96.079,-96.07721 175.253196,-174.68583 175.942696,-174.68583 0.6895,0 26.281,25.03215 56.8701,55.627 l 55.6165,55.627 -231.245496,231.24803 c -127.185,127.1864-231.5279,231.248 -231.873,231.248 -0.3451,0 -104.688,-104.0616 -231.873,-231.248 z" fill="#fff"></path></g></svg><svg viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="15" height="15" class="top"><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="aaa" fill="#fff" fill-rule="nonzero"><path d="M231.2455,342.502 L0,111.25397 L55.6165,55.62697 C86.2056,25.03212 111.7971,-2.99999998e-05 112.4866,-2.99999998e-05 C113.176,-2.99999998e-05 192.3503,78.60859 288.4293,174.6858 L463.1185,349.3716 L637.8077,174.6858 C733.8867,78.60859 813.060896,-2.99999997e-05 813.750396,-2.99999997e-05 C814.439896,-2.99999997e-05 840.031396,25.03212 870.620496,55.62697 L926.236996,111.25397 L694.9915,342.502 C567.8065,469.6884 463.4636,573.75 463.1185,573.75 C462.7734,573.75 358.4305,469.6884 231.2455,342.502 Z" id="Shape" transform="translate(463.118498, 286.874985) scale(1, -1) translate(-463.118498, -286.874985) "></path></g></g></svg></div></div><div class="m-main" id="js-panel"><header class="m-header" id="js-header"><div class="m-header-title js-logo"><a href="../index.html" target="_self"><img class="logo" width="36" src="../documents/images/logo_header@2x.png"/><h6 class="name">YApi</h6></a></div><div><div class="m-search">
<div class="icon">&#xf0fd;</div>
<input type="text" class="input js-input" placeholder="搜索" />
<div class="m-search-result js-search-result"></div>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
<html lang="zh-CN"><head><meta charSet="UTF-8"/><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-status-bar-style" content="black"/><link rel="apple-touch-icon" sizes="180x180" href="ydoc/images/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="ydoc/images/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="ydoc/images/favicon-16x16.png"/><link rel="manifest" href="ydoc/images/manifest.json"/><link rel="mask-icon" href="ydoc/images/safari-pinned-tab.svg" color="#5bbad5"/><meta name="theme-color" content="#ffffff"/><meta http-equiv="Cache-Control" content="no-transform"/><meta http-equiv="Cache-Control" content="no-siteapp"/><title>YApi 接口管理平台</title><link rel="stylesheet" href="ydoc/styles/style.css"/><meta name="author" content="ymfe"/><meta name="keywords" content="api管理,接口管理,接口文档,api文档"/><meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 APIYApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理"/><meta id="releativePath" content=""/><link rel="stylesheet" href="ydoc/ydoc-plugin-search/search.css"/><link rel="stylesheet" href="ydoc/ydoc-plugin-search/search.css"/><link rel="stylesheet" href="ydoc/ydoc-plugin-img-view/imgView.css"/><link rel="stylesheet" href="web.css"/></head><body><div class="g-doc"><div class="m-main" id="js-panel"><header class="m-header" id="js-header"><div class="m-header-title js-logo"><a href="" target="_self"><img class="logo" width="36" src="documents/images/logo_header@2x.png"/><h6 class="name">YApi</h6></a></div><div><div class="m-search">
<html lang="zh-CN"><head><meta charSet="UTF-8"/><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/><meta name="apple-mobile-web-app-capable" content="yes"/><meta name="apple-mobile-web-app-status-bar-style" content="black"/><link rel="apple-touch-icon" sizes="180x180" href="ydoc/images/apple-touch-icon.png"/><link rel="icon" type="image/png" sizes="32x32" href="ydoc/images/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="16x16" href="ydoc/images/favicon-16x16.png"/><link rel="manifest" href="ydoc/images/manifest.json"/><link rel="mask-icon" href="ydoc/images/safari-pinned-tab.svg&quot;" color="#5bbad5"/><meta name="theme-color" content="#ffffff"/><meta http-equiv="Cache-Control" content="no-transform"/><meta http-equiv="Cache-Control" content="no-siteapp"/><title>YApi 接口管理平台</title><link rel="stylesheet" href="ydoc/styles/style.css"/><meta name="author" content="ymfe"/><meta name="keywords" content="api管理,接口管理,接口文档,api文档"/><meta name="description" content="YApi 是高效、易用、功能强大的 api 管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。可以帮助开发者轻松创建、发布、维护 APIYApi 还为用户提供了优秀的交互体验,开发人员只需利用平台提供的接口数据写入工具以及简单的点击操作就可以实现接口的管理"/><meta id="releativePath" content=""/><link rel="stylesheet" href="ydoc/ydoc-plugin-search/search.css"/><link rel="stylesheet" href="ydoc/ydoc-plugin-search/search.css"/><link rel="stylesheet" href="ydoc/ydoc-plugin-img-view/imgView.css"/><link rel="stylesheet" href="web.css"/></head><body><div class="g-doc"><div class="m-main" id="js-panel"><header class="m-header" id="js-header"><div class="m-header-title js-logo"><a href="" target="_self"><img class="logo" width="36" src="documents/images/logo_header@2x.png"/><h6 class="name">YApi</h6></a></div><div><div class="m-search">
<div class="icon">&#xf0fd;</div>
<input type="text" class="input js-input" placeholder="搜索" />
<div class="m-search-result js-search-result"></div>

View File

@ -720,7 +720,7 @@ window.ydoc_plugin_search_json = {
{
"title": "Swagger 数据导入",
"url": "/documents/data.html#swagger-数据导入",
"content": "Swagger 数据导入什么是 Swagger [Swagger从入门到精通](https://www.gitbook.com/book/huangwenchao/swagger/details)1.生成 JSON 语言编写的 Swagger API 文档文件 例如这样的数据 http://petstore.swagger.io/v2/swagger.json可以将其内容复制到 JSON 文件中。2.打开yapi平台进入到项目页面点击数据管理选择相应的分组和swagger导入\b方式\b选择刚才的文件开始导入数据"
"content": "Swagger 数据导入什么是 Swagger [Swagger从入门到精通](https://www.gitbook.com/book/huangwenchao/swagger/details)1.生成 JSON 语言编写的 Swagger API 文档文件 例如这样的数据 http://petstore.swagger.io/v2/swagger.json可以将其内容复制到 JSON 文件中。Tips: v1.3.19 版本开始支持swagger url 导入功能\n2.打开yapi平台进入到项目页面点击数据管理选择相应的分组和swagger导入\b方式\b选择刚才的文件开始导入数据"
},
{
"title": "YApi接口JSON数据导入",
@ -757,7 +757,7 @@ window.ydoc_plugin_search_json = {
{
"title": "Swagger 数据导入",
"url": "/documents/data.html#swagger-数据导入",
"content": "Swagger 数据导入什么是 Swagger [Swagger从入门到精通](https://www.gitbook.com/book/huangwenchao/swagger/details)1.生成 JSON 语言编写的 Swagger API 文档文件 例如这样的数据 http://petstore.swagger.io/v2/swagger.json可以将其内容复制到 JSON 文件中。2.打开yapi平台进入到项目页面点击数据管理选择相应的分组和swagger导入\b方式\b选择刚才的文件开始导入数据"
"content": "Swagger 数据导入什么是 Swagger [Swagger从入门到精通](https://www.gitbook.com/book/huangwenchao/swagger/details)1.生成 JSON 语言编写的 Swagger API 文档文件 例如这样的数据 http://petstore.swagger.io/v2/swagger.json可以将其内容复制到 JSON 文件中。Tips: v1.3.19 版本开始支持swagger url 导入功能\n2.打开yapi平台进入到项目页面点击数据管理选择相应的分组和swagger导入\b方式\b选择刚才的文件开始导入数据"
},
{
"title": "YApi接口JSON数据导入",
@ -1152,7 +1152,7 @@ window.ydoc_plugin_search_json = {
{
"title": "v1.3.19",
"url": "/documents/CHANGELOG.html#v1.3.19",
"content": "v1.3.19增加项目文档记录wiki\nBug Fixed修复测试用例名称为空时保存测试用例出现的bug\n"
"content": "v1.3.19增加项目文档记录wiki\n支持swagger URL 导入\n接口运行和测试集合中加入参数备注信息\n测试接口导入支持状态过滤\njson schema 增加枚举备注功能\n左侧菜单栏可以支持单独滚动条\n支持新版本通知\nBug Fixed修复测试用例名称为空时保存测试用例出现的bug\n导出markdown 路径参数处格式错误和参数table备注信息换行后样式错误\n"
},
{
"title": "v1.3.18",
@ -1314,7 +1314,7 @@ window.ydoc_plugin_search_json = {
{
"title": "v1.3.19",
"url": "/documents/CHANGELOG.html#v1.3.19",
"content": "v1.3.19增加项目文档记录wiki\nBug Fixed修复测试用例名称为空时保存测试用例出现的bug\n"
"content": "v1.3.19增加项目文档记录wiki\n支持swagger URL 导入\n接口运行和测试集合中加入参数备注信息\n测试接口导入支持状态过滤\njson schema 增加枚举备注功能\n左侧菜单栏可以支持单独滚动条\n支持新版本通知\nBug Fixed修复测试用例名称为空时保存测试用例出现的bug\n导出markdown 路径参数处格式错误和参数table备注信息换行后样式错误\n"
},
{
"title": "v1.3.18",

View File

@ -26,7 +26,6 @@ body {
::-webkit-scrollbar {
width: 6px;
height: 4px;
}
::-webkit-scrollbar-track {
@ -91,7 +90,7 @@ h6, .h6 {
::before,
::after {
box-sizing: border-box;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-tap-highlight-color: transparent;
}
html {
@ -217,7 +216,7 @@ input::-moz-focus-inner {
}
mark {
background-color: rgba(0, 0, 0, 0);
background-color: transparent;
}
a,
@ -583,7 +582,7 @@ a:link, a:visited {
}
.nav-toggle {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
@ -1652,7 +1651,7 @@ pre[class*="language-"] {
padding: .12rem;
cursor: pointer;
transition: color 0.2s;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
@ -1780,9 +1779,8 @@ pre[class*="language-"] {
margin-bottom: .16rem;
}
.m-summary-block.active > .href {
font-weight: bold;
color: #1890ff;
.m-summary-block .m-summary-block {
margin-bottom: 0;
}
.m-summary-title {

View File

@ -35,8 +35,7 @@ $(function(){
var index = str.indexOf(val);
var startIndex = index > highlightTextPrevNum ? index - highlightTextPrevNum : 0;
var sliceStr = str.slice(startIndex, index + val.length + highlightTextNextNum);
var reg = new RegExp('(' + val + ')', 'gi'); // 搜索的值进行高亮替换时, 忽略大小写
var addHighlightStr = sliceStr.replace(reg, '<span class="highlight">' + '$1' + '</span>');
var addHighlightStr = sliceStr.replace(val, '<span class="highlight">' + val + '</span>');
var ellipsis = (sliceStr.lastIndexOf(val) != -1) || (sliceStr.lastIndexOf(val) > highlightTextNextNum) ? '...' : '';
return addHighlightStr + ellipsis;
}