mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-06 12:45:22 +08:00
Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev
This commit is contained in:
commit
3589c254e2
@ -206,9 +206,14 @@ class ProjectData extends Component {
|
||||
|
||||
handleAddInterface(info){
|
||||
if(this.state.selectCatid){
|
||||
let filename = info.file.name;
|
||||
let filetype = filename.substr(filename.lastIndexOf(".")).toLowerCase();
|
||||
// console.log(filename,filetype);
|
||||
if(filetype != ".json") return message.error("文件格式只能为json");
|
||||
let reader = new FileReader();
|
||||
reader.readAsText(info.file);
|
||||
reader.onload = (res)=>{
|
||||
|
||||
res = res.target.result;
|
||||
try{
|
||||
res = JSON.parse(res);
|
||||
|
5
doc/usage/project.md
Normal file
5
doc/usage/project.md
Normal file
@ -0,0 +1,5 @@
|
||||
## 介绍
|
||||
|
||||
## 安装 crossRequest chrome 插件
|
||||
|
||||
## 使用说明
|
5
doc/usage/run.md
Normal file
5
doc/usage/run.md
Normal file
@ -0,0 +1,5 @@
|
||||
## 介绍
|
||||
|
||||
## 安装 crossRequest chrome 插件
|
||||
|
||||
## 使用说明
|
5363
static/doc/api.html
5363
static/doc/api.html
File diff suppressed because it is too large
Load Diff
@ -9,13 +9,7 @@
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<title>YApi 首页</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -38,6 +32,11 @@
|
||||
<a href="usage.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="manage.html">管理学院</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></a>
|
||||
@ -75,7 +74,7 @@
|
||||
|
||||
<div class="ydoc-container">
|
||||
|
||||
<div class="ydoc-container-content ydoc-container-home" id="readme">
|
||||
<div class="ydoc-container-content" id="readme">
|
||||
|
||||
|
||||
<h1 class="home-page-title">为API开发者设计的管理平台</h1>
|
||||
@ -150,7 +149,7 @@
|
||||
<script src="source/app.js"></script>
|
||||
|
||||
<script>
|
||||
var lineHeight = 18;
|
||||
var lineHeight = 17.4;
|
||||
var EXAMPLE_MAX_HEIGHT;
|
||||
|
||||
function fold() {
|
||||
@ -174,8 +173,8 @@
|
||||
var $this = $(this);
|
||||
$this.removeClass('extend').addClass('fold');
|
||||
$this.html('折叠代码');
|
||||
$this.parent().children('.js-code').height('auto');
|
||||
$this.parent().height('auto');
|
||||
$this.prev().height('auto');
|
||||
$this.prev().parent().height('auto');
|
||||
});
|
||||
$('.ydoc-example').delegate('.fold', 'click', function() {
|
||||
var $this = $(this);
|
||||
@ -183,7 +182,7 @@
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
$this.removeClass('fold').addClass('extend');
|
||||
$this.parent().height(EXAMPLE_MAX_HEIGHT); // pre
|
||||
$this.parent().children('.js-code').height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.prev().height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
|
170
static/doc/manage-介绍.html
Normal file
170
static/doc/manage-介绍.html
Normal file
@ -0,0 +1,170 @@
|
||||
<!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">
|
||||
<title>YApi 管理学院</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
<header class="ydoc-header">
|
||||
<div class="ydoc-header-area">
|
||||
|
||||
<a href="http://ued.qunar.com/ymfe/" class="navbar-brand">YMFE</a>
|
||||
|
||||
<button class="ydocIcon navbar-toggle"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="index.html">首页</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="usage.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="manage.html">管理学院</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- <header style="height:20px"></header> -->
|
||||
|
||||
<!-- Docs page layout -->
|
||||
|
||||
<div class="ydoc-banner-bg">
|
||||
<div class="ydoc-banner ">
|
||||
<div class="ydoc-banner-area">
|
||||
<h1 >管理学院</h1>
|
||||
<p class="desc ">超级管理员、分组/项目组长的学院。</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ydoc-container">
|
||||
|
||||
<div class="ydoc-container-content">
|
||||
|
||||
|
||||
<div class="content-left " role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="manage-介绍.html">介绍</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage-部署.html">部署</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage-超管职责.html">超管职责</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage-版本升级.html">版本升级</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body " role="main">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2016 <a href="http://ued.qunar.com/ymfe/">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>.
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="open-panel"></div>
|
||||
<div class="mask"></div>
|
||||
|
||||
|
||||
<script src="source/main.js"></script>
|
||||
<script src="source/app.js"></script>
|
||||
|
||||
<script>
|
||||
var lineHeight = 17.4;
|
||||
var EXAMPLE_MAX_HEIGHT;
|
||||
|
||||
function fold() {
|
||||
// 折叠code
|
||||
$('.markdown-body pre').css({
|
||||
"line-height": lineHeight + "px"
|
||||
});
|
||||
$('.markdown-body pre').map(function(i, item) {
|
||||
var $item = $(item);
|
||||
var foldnumber = $item.data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
if ($item.height() > EXAMPLE_MAX_HEIGHT) {
|
||||
$item.css({
|
||||
"padding-bottom": 30
|
||||
});
|
||||
$item.find('code').height(EXAMPLE_MAX_HEIGHT);
|
||||
$item.append('<span class="extend">展开更多……</span>');
|
||||
};
|
||||
});
|
||||
$('.ydoc-example').delegate('.extend', 'click', function() {
|
||||
var $this = $(this);
|
||||
$this.removeClass('extend').addClass('fold');
|
||||
$this.html('折叠代码');
|
||||
$this.prev().height('auto');
|
||||
$this.prev().parent().height('auto');
|
||||
});
|
||||
$('.ydoc-example').delegate('.fold', 'click', function() {
|
||||
var $this = $(this);
|
||||
var foldnumber = $this.parent().data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
$this.removeClass('fold').addClass('extend');
|
||||
$this.parent().height(EXAMPLE_MAX_HEIGHT); // pre
|
||||
$this.prev().height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
171
static/doc/manage-版本升级.html
Normal file
171
static/doc/manage-版本升级.html
Normal file
@ -0,0 +1,171 @@
|
||||
<!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">
|
||||
<title>YApi 管理学院</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
<header class="ydoc-header">
|
||||
<div class="ydoc-header-area">
|
||||
|
||||
<a href="http://ued.qunar.com/ymfe/" class="navbar-brand">YMFE</a>
|
||||
|
||||
<button class="ydocIcon navbar-toggle"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="index.html">首页</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="usage.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="manage.html">管理学院</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- <header style="height:20px"></header> -->
|
||||
|
||||
<!-- Docs page layout -->
|
||||
|
||||
<div class="ydoc-banner-bg">
|
||||
<div class="ydoc-banner ">
|
||||
<div class="ydoc-banner-area">
|
||||
<h1 >管理学院</h1>
|
||||
<p class="desc ">超级管理员、分组/项目组长的学院。</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ydoc-container">
|
||||
|
||||
<div class="ydoc-container-content">
|
||||
|
||||
|
||||
<div class="content-left " role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage-介绍.html">介绍</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage-部署.html">部署</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage-超管职责.html">超管职责</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="manage-版本升级.html">版本升级</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body " role="main">
|
||||
|
||||
<p>版本升级</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2016 <a href="http://ued.qunar.com/ymfe/">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>.
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="open-panel"></div>
|
||||
<div class="mask"></div>
|
||||
|
||||
|
||||
<script src="source/main.js"></script>
|
||||
<script src="source/app.js"></script>
|
||||
|
||||
<script>
|
||||
var lineHeight = 17.4;
|
||||
var EXAMPLE_MAX_HEIGHT;
|
||||
|
||||
function fold() {
|
||||
// 折叠code
|
||||
$('.markdown-body pre').css({
|
||||
"line-height": lineHeight + "px"
|
||||
});
|
||||
$('.markdown-body pre').map(function(i, item) {
|
||||
var $item = $(item);
|
||||
var foldnumber = $item.data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
if ($item.height() > EXAMPLE_MAX_HEIGHT) {
|
||||
$item.css({
|
||||
"padding-bottom": 30
|
||||
});
|
||||
$item.find('code').height(EXAMPLE_MAX_HEIGHT);
|
||||
$item.append('<span class="extend">展开更多……</span>');
|
||||
};
|
||||
});
|
||||
$('.ydoc-example').delegate('.extend', 'click', function() {
|
||||
var $this = $(this);
|
||||
$this.removeClass('extend').addClass('fold');
|
||||
$this.html('折叠代码');
|
||||
$this.prev().height('auto');
|
||||
$this.prev().parent().height('auto');
|
||||
});
|
||||
$('.ydoc-example').delegate('.fold', 'click', function() {
|
||||
var $this = $(this);
|
||||
var foldnumber = $this.parent().data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
$this.removeClass('fold').addClass('extend');
|
||||
$this.parent().height(EXAMPLE_MAX_HEIGHT); // pre
|
||||
$this.prev().height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
186
static/doc/manage-超管职责.html
Normal file
186
static/doc/manage-超管职责.html
Normal file
@ -0,0 +1,186 @@
|
||||
<!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">
|
||||
<title>YApi 管理学院</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
<header class="ydoc-header">
|
||||
<div class="ydoc-header-area">
|
||||
|
||||
<a href="http://ued.qunar.com/ymfe/" class="navbar-brand">YMFE</a>
|
||||
|
||||
<button class="ydocIcon navbar-toggle"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="index.html">首页</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="usage.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="manage.html">管理学院</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- <header style="height:20px"></header> -->
|
||||
|
||||
<!-- Docs page layout -->
|
||||
|
||||
<div class="ydoc-banner-bg">
|
||||
<div class="ydoc-banner ">
|
||||
<div class="ydoc-banner-area">
|
||||
<h1 >管理学院</h1>
|
||||
<p class="desc ">超级管理员、分组/项目组长的学院。</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ydoc-container">
|
||||
|
||||
<div class="ydoc-container-content">
|
||||
|
||||
|
||||
<div class="content-left " role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage-介绍.html">介绍</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage-部署.html">部署</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="manage-超管职责.html">超管职责</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#用户管理">用户管理</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#分配组长">分配组长</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#维护数据库">维护数据库</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage-版本升级.html">版本升级</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body " role="main">
|
||||
|
||||
<h2 class="subject" id="用户管理">用户管理 <a class="hashlink" href="#用户管理">#</a></h2><h2 class="subject" id="分配组长">分配组长 <a class="hashlink" href="#分配组长">#</a></h2><h2 class="subject" id="维护数据库">维护数据库 <a class="hashlink" href="#维护数据库">#</a></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2016 <a href="http://ued.qunar.com/ymfe/">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>.
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="open-panel"></div>
|
||||
<div class="mask"></div>
|
||||
|
||||
|
||||
<script src="source/main.js"></script>
|
||||
<script src="source/app.js"></script>
|
||||
|
||||
<script>
|
||||
var lineHeight = 17.4;
|
||||
var EXAMPLE_MAX_HEIGHT;
|
||||
|
||||
function fold() {
|
||||
// 折叠code
|
||||
$('.markdown-body pre').css({
|
||||
"line-height": lineHeight + "px"
|
||||
});
|
||||
$('.markdown-body pre').map(function(i, item) {
|
||||
var $item = $(item);
|
||||
var foldnumber = $item.data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
if ($item.height() > EXAMPLE_MAX_HEIGHT) {
|
||||
$item.css({
|
||||
"padding-bottom": 30
|
||||
});
|
||||
$item.find('code').height(EXAMPLE_MAX_HEIGHT);
|
||||
$item.append('<span class="extend">展开更多……</span>');
|
||||
};
|
||||
});
|
||||
$('.ydoc-example').delegate('.extend', 'click', function() {
|
||||
var $this = $(this);
|
||||
$this.removeClass('extend').addClass('fold');
|
||||
$this.html('折叠代码');
|
||||
$this.prev().height('auto');
|
||||
$this.prev().parent().height('auto');
|
||||
});
|
||||
$('.ydoc-example').delegate('.fold', 'click', function() {
|
||||
var $this = $(this);
|
||||
var foldnumber = $this.parent().data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
$this.removeClass('fold').addClass('extend');
|
||||
$this.parent().height(EXAMPLE_MAX_HEIGHT); // pre
|
||||
$this.prev().height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
182
static/doc/manage-部署.html
Normal file
182
static/doc/manage-部署.html
Normal file
@ -0,0 +1,182 @@
|
||||
<!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">
|
||||
<title>YApi 管理学院</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
<header class="ydoc-header">
|
||||
<div class="ydoc-header-area">
|
||||
|
||||
<a href="http://ued.qunar.com/ymfe/" class="navbar-brand">YMFE</a>
|
||||
|
||||
<button class="ydocIcon navbar-toggle"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="index.html">首页</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="usage.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="manage.html">管理学院</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- <header style="height:20px"></header> -->
|
||||
|
||||
<!-- Docs page layout -->
|
||||
|
||||
<div class="ydoc-banner-bg">
|
||||
<div class="ydoc-banner ">
|
||||
<div class="ydoc-banner-area">
|
||||
<h1 >管理学院</h1>
|
||||
<p class="desc ">超级管理员、分组/项目组长的学院。</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ydoc-container">
|
||||
|
||||
<div class="ydoc-container-content">
|
||||
|
||||
|
||||
<div class="content-left " role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage-介绍.html">介绍</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="manage-部署.html">部署</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#快速部署">快速部署</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#配置说明">配置说明</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage-超管职责.html">超管职责</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage-版本升级.html">版本升级</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body " role="main">
|
||||
|
||||
<h2 class="subject" id="快速部署">快速部署 <a class="hashlink" href="#快速部署">#</a></h2><h2 class="subject" id="配置说明11">配置说明 <a class="hashlink" href="#配置说明11">#</a></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2016 <a href="http://ued.qunar.com/ymfe/">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>.
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="open-panel"></div>
|
||||
<div class="mask"></div>
|
||||
|
||||
|
||||
<script src="source/main.js"></script>
|
||||
<script src="source/app.js"></script>
|
||||
|
||||
<script>
|
||||
var lineHeight = 17.4;
|
||||
var EXAMPLE_MAX_HEIGHT;
|
||||
|
||||
function fold() {
|
||||
// 折叠code
|
||||
$('.markdown-body pre').css({
|
||||
"line-height": lineHeight + "px"
|
||||
});
|
||||
$('.markdown-body pre').map(function(i, item) {
|
||||
var $item = $(item);
|
||||
var foldnumber = $item.data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
if ($item.height() > EXAMPLE_MAX_HEIGHT) {
|
||||
$item.css({
|
||||
"padding-bottom": 30
|
||||
});
|
||||
$item.find('code').height(EXAMPLE_MAX_HEIGHT);
|
||||
$item.append('<span class="extend">展开更多……</span>');
|
||||
};
|
||||
});
|
||||
$('.ydoc-example').delegate('.extend', 'click', function() {
|
||||
var $this = $(this);
|
||||
$this.removeClass('extend').addClass('fold');
|
||||
$this.html('折叠代码');
|
||||
$this.prev().height('auto');
|
||||
$this.prev().parent().height('auto');
|
||||
});
|
||||
$('.ydoc-example').delegate('.fold', 'click', function() {
|
||||
var $this = $(this);
|
||||
var foldnumber = $this.parent().data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
$this.removeClass('fold').addClass('extend');
|
||||
$this.parent().height(EXAMPLE_MAX_HEIGHT); // pre
|
||||
$this.prev().height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
170
static/doc/manage.html
Normal file
170
static/doc/manage.html
Normal file
@ -0,0 +1,170 @@
|
||||
<!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">
|
||||
<title>YApi 管理学院</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
<header class="ydoc-header">
|
||||
<div class="ydoc-header-area">
|
||||
|
||||
<a href="http://ued.qunar.com/ymfe/" class="navbar-brand">YMFE</a>
|
||||
|
||||
<button class="ydocIcon navbar-toggle"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="index.html">首页</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="usage.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="manage.html">管理学院</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- <header style="height:20px"></header> -->
|
||||
|
||||
<!-- Docs page layout -->
|
||||
|
||||
<div class="ydoc-banner-bg">
|
||||
<div class="ydoc-banner ">
|
||||
<div class="ydoc-banner-area">
|
||||
<h1 >管理学院</h1>
|
||||
<p class="desc ">超级管理员、分组/项目组长的学院。</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ydoc-container">
|
||||
|
||||
<div class="ydoc-container-content">
|
||||
|
||||
|
||||
<div class="content-left " role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage-介绍.html">介绍</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage-部署.html">部署</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage-超管职责.html">超管职责</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage-版本升级.html">版本升级</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body " role="main">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2016 <a href="http://ued.qunar.com/ymfe/">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>.
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="open-panel"></div>
|
||||
<div class="mask"></div>
|
||||
|
||||
|
||||
<script src="source/main.js"></script>
|
||||
<script src="source/app.js"></script>
|
||||
|
||||
<script>
|
||||
var lineHeight = 17.4;
|
||||
var EXAMPLE_MAX_HEIGHT;
|
||||
|
||||
function fold() {
|
||||
// 折叠code
|
||||
$('.markdown-body pre').css({
|
||||
"line-height": lineHeight + "px"
|
||||
});
|
||||
$('.markdown-body pre').map(function(i, item) {
|
||||
var $item = $(item);
|
||||
var foldnumber = $item.data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
if ($item.height() > EXAMPLE_MAX_HEIGHT) {
|
||||
$item.css({
|
||||
"padding-bottom": 30
|
||||
});
|
||||
$item.find('code').height(EXAMPLE_MAX_HEIGHT);
|
||||
$item.append('<span class="extend">展开更多……</span>');
|
||||
};
|
||||
});
|
||||
$('.ydoc-example').delegate('.extend', 'click', function() {
|
||||
var $this = $(this);
|
||||
$this.removeClass('extend').addClass('fold');
|
||||
$this.html('折叠代码');
|
||||
$this.prev().height('auto');
|
||||
$this.prev().parent().height('auto');
|
||||
});
|
||||
$('.ydoc-example').delegate('.fold', 'click', function() {
|
||||
var $this = $(this);
|
||||
var foldnumber = $this.parent().data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
$this.removeClass('fold').addClass('extend');
|
||||
$this.parent().height(EXAMPLE_MAX_HEIGHT); // pre
|
||||
$this.prev().height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -129,10 +129,26 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
$('.markdown-body pre').map(function(i, item) {
|
||||
$(item).addClass('ydoc-example').append('<div class="ui-copy js-copy" data-clipboard-action="copy" data-clipboard-target=".js-code-' + i + '" data-copy-number="' + i + '">copy</div><div class="copy-tip copy-tip-' + i + '">已复制</div>');
|
||||
$(item).children('code').addClass('js-code-'+i);
|
||||
$(item).addClass('ydoc-example');
|
||||
});
|
||||
|
||||
// $('code').each(function(i, block) {
|
||||
// if (block.innerHTML.indexOf('\n') != -1) {
|
||||
// var pn = block.parentNode;
|
||||
// if (pn.tagName.toUpperCase() == 'PRE') {
|
||||
// try {
|
||||
// hljs.highlightBlock(block);
|
||||
// } catch(e) {}
|
||||
// } else {
|
||||
// pn.innerHTML = '<pre><code>' + block.innerHTML + '</code></pre>';
|
||||
// try {
|
||||
// hljs.highlightBlock(pn.childNodes[0].childNodes[0]);
|
||||
// } catch(e) {}
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
var winHeight = $(window).height() - 44,
|
||||
sidebar = $('.docs-sidebar');
|
||||
var docSideNav = $('.docs-sidenav');
|
||||
@ -189,9 +205,46 @@ $(document).ready(function() {
|
||||
|
||||
// 退出全屏浏览器窗口大小改变,不触发resize
|
||||
$(window).on('resize', function(e) {
|
||||
resizeSidebar();
|
||||
$contentLeftWidth = $contentLeft.width() - 1;
|
||||
});
|
||||
|
||||
function resizeSidebar() {
|
||||
var winHeight = $(window).height() - 44,
|
||||
sidebar = $('.docs-sidebar');
|
||||
var docSideNav = $('.docs-sidenav');
|
||||
if (winWidth > 767) {
|
||||
docSideNav.width($contentLeftWidth);
|
||||
}
|
||||
if (sidebar.height() > winHeight) {
|
||||
sidebar.css('max-height', winHeight + 'px');
|
||||
$('.docs-sidenav').css('max-height', winHeight + 'px');
|
||||
$('.docs-sidenav').css({
|
||||
'overflow-y': 'scroll',
|
||||
'overflow-x': 'hidden'
|
||||
});
|
||||
var barScroll = false;
|
||||
|
||||
sidebar.on('mouseover', function() {
|
||||
barScroll = true;
|
||||
});
|
||||
|
||||
sidebar.on('mouseout', function() {
|
||||
barScroll = false;
|
||||
});
|
||||
// scroll
|
||||
if ($(window).scrollTop() > ($('.footer').offset().top - $(window).height())) {
|
||||
winHeight = $(window).height() - $('.footer').outerHeight() - 44;
|
||||
sidebar.css('max-height', winHeight + 'px');
|
||||
$('.docs-sidenav').css('max-height', winHeight + 'px');
|
||||
} else {
|
||||
winHeight = $(window).height() - 44;
|
||||
sidebar.css('max-height', winHeight + 'px');
|
||||
$('.docs-sidenav').css('max-height', winHeight + 'px');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function sortAsOffset(propertyName) {
|
||||
return function(obj1, obj2) {
|
||||
var val1 = obj1[propertyName];
|
||||
@ -214,17 +267,4 @@ $(document).ready(function() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// 代码复制功能
|
||||
var clipboard = new Clipboard('.js-copy');
|
||||
|
||||
clipboard.on('success', function(e) {
|
||||
var copyNumber = $(e.trigger).attr('data-copy-number');
|
||||
$('.copy-tip-'+copyNumber).show();
|
||||
setTimeout(function() {
|
||||
$('.copy-tip-'+copyNumber).hide();
|
||||
}, 1000);
|
||||
e.clearSelection();
|
||||
});
|
||||
|
||||
});
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
304
static/doc/static/server/controllers/base.js.html
vendored
304
static/doc/static/server/controllers/base.js.html
vendored
@ -25,173 +25,173 @@
|
||||
<div class="ydoc-container-content">
|
||||
<div class="static-code-content" role="main">
|
||||
<pre class="brush: js;">
|
||||
import yapi from '../yapi.js';
|
||||
import projectModel from '../models/project.js';
|
||||
import userModel from '../models/user.js';
|
||||
import interfaceModel from '../models/interface.js'
|
||||
import groupModel from '../models/group.js'
|
||||
const yapi = require('../yapi.js');
|
||||
const projectModel = require('../models/project.js');
|
||||
const userModel = require('../models/user.js');
|
||||
const interfaceModel = require('../models/interface.js');
|
||||
const groupModel = require('../models/group.js');
|
||||
|
||||
import _ from 'underscore'
|
||||
const _ = require('underscore');
|
||||
const jwt = require('jsonwebtoken');
|
||||
|
||||
class baseController {
|
||||
constructor(ctx) {
|
||||
this.ctx = ctx;
|
||||
//网站上线后,role对象key是不能修改的,value可以修改
|
||||
this.roles = {
|
||||
admin: 'Admin',
|
||||
member: '网站会员'
|
||||
};
|
||||
constructor(ctx) {
|
||||
this.ctx = ctx;
|
||||
//网站上线后,role对象key是不能修改的,value可以修改
|
||||
this.roles = {
|
||||
admin: 'Admin',
|
||||
member: '网站会员'
|
||||
};
|
||||
}
|
||||
|
||||
async init(ctx) {
|
||||
this.$user = null;
|
||||
let ignoreRouter = [
|
||||
'/api/user/login_by_token',
|
||||
'/api/user/login',
|
||||
'/api/user/reg',
|
||||
'/api/user/status',
|
||||
'/api/user/logout'
|
||||
];
|
||||
if (ignoreRouter.indexOf(ctx.path) > -1) {
|
||||
this.$auth = true;
|
||||
} else {
|
||||
await this.checkLogin(ctx);
|
||||
}
|
||||
|
||||
async init(ctx) {
|
||||
this.$user = null;
|
||||
let ignoreRouter = [
|
||||
'/api/user/login_by_token',
|
||||
'/api/user/login',
|
||||
'/api/user/reg',
|
||||
'/api/user/status',
|
||||
'/api/user/logout'
|
||||
];
|
||||
if (ignoreRouter.indexOf(ctx.path) > -1) {
|
||||
this.$auth = true;
|
||||
} else {
|
||||
await this.checkLogin(ctx);
|
||||
}
|
||||
|
||||
getUid() {
|
||||
return parseInt(this.$uid, 10);
|
||||
}
|
||||
|
||||
async checkLogin(ctx) {
|
||||
let token = ctx.cookies.get('_yapi_token');
|
||||
let uid = ctx.cookies.get('_yapi_uid');
|
||||
|
||||
try {
|
||||
if (!token || !uid) return false;
|
||||
let userInst = yapi.getInst(userModel); //创建user实体
|
||||
let result = await userInst.findById(uid);
|
||||
let decoded = jwt.verify(token, result.passsalt);
|
||||
|
||||
if (decoded.uid == uid) {
|
||||
this.$uid = uid;
|
||||
this.$auth = true;
|
||||
this.$user = result;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {*} ctx
|
||||
*/
|
||||
|
||||
async getLoginStatus(ctx) {
|
||||
if (await this.checkLogin(ctx) === true) {
|
||||
let result = yapi.commons.fieldSelect(this.$user, ['_id', 'username', 'email', 'up_time', 'add_time', 'role', 'type']);
|
||||
result.server_ip = yapi.WEBCONFIG.server_ip;
|
||||
return ctx.body = yapi.commons.resReturn(result);
|
||||
}
|
||||
return ctx.body = yapi.commons.resReturn(null, 40011, '请登录...');
|
||||
}
|
||||
|
||||
getRole() {
|
||||
return this.$user.role;
|
||||
}
|
||||
|
||||
getUsername() {
|
||||
return this.$user.username;
|
||||
}
|
||||
async getProjectRole(id, type) {
|
||||
let result = {};
|
||||
try {
|
||||
if (this.getRole() === 'admin') {
|
||||
return 'admin';
|
||||
}
|
||||
if (type === 'interface') {
|
||||
let interfaceInst = yapi.getInst(interfaceModel);
|
||||
let interfaceData = await interfaceInst.get(id)
|
||||
result.interfaceData = interfaceData;
|
||||
if (interfaceData.uid === this.getUid()) {
|
||||
return 'owner';
|
||||
}
|
||||
type = 'project';
|
||||
id = interfaceData.project_id;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
getUid() {
|
||||
return parseInt(this.$uid, 10);
|
||||
}
|
||||
|
||||
async checkLogin(ctx) {
|
||||
let token = ctx.cookies.get('_yapi_token');
|
||||
let uid = ctx.cookies.get('_yapi_uid');
|
||||
|
||||
try {
|
||||
if (!token || !uid) return false;
|
||||
let userInst = yapi.getInst(userModel); //创建user实体
|
||||
let result = await userInst.findById(uid);
|
||||
let decoded = jwt.verify(token, result.passsalt);
|
||||
|
||||
if (decoded.uid == uid) {
|
||||
this.$uid = uid;
|
||||
this.$auth = true;
|
||||
this.$user = result;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
} catch (e) {
|
||||
return false;
|
||||
if (type === 'project') {
|
||||
let projectInst = yapi.getInst(projectModel);
|
||||
let projectData = await projectInst.get(id);
|
||||
if (projectData.uid === this.getUid()) {
|
||||
return 'owner';
|
||||
}
|
||||
let memberData = _.find(projectData.members, (m) => {
|
||||
if (m.uid === this.getUid()) {
|
||||
return true;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {*} ctx
|
||||
*/
|
||||
|
||||
async getLoginStatus(ctx) {
|
||||
if (await this.checkLogin(ctx) === true) {
|
||||
let result = yapi.commons.fieldSelect(this.$user, ['_id', 'username', 'email', 'up_time', 'add_time', 'role', 'type']);
|
||||
result.server_ip = yapi.WEBCONFIG.server_ip;
|
||||
return ctx.body = yapi.commons.resReturn(result);
|
||||
if (memberData && memberData.role) {
|
||||
if (memberData.role === 'owner') {
|
||||
return 'owner';
|
||||
} else {
|
||||
return 'dev';
|
||||
}
|
||||
}
|
||||
return ctx.body = yapi.commons.resReturn(null, 40011, '请登录...');
|
||||
}
|
||||
type = 'group';
|
||||
id = projectData.group_id
|
||||
}
|
||||
|
||||
getRole() {
|
||||
return this.$user.role;
|
||||
}
|
||||
|
||||
getUsername() {
|
||||
return this.$user.username;
|
||||
}
|
||||
async getProjectRole(id, type) {
|
||||
let result = {};
|
||||
try {
|
||||
if (this.getRole() === 'admin') {
|
||||
return 'admin';
|
||||
}
|
||||
if (type === 'interface') {
|
||||
let interfaceInst = yapi.getInst(interfaceModel);
|
||||
let interfaceData = await interfaceInst.get(id)
|
||||
result.interfaceData = interfaceData;
|
||||
if (interfaceData.uid === this.getUid()) {
|
||||
return 'owner';
|
||||
}
|
||||
type = 'project';
|
||||
id = interfaceData.project_id;
|
||||
}
|
||||
|
||||
if (type === 'project') {
|
||||
let projectInst = yapi.getInst(projectModel);
|
||||
let projectData = await projectInst.get(id);
|
||||
if (projectData.uid === this.getUid()) {
|
||||
return 'owner';
|
||||
}
|
||||
let memberData = _.find(projectData.members, (m) => {
|
||||
if (m.uid === this.getUid()) {
|
||||
return true;
|
||||
}
|
||||
})
|
||||
|
||||
if (memberData && memberData.role) {
|
||||
if (memberData.role === 'owner') {
|
||||
return 'owner';
|
||||
}else {
|
||||
return 'dev';
|
||||
}
|
||||
}
|
||||
type = 'group';
|
||||
id = projectData.group_id
|
||||
}
|
||||
|
||||
if (type === 'group') {
|
||||
let groupInst = yapi.getInst(groupModel);
|
||||
let groupData = await groupInst.get(id);
|
||||
let groupMemberData = _.find(groupData.members, (m) => {
|
||||
if (m.uid === this.getUid()) {
|
||||
return true;
|
||||
}
|
||||
})
|
||||
if (groupMemberData && groupMemberData.role) {
|
||||
if (groupMemberData.role === 'owner') {
|
||||
return 'owner';
|
||||
}else{
|
||||
return 'dev'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 'member';
|
||||
}
|
||||
catch (e) {
|
||||
yapi.commons.log(e.message, 'error')
|
||||
return false;
|
||||
if (type === 'group') {
|
||||
let groupInst = yapi.getInst(groupModel);
|
||||
let groupData = await groupInst.get(id);
|
||||
let groupMemberData = _.find(groupData.members, (m) => {
|
||||
if (m.uid === this.getUid()) {
|
||||
return true;
|
||||
}
|
||||
})
|
||||
if (groupMemberData && groupMemberData.role) {
|
||||
if (groupMemberData.role === 'owner') {
|
||||
return 'owner';
|
||||
} else {
|
||||
return 'dev'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 'member';
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {*} id type对应的id
|
||||
* @param {*} type enum[interface, project, group]
|
||||
* @param {*} action enum[ danger , edit ] danger只有owner或管理员才能操作,edit只要是dev或以上就能执行
|
||||
*/
|
||||
async checkAuth(id, type, action) {
|
||||
let role = await this.getProjectRole(id, type);
|
||||
if(action === 'danger'){
|
||||
if(role === 'admin' || role === 'owner'){
|
||||
return true;
|
||||
}
|
||||
}else if(action === 'edit'){
|
||||
if(role === 'admin' || role === 'owner' || role === 'dev'){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
catch (e) {
|
||||
yapi.commons.log(e.message, 'error')
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {*} id type对应的id
|
||||
* @param {*} type enum[interface, project, group]
|
||||
* @param {*} action enum[ danger , edit ] danger只有owner或管理员才能操作,edit只要是dev或以上就能执行
|
||||
*/
|
||||
async checkAuth(id, type, action) {
|
||||
let role = await this.getProjectRole(id, type);
|
||||
if (action === 'danger') {
|
||||
if (role === 'admin' || role === 'owner') {
|
||||
return true;
|
||||
}
|
||||
} else if (action === 'edit') {
|
||||
if (role === 'admin' || role === 'owner' || role === 'dev') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = baseController;
|
||||
|
@ -25,10 +25,10 @@
|
||||
<div class="ydoc-container-content">
|
||||
<div class="static-code-content" role="main">
|
||||
<pre class="brush: js;">
|
||||
import yapi from '../yapi.js';
|
||||
import baseController from './base.js';
|
||||
import followModel from '../models/follow';
|
||||
import projectModel from '../models/project';
|
||||
const yapi = require('../yapi.js');
|
||||
const baseController = require('./base.js');
|
||||
const followModel = require('../models/follow');
|
||||
const projectModel = require('../models/project');
|
||||
|
||||
class followController extends baseController {
|
||||
constructor(ctx) {
|
||||
|
@ -25,14 +25,14 @@
|
||||
<div class="ydoc-container-content">
|
||||
<div class="static-code-content" role="main">
|
||||
<pre class="brush: js;">
|
||||
import groupModel from '../models/group.js';
|
||||
import yapi from '../yapi.js';
|
||||
import baseController from './base.js';
|
||||
import projectModel from '../models/project.js';
|
||||
import userModel from '../models/user.js';
|
||||
import interfaceModel from '../models/interface.js';
|
||||
import interfaceColModel from '../models/interfaceCol.js';
|
||||
import interfaceCaseModel from '../models/interfaceCase.js';
|
||||
const groupModel = require('../models/group.js');
|
||||
const yapi = require('../yapi.js');
|
||||
const baseController = require('./base.js');
|
||||
const projectModel = require('../models/project.js');
|
||||
const userModel = require('../models/user.js');
|
||||
const interfaceModel = require('../models/interface.js');
|
||||
const interfaceColModel = require('../models/interfaceCol.js');
|
||||
const interfaceCaseModel = require('../models/interfaceCase.js');
|
||||
|
||||
class groupController extends baseController {
|
||||
constructor(ctx) {
|
||||
|
@ -25,16 +25,16 @@
|
||||
<div class="ydoc-container-content">
|
||||
<div class="static-code-content" role="main">
|
||||
<pre class="brush: js;">
|
||||
import interfaceModel from '../models/interface.js';
|
||||
import interfaceCatModel from '../models/interfaceCat.js';
|
||||
import interfaceCaseModel from '../models/interfaceCase.js'
|
||||
import followModel from '../models/follow.js'
|
||||
import _ from 'underscore';
|
||||
import url from 'url';
|
||||
import baseController from './base.js';
|
||||
import yapi from '../yapi.js';
|
||||
import userModel from '../models/user.js';
|
||||
import projectModel from '../models/project.js';
|
||||
const interfaceModel = require('../models/interface.js');
|
||||
const interfaceCatModel = require('../models/interfaceCat.js');
|
||||
const interfaceCaseModel = require('../models/interfaceCase.js');
|
||||
const followModel = require('../models/follow.js');
|
||||
const _ = require('underscore');
|
||||
const url = require('url');
|
||||
const baseController = require('./base.js');
|
||||
const yapi = require('../yapi.js');
|
||||
const userModel = require('../models/user.js');
|
||||
const projectModel = require('../models/project.js');
|
||||
|
||||
class interfaceController extends baseController {
|
||||
constructor(ctx) {
|
||||
@ -638,217 +638,18 @@ class interfaceController extends baseController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 接口数据上传
|
||||
* @interface /interface/interUpload
|
||||
* @method POST
|
||||
* 获取分类列表
|
||||
* @interface /interface/getCatMenu
|
||||
* @method GET
|
||||
* @category interface
|
||||
* @foldnumber 10
|
||||
* @param {Number} project_id 项目id,不能为空
|
||||
* @param {String} title 接口标题,不能为空
|
||||
* @param {String} path 接口请求路径,不能为空
|
||||
* @param {String} method 请求方式
|
||||
* @param {Array} [req_headers] 请求的header信息
|
||||
* @param {String} [req_headers[].name] 请求的header信息名
|
||||
* @param {String} [req_headers[].value] 请求的header信息值
|
||||
* @param {Boolean} [req_headers[].required] 是否是必须,默认为否
|
||||
* @param {String} [req_headers[].desc] header描述
|
||||
* @param {String} [req_body_type] 请求参数方式,有["form", "json", "text", "xml"]四种
|
||||
* @param {Array} [req_params] name, desc两个参数
|
||||
* @param {Mixed} [req_body_form] 请求参数,如果请求方式是form,参数是Array数组,其他格式请求参数是字符串
|
||||
* @param {String} [req_body_form[].name] 请求参数名
|
||||
* @param {String} [req_body_form[].value] 请求参数值,可填写生成规则(mock)。如@email,随机生成一条email
|
||||
* @param {String} [req_body_form[].type] 请求参数类型,有["text", "file"]两种
|
||||
* @param {String} [req_body_other] 非form类型的请求参数可保存到此字段
|
||||
* @param {String} [res_body_type] 相应信息的数据格式,有["json", "text", "xml"]三种
|
||||
* @param {String} [res_body] 响应信息,可填写任意字符串,如果res_body_type是json,则会调用mock功能
|
||||
* @param {String} [desc] 接口描述
|
||||
* @returns {Object}
|
||||
* @example ./api/interface/add.json
|
||||
* @example ./api/interface/getCatMenu
|
||||
*/
|
||||
async interUpload(ctx) {
|
||||
let interData = ctx.request.body.interData;
|
||||
let project_id = ctx.request.body.project_id;
|
||||
let request = interData.requests;
|
||||
let data1 = [];
|
||||
let catid = ctx.request.body.catid;
|
||||
|
||||
let auth = await this.checkAuth(project_id, 'project', 'danger');
|
||||
if (!auth) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, '没有权限');
|
||||
}
|
||||
if (!project_id) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, '项目id不能为空');
|
||||
}
|
||||
if (!catid) {
|
||||
return ctx.body = yapi.commons.resReturn(null, 400, '分类id不能为空');
|
||||
}
|
||||
|
||||
const len = request.length;
|
||||
let successNum = len;
|
||||
|
||||
if(request &&len){
|
||||
for(let i = 0;i<len;i++){
|
||||
try {
|
||||
let path = url.parse(request[i].url.replace(/{{(\w+)}}/,'')).path;
|
||||
let reg = /^(\w+):\/\/([^\/:]*)(?::(\d+))?\/([^\/\?]*)(\/.*)/;
|
||||
// let path = request[i].url;
|
||||
// let result = path.match(reg);
|
||||
// if(result){
|
||||
// path = result[4]+ result[5];
|
||||
// path = path.split('?')[0].replace(/{{(\w+)}}/,'').replace(/\/$/,'');
|
||||
// if(path.indexOf("/") > 0){
|
||||
// path = '/'+ path;
|
||||
// }
|
||||
// }else{
|
||||
// // path.replace(/\{\{\ [0-9a-zA-Z-_]* }\}/g,'');
|
||||
// path = path.replace(/{{(\w+)}}/,'');
|
||||
// if(path.indexOf("/") > 0){
|
||||
// path = '/'+ path;
|
||||
// }
|
||||
// }
|
||||
let title = request[i].name;
|
||||
if(reg.test(request[i].name)){
|
||||
title = path;
|
||||
}
|
||||
let inter = {
|
||||
project_id: project_id,
|
||||
title: title,
|
||||
path: path,
|
||||
method: request[i].method,
|
||||
req_headers: '',
|
||||
// req_body_type: request[i].dataMode,
|
||||
req_params: '',
|
||||
req_body_form: '',
|
||||
req_body_other: '',
|
||||
res_body_type: 'json',
|
||||
res_body: '',
|
||||
desc: request[i].description
|
||||
};
|
||||
console.log(inter.path);
|
||||
// req_body_type req_body_form
|
||||
if(request[i].dataMode){
|
||||
// console.log(i);
|
||||
if(request[i].dataMode === 'params' || request[i].dataMode==='urlencoded'){
|
||||
inter.req_body_type = 'form';
|
||||
inter.req_body_form = [];
|
||||
const data = request[i].data;
|
||||
for(let item in data){
|
||||
inter.req_body_form.push({
|
||||
name: data[item].key,
|
||||
value: data[item].value,
|
||||
type: data[item].type
|
||||
});
|
||||
}
|
||||
}else if(request[i].dataMode === 'raw'){
|
||||
inter.req_body_form = [];
|
||||
// console.log(request[i].headers.inedxOf('application/json')>-1);
|
||||
if(request[i].headers&&request[i].headers.indexOf('application/json')>-1){
|
||||
inter.req_body_type = 'json';
|
||||
}else{
|
||||
inter.req_body_type = 'raw';
|
||||
}
|
||||
inter.req_body_other = request[i].rawModeData;
|
||||
}else if(request[i].dataMode === 'binary'){
|
||||
|
||||
inter.req_body_type = 'file';
|
||||
inter.req_body_other = request[i].rawModeData;
|
||||
}
|
||||
}
|
||||
// req_params
|
||||
if(request[i].queryParams){
|
||||
inter.req_params = [];
|
||||
const queryParams = request[i].queryParams;
|
||||
for(let item in queryParams){
|
||||
inter.req_params.push({
|
||||
name: queryParams[item].key,
|
||||
desc: queryParams[item].description,
|
||||
required: queryParams[item].enable
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// req_headers
|
||||
if(request[i].headerData){
|
||||
inter.req_headers = [];
|
||||
const headerData = request[i].headerData;
|
||||
for(let item in headerData){
|
||||
inter.req_headers.push({
|
||||
name: headerData[item].key,
|
||||
value: headerData[item].value,
|
||||
required: headerData[item].enable,
|
||||
desc: headerData[item].description
|
||||
});
|
||||
}
|
||||
}
|
||||
if (!inter.project_id) {
|
||||
// return ctx.body = yapi.commons.resReturn(null, 400, '项目id不能为空');
|
||||
continue;
|
||||
}
|
||||
if (!inter.path) {
|
||||
// return ctx.body = yapi.commons.resReturn(null, 400, '接口请求路径不能为空');
|
||||
continue;
|
||||
}
|
||||
if (!yapi.commons.verifyPath(inter.path)) {
|
||||
successNum--;
|
||||
// return ctx.body = yapi.commons.resReturn(null, 400, '接口path第一位必须是/,最后一位不能为/');
|
||||
continue;
|
||||
}
|
||||
let checkRepeat = await this.Model.checkRepeat(inter.project_id, inter.path, inter.method);
|
||||
|
||||
if (checkRepeat > 0) {
|
||||
successNum--;
|
||||
// return ctx.body = yapi.commons.resReturn(null, 401, '已存在的接口:' + inter.path + '[' + inter.method + ']');
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
let data = {
|
||||
...inter,
|
||||
catid: catid,
|
||||
uid: this.getUid(),
|
||||
add_time: yapi.commons.time(),
|
||||
up_time: yapi.commons.time()
|
||||
};
|
||||
if ( data.req_params.length > 0) {
|
||||
data.type = 'var';
|
||||
data.req_params = data.req_params;
|
||||
} else {
|
||||
data.type = 'static';
|
||||
}
|
||||
// data1.push(data);
|
||||
// console.log(data);
|
||||
let res = await this.Model.save(data);
|
||||
// return ctx.body = yapi.commons.resReturn(res);
|
||||
}catch(e){
|
||||
// ctx.body = yapi.commons.resReturn(e.message);
|
||||
successNum--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try{
|
||||
if(successNum){
|
||||
this.catModel.get(catid).then((cate) => {
|
||||
let username = this.getUsername();
|
||||
yapi.commons.saveLog({
|
||||
content: `用户 "${username}" 为分类 "${cate.name}" 成功导入了 ${successNum} 个接口`,
|
||||
type: 'project',
|
||||
uid: this.getUid(),
|
||||
username: username,
|
||||
typeid: project_id
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
|
||||
return ctx.body = yapi.commons.resReturn(successNum);
|
||||
}
|
||||
|
||||
|
||||
async getCatMenu(ctx) {
|
||||
let project_id = ctx.request.query.project_id;
|
||||
if(!project_id){
|
||||
@ -860,8 +661,6 @@ class interfaceController extends baseController {
|
||||
}catch(e){
|
||||
yapi.commons.resReturn(null, 400, e.message);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
sendNotice(projectId, data) {
|
||||
|
@ -25,12 +25,12 @@
|
||||
<div class="ydoc-container-content">
|
||||
<div class="static-code-content" role="main">
|
||||
<pre class="brush: js;">
|
||||
import interfaceColModel from '../models/interfaceCol.js';
|
||||
import interfaceCaseModel from '../models/interfaceCase.js';
|
||||
import interfaceModel from '../models/interface.js';
|
||||
import projectModel from '../models/project.js';
|
||||
import baseController from './base.js';
|
||||
import yapi from '../yapi.js';
|
||||
const interfaceColModel = require('../models/interfaceCol.js');
|
||||
const interfaceCaseModel = require('../models/interfaceCase.js');
|
||||
const interfaceModel = require('../models/interface.js');
|
||||
const projectModel = require('../models/project.js');
|
||||
const baseController = require('./base.js');
|
||||
const yapi = require('../yapi.js');
|
||||
|
||||
class interfaceColController extends baseController{
|
||||
constructor(ctx) {
|
||||
|
@ -25,10 +25,10 @@
|
||||
<div class="ydoc-container-content">
|
||||
<div class="static-code-content" role="main">
|
||||
<pre class="brush: js;">
|
||||
import logModel from '../models/log.js';
|
||||
import yapi from '../yapi.js';
|
||||
import baseController from './base.js';
|
||||
import groupModel from '../models/group';
|
||||
const logModel = require('../models/log.js');
|
||||
const yapi = require('../yapi.js');
|
||||
const baseController = require('./base.js');
|
||||
const groupModel = require('../models/group');
|
||||
|
||||
class logController extends baseController {
|
||||
constructor(ctx) {
|
||||
|
@ -25,20 +25,20 @@
|
||||
<div class="ydoc-container-content">
|
||||
<div class="static-code-content" role="main">
|
||||
<pre class="brush: js;">
|
||||
import projectModel from '../models/project.js';
|
||||
import yapi from '../yapi.js';
|
||||
import _ from "underscore"
|
||||
import baseController from './base.js';
|
||||
import interfaceModel from '../models/interface.js';
|
||||
import interfaceColModel from '../models/interfaceCol.js';
|
||||
import interfaceCaseModel from '../models/interfaceCase.js';
|
||||
import interfaceCatModel from '../models/interfaceCat.js';
|
||||
import groupModel from '../models/group';
|
||||
import commons from '../utils/commons.js';
|
||||
import userModel from '../models/user.js';
|
||||
import logModel from '../models/log.js';
|
||||
import followModel from '../models/follow.js';
|
||||
import Mock from 'mockjs';
|
||||
const projectModel = require('../models/project.js');
|
||||
const yapi = require('../yapi.js');
|
||||
const _ = require("underscore");
|
||||
const baseController = require('./base.js');
|
||||
const interfaceModel = require('../models/interface.js');
|
||||
const interfaceColModel = require('../models/interfaceCol.js');
|
||||
const interfaceCaseModel = require('../models/interfaceCase.js');
|
||||
const interfaceCatModel = require('../models/interfaceCat.js');
|
||||
const groupModel = require('../models/group');
|
||||
const commons = require('../utils/commons.js');
|
||||
const userModel = require('../models/user.js');
|
||||
const logModel = require('../models/log.js');
|
||||
const followModel = require('../models/follow.js');
|
||||
const Mock = require('mockjs');
|
||||
const send = require('koa-send');
|
||||
|
||||
class projectController extends baseController {
|
||||
|
@ -25,16 +25,16 @@
|
||||
<div class="ydoc-container-content">
|
||||
<div class="static-code-content" role="main">
|
||||
<pre class="brush: js;">
|
||||
import userModel from '../models/user.js';
|
||||
import yapi from '../yapi.js';
|
||||
import baseController from './base.js';
|
||||
import request from 'request';
|
||||
import common from '../utils/commons.js';
|
||||
const userModel = require('../models/user.js');
|
||||
const yapi = require('../yapi.js');
|
||||
const baseController = require('./base.js');
|
||||
const request = require('request');
|
||||
const common = require('../utils/commons.js');
|
||||
|
||||
import interfaceModel from '../models/interface.js'
|
||||
import groupModel from '../models/group.js'
|
||||
import projectModel from '../models/project.js'
|
||||
import avatarModel from '../models/avatar.js'
|
||||
const interfaceModel = require('../models/interface.js');
|
||||
const groupModel = require('../models/group.js');
|
||||
const projectModel = require('../models/project.js');
|
||||
const avatarModel = require('../models/avatar.js');
|
||||
|
||||
const jwt = require('jsonwebtoken');
|
||||
|
||||
|
@ -9,13 +9,7 @@
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<title>YApi 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -38,6 +32,11 @@
|
||||
<a href="usage.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="manage.html">管理学院</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></a>
|
||||
@ -64,10 +63,10 @@
|
||||
|
||||
<div class="ydoc-container">
|
||||
|
||||
<div class="ydoc-container-content ">
|
||||
<div class="ydoc-container-content">
|
||||
|
||||
|
||||
<div class="content-left staticsidenav" role="complementary">
|
||||
<div class="content-left " role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
@ -83,6 +82,24 @@
|
||||
<a href="usage-创建第一个API.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-项目管理.html">项目管理</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口配置.html">接口配置</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口调试.html">接口调试</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
@ -110,14 +127,32 @@
|
||||
<li >
|
||||
<a href="#Mock语法规范">Mock语法规范</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用测试集.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-成为组长.html">成为组长</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-权限列表.html">权限列表</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
<div class="content-right markdown-body " role="main">
|
||||
|
||||
<h2 class="subject" id="Mock介绍">Mock介绍 <a class="hashlink" href="#Mock介绍">#</a></h2> <p style='text-indent:2em;line-height:1.8em'>yapi的Mock功能可以根据用户的输入接口信息如协议、URL、接口名、请求头、请求参数、mock规则(<a href="#mock">点击到Mock规则</a>)生成Mock接口,这些接口会自动生成模拟数据,创建者可以自由构造需要的数据。而且与常见的Mock方式如将Mock写在代码里和JS拦截等相比yapi的Mock在使用场景和效率和复杂度上是相差甚远的,正是由于yapi的Mock是一个第三方平台,那么在团队开发时任何人都可以权限许可下创建、修改接口信息等操作,这对于团队开发是很有好处的。 </p>
|
||||
|
||||
@ -148,19 +183,19 @@
|
||||
"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><h2 class="subject" id="如何使用Mock?">如何使用Mock? <a class="hashlink" href="#如何使用Mock?">#</a></h2><h3 class="subject" id="1_最简单的方式">1 最简单的方式 <a class="hashlink" href="#1_最简单的方式">#</a></h3><p>在代码直接请求yapi提供的mock地址,以jQuery为例:</p>
|
||||
</code></pre><h2 class="subject" id="如何使用Mock?">如何使用Mock? <a class="hashlink" href="#如何使用Mock?">#</a></h2><h3 class="subject" id="1 最简单的方式">1 最简单的方式 <a class="hashlink" href="#1 最简单的方式">#</a></h3><p>在代码直接请求yapi提供的mock地址,以jQuery为例:</p>
|
||||
<pre><code class="lang-javascript"><span class="token keyword">let</span> prefix <span class="token operator">=</span> <span class="token string">'http://yapi.local.qunar.com:3000/mock/2817'</span>
|
||||
$<span class="token punctuation">.</span><span class="token function">post</span><span class="token punctuation">(</span>prefix<span class="token operator">+</span><span class="token string">'/baseapi/path'</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>username<span class="token punctuation">:</span> <span class="token string">'xxx'</span><span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token keyword">function</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span><span class="token punctuation">{</span>
|
||||
console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span> <span class="token comment" spellcheck="true">//返回上图预览部分的数据</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">)</span>
|
||||
</code></pre>
|
||||
<h3 class="subject" id="2_基于本地服务器反向代理">2 基于本地服务器反向代理 <a class="hashlink" href="#2_基于本地服务器反向代理">#</a></h3><p>优点:不用修改项目代码</p>
|
||||
<h4 class="subject" id="2.1_基于nginx反向代理">2.1 基于nginx反向代理 <a class="hashlink" href="#2.1_基于nginx反向代理">#</a></h4><pre><code class="lang-nginx"><span class="token keyword">location</span> <span class="token operator">/</span>baseapi
|
||||
<h3 class="subject" id="2 基于本地服务器反向代理">2 基于本地服务器反向代理 <a class="hashlink" href="#2 基于本地服务器反向代理">#</a></h3><p>优点:不用修改项目代码</p>
|
||||
<h4 class="subject" id="2.1 基于nginx反向代理">2.1 基于nginx反向代理 <a class="hashlink" href="#2.1 基于nginx反向代理">#</a></h4><pre><code class="lang-nginx"><span class="token keyword">location</span> <span class="token operator">/</span>baseapi
|
||||
<span class="token punctuation">{</span>
|
||||
<span class="token keyword">proxy_pass</span> <span class="token keyword">http</span><span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>yapi<span class="token punctuation">.</span>corp<span class="token punctuation">.</span>qunar<span class="token punctuation">.</span>com<span class="token operator">/</span>mock<span class="token operator">/</span><span class="token number">2817</span><span class="token operator">/</span>baseapi<span class="token punctuation">;</span> <span class="token comment" spellcheck="true">#baseapi后面没有"/"</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre>
|
||||
<h4 class="subject" id="2.2_基于ykit_Jerry代理">2.2 基于ykit Jerry代理 <a class="hashlink" href="#2.2_基于ykit_Jerry代理">#</a></h4><p>假设您本地服务器访问地址是: <a href="http://xxx.com">http://xxx.com</a></p>
|
||||
<h4 class="subject" id="2.2 基于ykit Jerry代理">2.2 基于ykit Jerry代理 <a class="hashlink" href="#2.2 基于ykit Jerry代理">#</a></h4><p>假设您本地服务器访问地址是: <a href="http://xxx.com">http://xxx.com</a></p>
|
||||
<p><img src="./images/ykit.jpg" /></p>
|
||||
<h2 class="subject" id="Mock语法规范">Mock语法规范 <a class="hashlink" href="#Mock语法规范">#</a></h2><blockquote>
|
||||
<p>了解更多Mock详情:<a href="https://github.com/nuysoft/Mock/wiki/Syntax-Specification">Mock.js 官方文档</a></p>
|
||||
@ -169,7 +204,7 @@ $<span class="token punctuation">.</span><span class="token function">post</span
|
||||
<p><a href="#DTD">1. 数据模板定义规范(Data Template Definition,DTD)</a></p>
|
||||
<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>
|
||||
<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">" 隔开)
|
||||
// 生成规则 rule(生成规则有7种详见下面的生成规则)
|
||||
// 属性值 value(可以含有 "</span>@占位符" 同时也指定了最终值的初始值和类型)
|
||||
@ -185,14 +220,14 @@ $<span class="token punctuation">.</span><span class="token function">post</span
|
||||
'name|count.dcount'<span class="token operator">:</span> value
|
||||
'name|+step'<span class="token operator">:</span> value
|
||||
</code></pre><p>下面提供了6种生成规则以及示例包括 String、Number、Boolean、Object、Array:</p>
|
||||
<h3 class="subject" id="1._属性值是字符串_String">1. 属性值是字符串 String <a class="hashlink" href="#1._属性值是字符串_String">#</a></h3><pre><code><span class="token number">1</span>. 'name|min-max'<span class="token operator">:</span> string
|
||||
<h3 class="subject" id="1. 属性值是字符串 String">1. 属性值是字符串 String <a class="hashlink" href="#1. 属性值是字符串 String">#</a></h3><pre><code><span class="token number">1</span>. 'name|min-max'<span class="token operator">:</span> string
|
||||
|
||||
通过重复 string 生成一个字符串,重复次数大于等于 min,小于等于 max。
|
||||
|
||||
<span class="token number">2</span>. 'name|count'<span class="token operator">:</span> string
|
||||
|
||||
通过重复 string 生成一个字符串,重复次数等于 count。
|
||||
</code></pre><h3 class="subject" id="2._属性值是数字_Number">2. 属性值是数字 Number <a class="hashlink" href="#2._属性值是数字_Number">#</a></h3><pre><code><span class="token number">1</span>. 'name|+<span class="token number">1</span>'<span class="token operator">:</span> number
|
||||
</code></pre><h3 class="subject" id="2. 属性值是数字 Number">2. 属性值是数字 Number <a class="hashlink" href="#2. 属性值是数字 Number">#</a></h3><pre><code><span class="token number">1</span>. 'name|+<span class="token number">1</span>'<span class="token operator">:</span> number
|
||||
|
||||
属性值自动加 <span class="token number">1</span>,初始值为 number。
|
||||
|
||||
@ -218,21 +253,21 @@ Mock.mock(<span class="token punctuation">{</span>
|
||||
<span class="token property">"number3"</span><span class="token operator">:</span> <span class="token number">123.777</span><span class="token punctuation">,</span>
|
||||
<span class="token property">"number4"</span><span class="token operator">:</span> <span class="token number">123.1231091814</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre><h3 class="subject" id="3._属性值是布尔型_Boolean">3. 属性值是布尔型 Boolean <a class="hashlink" href="#3._属性值是布尔型_Boolean">#</a></h3><pre><code><span class="token number">1</span>. 'name|<span class="token number">1</span>'<span class="token operator">:</span> boolean
|
||||
</code></pre><h3 class="subject" id="3. 属性值是布尔型 Boolean">3. 属性值是布尔型 Boolean <a class="hashlink" href="#3. 属性值是布尔型 Boolean">#</a></h3><pre><code><span class="token number">1</span>. 'name|<span class="token number">1</span>'<span class="token operator">:</span> boolean
|
||||
|
||||
随机生成一个布尔值,值为 <span class="token boolean">true</span> 的概率是 <span class="token number">1</span>/<span class="token number">2</span>,值为 <span class="token boolean">false</span> 的概率同样是 <span class="token number">1</span>/<span class="token number">2</span>。
|
||||
|
||||
<span class="token number">2</span>. 'name|min-max'<span class="token operator">:</span> value
|
||||
|
||||
随机生成一个布尔值,值为 value 的概率是 min / (min + max<span class="token punctuation">)</span>,值为 !value 的概率是 max / (min + max<span class="token punctuation">)</span>。
|
||||
</code></pre><h3 class="subject" id="4._属性值是对象_Object">4. 属性值是对象 Object <a class="hashlink" href="#4._属性值是对象_Object">#</a></h3><pre><code><span class="token number">1</span>. 'name|count'<span class="token operator">:</span> object
|
||||
</code></pre><h3 class="subject" id="4. 属性值是对象 Object">4. 属性值是对象 Object <a class="hashlink" href="#4. 属性值是对象 Object">#</a></h3><pre><code><span class="token number">1</span>. 'name|count'<span class="token operator">:</span> object
|
||||
|
||||
从属性值 object 中随机选取 count 个属性。
|
||||
|
||||
<span class="token number">2</span>. 'name|min-max'<span class="token operator">:</span> object
|
||||
|
||||
从属性值 object 中随机选取 min 到 max 个属性。
|
||||
</code></pre><h3 class="subject" id="5._属性值是数组_Array">5. 属性值是数组 Array <a class="hashlink" href="#5._属性值是数组_Array">#</a></h3><pre><code><span class="token number">1</span>. 'name|<span class="token number">1</span>'<span class="token operator">:</span> array
|
||||
</code></pre><h3 class="subject" id="5. 属性值是数组 Array">5. 属性值是数组 Array <a class="hashlink" href="#5. 属性值是数组 Array">#</a></h3><pre><code><span class="token number">1</span>. 'name|<span class="token number">1</span>'<span class="token operator">:</span> array
|
||||
|
||||
从属性值 array 中随机选取 <span class="token number">1</span> 个元素,作为最终值。
|
||||
|
||||
@ -248,7 +283,7 @@ Mock.mock(<span class="token punctuation">{</span>
|
||||
|
||||
通过重复属性值 array 生成一个新数组,重复次数为 count。
|
||||
</code></pre><p><span id = "DPD"></span></p>
|
||||
<h3 class="subject" id="数据占位符定义规范(Data_Placeholder_Definition,DPD)">数据占位符定义规范(Data Placeholder Definition,DPD) <a class="hashlink" href="#数据占位符定义规范(Data_Placeholder_Definition,DPD)">#</a></h3><pre><code>占位符 只是在属性值字符串中占个位置,并不出现在最终的属性值中。
|
||||
<h3 class="subject" id="数据占位符定义规范(Data Placeholder Definition,DPD)">数据占位符定义规范(Data Placeholder Definition,DPD) <a class="hashlink" href="#数据占位符定义规范(Data Placeholder Definition,DPD)">#</a></h3><pre><code>占位符 只是在属性值字符串中占个位置,并不出现在最终的属性值中。
|
||||
|
||||
占位符 的格式为:
|
||||
|
||||
@ -295,7 +330,7 @@ name<span class="token operator">:</span> <span class="token punctuation">{</spa
|
||||
<script src="source/app.js"></script>
|
||||
|
||||
<script>
|
||||
var lineHeight = 18;
|
||||
var lineHeight = 17.4;
|
||||
var EXAMPLE_MAX_HEIGHT;
|
||||
|
||||
function fold() {
|
||||
@ -319,8 +354,8 @@ name<span class="token operator">:</span> <span class="token punctuation">{</spa
|
||||
var $this = $(this);
|
||||
$this.removeClass('extend').addClass('fold');
|
||||
$this.html('折叠代码');
|
||||
$this.parent().children('.js-code').height('auto');
|
||||
$this.parent().height('auto');
|
||||
$this.prev().height('auto');
|
||||
$this.prev().parent().height('auto');
|
||||
});
|
||||
$('.ydoc-example').delegate('.fold', 'click', function() {
|
||||
var $this = $(this);
|
||||
@ -328,7 +363,7 @@ name<span class="token operator">:</span> <span class="token punctuation">{</spa
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
$this.removeClass('fold').addClass('extend');
|
||||
$this.parent().height(EXAMPLE_MAX_HEIGHT); // pre
|
||||
$this.parent().children('.js-code').height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.prev().height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
|
212
static/doc/usage-使用测试集.html
Normal file
212
static/doc/usage-使用测试集.html
Normal file
@ -0,0 +1,212 @@
|
||||
<!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">
|
||||
<title>YApi 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
<header class="ydoc-header">
|
||||
<div class="ydoc-header-area">
|
||||
|
||||
<a href="http://ued.qunar.com/ymfe/" class="navbar-brand">YMFE</a>
|
||||
|
||||
<button class="ydocIcon navbar-toggle"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="index.html">首页</a>
|
||||
</li>
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="usage.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="manage.html">管理学院</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- <header style="height:20px"></header> -->
|
||||
|
||||
<!-- Docs page layout -->
|
||||
|
||||
<div class="ydoc-banner-bg">
|
||||
<div class="ydoc-banner ">
|
||||
<div class="ydoc-banner-area">
|
||||
<h1 >YApi</h1>
|
||||
<p class="desc ">高效、易用、功能强大的api管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ydoc-container">
|
||||
|
||||
<div class="ydoc-container-content">
|
||||
|
||||
|
||||
<div class="content-left " role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-认识 YApi.html">认识 YApi</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-创建第一个API.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-项目管理.html">项目管理</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口配置.html">接口配置</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口调试.html">接口调试</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用mock功能.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="usage-使用测试集.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#介绍">介绍</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#使用说明">使用说明</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-成为组长.html">成为组长</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-权限列表.html">权限列表</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body " role="main">
|
||||
|
||||
<h2 class="subject" id="介绍5">介绍 <a class="hashlink" href="#介绍5">#</a></h2><h2 class="subject" id="使用说明6">使用说明 <a class="hashlink" href="#使用说明6">#</a></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2016 <a href="http://ued.qunar.com/ymfe/">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>.
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="open-panel"></div>
|
||||
<div class="mask"></div>
|
||||
|
||||
|
||||
<script src="source/main.js"></script>
|
||||
<script src="source/app.js"></script>
|
||||
|
||||
<script>
|
||||
var lineHeight = 17.4;
|
||||
var EXAMPLE_MAX_HEIGHT;
|
||||
|
||||
function fold() {
|
||||
// 折叠code
|
||||
$('.markdown-body pre').css({
|
||||
"line-height": lineHeight + "px"
|
||||
});
|
||||
$('.markdown-body pre').map(function(i, item) {
|
||||
var $item = $(item);
|
||||
var foldnumber = $item.data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
if ($item.height() > EXAMPLE_MAX_HEIGHT) {
|
||||
$item.css({
|
||||
"padding-bottom": 30
|
||||
});
|
||||
$item.find('code').height(EXAMPLE_MAX_HEIGHT);
|
||||
$item.append('<span class="extend">展开更多……</span>');
|
||||
};
|
||||
});
|
||||
$('.ydoc-example').delegate('.extend', 'click', function() {
|
||||
var $this = $(this);
|
||||
$this.removeClass('extend').addClass('fold');
|
||||
$this.html('折叠代码');
|
||||
$this.prev().height('auto');
|
||||
$this.prev().parent().height('auto');
|
||||
});
|
||||
$('.ydoc-example').delegate('.fold', 'click', function() {
|
||||
var $this = $(this);
|
||||
var foldnumber = $this.parent().data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
$this.removeClass('fold').addClass('extend');
|
||||
$this.parent().height(EXAMPLE_MAX_HEIGHT); // pre
|
||||
$this.prev().height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -9,13 +9,7 @@
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<title>YApi 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -38,6 +32,11 @@
|
||||
<a href="usage.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="manage.html">管理学院</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></a>
|
||||
@ -64,10 +63,10 @@
|
||||
|
||||
<div class="ydoc-container">
|
||||
|
||||
<div class="ydoc-container-content ">
|
||||
<div class="ydoc-container-content">
|
||||
|
||||
|
||||
<div class="content-left staticsidenav" role="complementary">
|
||||
<div class="content-left " role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
@ -91,17 +90,53 @@
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-项目管理.html">项目管理</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口配置.html">接口配置</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口调试.html">接口调试</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用mock功能.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用测试集.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-成为组长.html">成为组长</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-权限列表.html">权限列表</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
<div class="content-right markdown-body " role="main">
|
||||
|
||||
<h2 class="subject" id="起步">起步 <a class="hashlink" href="#起步">#</a></h2><h3 class="subject" id="创建API">创建API <a class="hashlink" href="#创建API">#</a></h3><p>注册新用户或使用 QSSO 登录。</p>
|
||||
<p>新用户进入 YApi 时没有任何权限,只能浏览公开项目,想要创建 API 应联系 <code>组长</code> 将你添加到某分组或某项目中。
|
||||
@ -118,10 +153,10 @@
|
||||
</li></ul>
|
||||
<h3 class="subject" id="项目详情页面">项目详情页面 <a class="hashlink" href="#项目详情页面">#</a></h3><h4 class="subject" id="添加接口分类">添加接口分类 <a class="hashlink" href="#添加接口分类">#</a></h4><p><img src="./images/interface_add_cat.png" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center /></p>
|
||||
<p>添加完成后可以在左侧列表看到新添加的接口分类</p>
|
||||
<h4 class="subject" id="4.2_添加接口">4.2 添加接口 <a class="hashlink" href="#4.2_添加接口">#</a></h4><p>鼠标移动到接口分类的菜单icon,点击添加接口</p>
|
||||
<h4 class="subject" id="4.2 添加接口">4.2 添加接口 <a class="hashlink" href="#4.2 添加接口">#</a></h4><p>鼠标移动到接口分类的菜单icon,点击添加接口</p>
|
||||
<p><img src="./images/interface_add.png" width="400" style="margin:0px auto;display:block;" alt="图片名称" align=center /></p>
|
||||
<h4 class="subject" id="4.3_接口编辑">4.3 接口编辑 <a class="hashlink" href="#4.3_接口编辑">#</a></h4><p>添加完接口点击新添加的接口,跳转到接口预览页面,可看到刚才填写的信息。接口的详细信息点击编辑功能进行添加</p>
|
||||
<h4 class="subject" id="4.4_测试接口">4.4 测试接口 <a class="hashlink" href="#4.4_测试接口">#</a></h4><p>点击运行tab,可进入到接口测试页面,首先安装chrome crossRequest扩展,才可正常使用此功能
|
||||
<h4 class="subject" id="4.3 接口编辑">4.3 接口编辑 <a class="hashlink" href="#4.3 接口编辑">#</a></h4><p>添加完接口点击新添加的接口,跳转到接口预览页面,可看到刚才填写的信息。接口的详细信息点击编辑功能进行添加</p>
|
||||
<h4 class="subject" id="4.4 测试接口">4.4 测试接口 <a class="hashlink" href="#4.4 测试接口">#</a></h4><p>点击运行tab,可进入到接口测试页面,首先安装chrome crossRequest扩展,才可正常使用此功能
|
||||
<img src="./images/interface_run.png" width="800" style="margin:0px auto;display:block;" alt="图片名称" align=center />
|
||||
点击保存按钮可把当前测试保存到测试集,方便下次调试</p>
|
||||
|
||||
@ -148,7 +183,7 @@
|
||||
<script src="source/app.js"></script>
|
||||
|
||||
<script>
|
||||
var lineHeight = 18;
|
||||
var lineHeight = 17.4;
|
||||
var EXAMPLE_MAX_HEIGHT;
|
||||
|
||||
function fold() {
|
||||
@ -172,8 +207,8 @@
|
||||
var $this = $(this);
|
||||
$this.removeClass('extend').addClass('fold');
|
||||
$this.html('折叠代码');
|
||||
$this.parent().children('.js-code').height('auto');
|
||||
$this.parent().height('auto');
|
||||
$this.prev().height('auto');
|
||||
$this.prev().parent().height('auto');
|
||||
});
|
||||
$('.ydoc-example').delegate('.fold', 'click', function() {
|
||||
var $this = $(this);
|
||||
@ -181,7 +216,7 @@
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
$this.removeClass('fold').addClass('extend');
|
||||
$this.parent().height(EXAMPLE_MAX_HEIGHT); // pre
|
||||
$this.parent().children('.js-code').height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.prev().height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
|
212
static/doc/usage-成为组长.html
Normal file
212
static/doc/usage-成为组长.html
Normal file
@ -0,0 +1,212 @@
|
||||
<!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">
|
||||
<title>YApi 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
<header class="ydoc-header">
|
||||
<div class="ydoc-header-area">
|
||||
|
||||
<a href="http://ued.qunar.com/ymfe/" class="navbar-brand">YMFE</a>
|
||||
|
||||
<button class="ydocIcon navbar-toggle"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="index.html">首页</a>
|
||||
</li>
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="usage.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="manage.html">管理学院</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- <header style="height:20px"></header> -->
|
||||
|
||||
<!-- Docs page layout -->
|
||||
|
||||
<div class="ydoc-banner-bg">
|
||||
<div class="ydoc-banner ">
|
||||
<div class="ydoc-banner-area">
|
||||
<h1 >YApi</h1>
|
||||
<p class="desc ">高效、易用、功能强大的api管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ydoc-container">
|
||||
|
||||
<div class="ydoc-container-content">
|
||||
|
||||
|
||||
<div class="content-left " role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-认识 YApi.html">认识 YApi</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-创建第一个API.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-项目管理.html">项目管理</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口配置.html">接口配置</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口调试.html">接口调试</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用mock功能.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用测试集.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="usage-成为组长.html">成为组长</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#什么是组长">什么是组长</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#组长职责">组长职责</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-权限列表.html">权限列表</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body " role="main">
|
||||
|
||||
<h2 class="subject" id="什么是组长">什么是组长 <a class="hashlink" href="#什么是组长">#</a></h2><h2 class="subject" id="组长职责">组长职责 <a class="hashlink" href="#组长职责">#</a></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2016 <a href="http://ued.qunar.com/ymfe/">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>.
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="open-panel"></div>
|
||||
<div class="mask"></div>
|
||||
|
||||
|
||||
<script src="source/main.js"></script>
|
||||
<script src="source/app.js"></script>
|
||||
|
||||
<script>
|
||||
var lineHeight = 17.4;
|
||||
var EXAMPLE_MAX_HEIGHT;
|
||||
|
||||
function fold() {
|
||||
// 折叠code
|
||||
$('.markdown-body pre').css({
|
||||
"line-height": lineHeight + "px"
|
||||
});
|
||||
$('.markdown-body pre').map(function(i, item) {
|
||||
var $item = $(item);
|
||||
var foldnumber = $item.data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
if ($item.height() > EXAMPLE_MAX_HEIGHT) {
|
||||
$item.css({
|
||||
"padding-bottom": 30
|
||||
});
|
||||
$item.find('code').height(EXAMPLE_MAX_HEIGHT);
|
||||
$item.append('<span class="extend">展开更多……</span>');
|
||||
};
|
||||
});
|
||||
$('.ydoc-example').delegate('.extend', 'click', function() {
|
||||
var $this = $(this);
|
||||
$this.removeClass('extend').addClass('fold');
|
||||
$this.html('折叠代码');
|
||||
$this.prev().height('auto');
|
||||
$this.prev().parent().height('auto');
|
||||
});
|
||||
$('.ydoc-example').delegate('.fold', 'click', function() {
|
||||
var $this = $(this);
|
||||
var foldnumber = $this.parent().data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
$this.removeClass('fold').addClass('extend');
|
||||
$this.parent().height(EXAMPLE_MAX_HEIGHT); // pre
|
||||
$this.prev().height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
216
static/doc/usage-接口调试.html
Normal file
216
static/doc/usage-接口调试.html
Normal file
@ -0,0 +1,216 @@
|
||||
<!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">
|
||||
<title>YApi 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
<header class="ydoc-header">
|
||||
<div class="ydoc-header-area">
|
||||
|
||||
<a href="http://ued.qunar.com/ymfe/" class="navbar-brand">YMFE</a>
|
||||
|
||||
<button class="ydocIcon navbar-toggle"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="index.html">首页</a>
|
||||
</li>
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="usage.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="manage.html">管理学院</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- <header style="height:20px"></header> -->
|
||||
|
||||
<!-- Docs page layout -->
|
||||
|
||||
<div class="ydoc-banner-bg">
|
||||
<div class="ydoc-banner ">
|
||||
<div class="ydoc-banner-area">
|
||||
<h1 >YApi</h1>
|
||||
<p class="desc ">高效、易用、功能强大的api管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ydoc-container">
|
||||
|
||||
<div class="ydoc-container-content">
|
||||
|
||||
|
||||
<div class="content-left " role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-认识 YApi.html">认识 YApi</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-创建第一个API.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-项目管理.html">项目管理</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口配置.html">接口配置</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="usage-接口调试.html">接口调试</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#介绍">介绍</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#安装 crossRequest chrome 插件">安装 crossRequest chrome 插件</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#使用说明">使用说明</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用mock功能.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用测试集.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-成为组长.html">成为组长</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-权限列表.html">权限列表</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body " role="main">
|
||||
|
||||
<h2 class="subject" id="介绍2">介绍 <a class="hashlink" href="#介绍2">#</a></h2><h2 class="subject" id="安装 crossRequest chrome 插件3">安装 crossRequest chrome 插件 <a class="hashlink" href="#安装 crossRequest chrome 插件3">#</a></h2><h2 class="subject" id="使用说明4">使用说明 <a class="hashlink" href="#使用说明4">#</a></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2016 <a href="http://ued.qunar.com/ymfe/">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>.
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="open-panel"></div>
|
||||
<div class="mask"></div>
|
||||
|
||||
|
||||
<script src="source/main.js"></script>
|
||||
<script src="source/app.js"></script>
|
||||
|
||||
<script>
|
||||
var lineHeight = 17.4;
|
||||
var EXAMPLE_MAX_HEIGHT;
|
||||
|
||||
function fold() {
|
||||
// 折叠code
|
||||
$('.markdown-body pre').css({
|
||||
"line-height": lineHeight + "px"
|
||||
});
|
||||
$('.markdown-body pre').map(function(i, item) {
|
||||
var $item = $(item);
|
||||
var foldnumber = $item.data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
if ($item.height() > EXAMPLE_MAX_HEIGHT) {
|
||||
$item.css({
|
||||
"padding-bottom": 30
|
||||
});
|
||||
$item.find('code').height(EXAMPLE_MAX_HEIGHT);
|
||||
$item.append('<span class="extend">展开更多……</span>');
|
||||
};
|
||||
});
|
||||
$('.ydoc-example').delegate('.extend', 'click', function() {
|
||||
var $this = $(this);
|
||||
$this.removeClass('extend').addClass('fold');
|
||||
$this.html('折叠代码');
|
||||
$this.prev().height('auto');
|
||||
$this.prev().parent().height('auto');
|
||||
});
|
||||
$('.ydoc-example').delegate('.fold', 'click', function() {
|
||||
var $this = $(this);
|
||||
var foldnumber = $this.parent().data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
$this.removeClass('fold').addClass('extend');
|
||||
$this.parent().height(EXAMPLE_MAX_HEIGHT); // pre
|
||||
$this.prev().height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
212
static/doc/usage-接口配置.html
Normal file
212
static/doc/usage-接口配置.html
Normal file
@ -0,0 +1,212 @@
|
||||
<!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">
|
||||
<title>YApi 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
<header class="ydoc-header">
|
||||
<div class="ydoc-header-area">
|
||||
|
||||
<a href="http://ued.qunar.com/ymfe/" class="navbar-brand">YMFE</a>
|
||||
|
||||
<button class="ydocIcon navbar-toggle"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="index.html">首页</a>
|
||||
</li>
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="usage.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="manage.html">管理学院</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- <header style="height:20px"></header> -->
|
||||
|
||||
<!-- Docs page layout -->
|
||||
|
||||
<div class="ydoc-banner-bg">
|
||||
<div class="ydoc-banner ">
|
||||
<div class="ydoc-banner-area">
|
||||
<h1 >YApi</h1>
|
||||
<p class="desc ">高效、易用、功能强大的api管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ydoc-container">
|
||||
|
||||
<div class="ydoc-container-content">
|
||||
|
||||
|
||||
<div class="content-left " role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-认识 YApi.html">认识 YApi</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-创建第一个API.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-项目管理.html">项目管理</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="usage-接口配置.html">接口配置</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#介绍">介绍</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#配置说明">配置说明</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口调试.html">接口调试</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用mock功能.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用测试集.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-成为组长.html">成为组长</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-权限列表.html">权限列表</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body " role="main">
|
||||
|
||||
<h2 class="subject" id="介绍1">介绍 <a class="hashlink" href="#介绍1">#</a></h2><h2 class="subject" id="配置说明">配置说明 <a class="hashlink" href="#配置说明">#</a></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2016 <a href="http://ued.qunar.com/ymfe/">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>.
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="open-panel"></div>
|
||||
<div class="mask"></div>
|
||||
|
||||
|
||||
<script src="source/main.js"></script>
|
||||
<script src="source/app.js"></script>
|
||||
|
||||
<script>
|
||||
var lineHeight = 17.4;
|
||||
var EXAMPLE_MAX_HEIGHT;
|
||||
|
||||
function fold() {
|
||||
// 折叠code
|
||||
$('.markdown-body pre').css({
|
||||
"line-height": lineHeight + "px"
|
||||
});
|
||||
$('.markdown-body pre').map(function(i, item) {
|
||||
var $item = $(item);
|
||||
var foldnumber = $item.data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
if ($item.height() > EXAMPLE_MAX_HEIGHT) {
|
||||
$item.css({
|
||||
"padding-bottom": 30
|
||||
});
|
||||
$item.find('code').height(EXAMPLE_MAX_HEIGHT);
|
||||
$item.append('<span class="extend">展开更多……</span>');
|
||||
};
|
||||
});
|
||||
$('.ydoc-example').delegate('.extend', 'click', function() {
|
||||
var $this = $(this);
|
||||
$this.removeClass('extend').addClass('fold');
|
||||
$this.html('折叠代码');
|
||||
$this.prev().height('auto');
|
||||
$this.prev().parent().height('auto');
|
||||
});
|
||||
$('.ydoc-example').delegate('.fold', 'click', function() {
|
||||
var $this = $(this);
|
||||
var foldnumber = $this.parent().data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
$this.removeClass('fold').addClass('extend');
|
||||
$this.parent().height(EXAMPLE_MAX_HEIGHT); // pre
|
||||
$this.prev().height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
200
static/doc/usage-权限列表.html
Normal file
200
static/doc/usage-权限列表.html
Normal file
@ -0,0 +1,200 @@
|
||||
<!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">
|
||||
<title>YApi 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
<header class="ydoc-header">
|
||||
<div class="ydoc-header-area">
|
||||
|
||||
<a href="http://ued.qunar.com/ymfe/" class="navbar-brand">YMFE</a>
|
||||
|
||||
<button class="ydocIcon navbar-toggle"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="index.html">首页</a>
|
||||
</li>
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="usage.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="manage.html">管理学院</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- <header style="height:20px"></header> -->
|
||||
|
||||
<!-- Docs page layout -->
|
||||
|
||||
<div class="ydoc-banner-bg">
|
||||
<div class="ydoc-banner ">
|
||||
<div class="ydoc-banner-area">
|
||||
<h1 >YApi</h1>
|
||||
<p class="desc ">高效、易用、功能强大的api管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ydoc-container">
|
||||
|
||||
<div class="ydoc-container-content">
|
||||
|
||||
|
||||
<div class="content-left " role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-认识 YApi.html">认识 YApi</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-创建第一个API.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-项目管理.html">项目管理</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口配置.html">接口配置</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口调试.html">接口调试</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用mock功能.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用测试集.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-成为组长.html">成为组长</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="usage-权限列表.html">权限列表</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body " role="main">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2016 <a href="http://ued.qunar.com/ymfe/">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>.
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="open-panel"></div>
|
||||
<div class="mask"></div>
|
||||
|
||||
|
||||
<script src="source/main.js"></script>
|
||||
<script src="source/app.js"></script>
|
||||
|
||||
<script>
|
||||
var lineHeight = 17.4;
|
||||
var EXAMPLE_MAX_HEIGHT;
|
||||
|
||||
function fold() {
|
||||
// 折叠code
|
||||
$('.markdown-body pre').css({
|
||||
"line-height": lineHeight + "px"
|
||||
});
|
||||
$('.markdown-body pre').map(function(i, item) {
|
||||
var $item = $(item);
|
||||
var foldnumber = $item.data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
if ($item.height() > EXAMPLE_MAX_HEIGHT) {
|
||||
$item.css({
|
||||
"padding-bottom": 30
|
||||
});
|
||||
$item.find('code').height(EXAMPLE_MAX_HEIGHT);
|
||||
$item.append('<span class="extend">展开更多……</span>');
|
||||
};
|
||||
});
|
||||
$('.ydoc-example').delegate('.extend', 'click', function() {
|
||||
var $this = $(this);
|
||||
$this.removeClass('extend').addClass('fold');
|
||||
$this.html('折叠代码');
|
||||
$this.prev().height('auto');
|
||||
$this.prev().parent().height('auto');
|
||||
});
|
||||
$('.ydoc-example').delegate('.fold', 'click', function() {
|
||||
var $this = $(this);
|
||||
var foldnumber = $this.parent().data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
$this.removeClass('fold').addClass('extend');
|
||||
$this.parent().height(EXAMPLE_MAX_HEIGHT); // pre
|
||||
$this.prev().height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -9,13 +9,7 @@
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<title>YApi 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -38,6 +32,11 @@
|
||||
<a href="usage.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="manage.html">管理学院</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></a>
|
||||
@ -64,10 +63,10 @@
|
||||
|
||||
<div class="ydoc-container">
|
||||
|
||||
<div class="ydoc-container-content ">
|
||||
<div class="ydoc-container-content">
|
||||
|
||||
|
||||
<div class="content-left staticsidenav" role="complementary">
|
||||
<div class="content-left " role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
@ -103,17 +102,53 @@
|
||||
<a href="usage-创建第一个API.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-项目管理.html">项目管理</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口配置.html">接口配置</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口调试.html">接口调试</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用mock功能.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用测试集.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-成为组长.html">成为组长</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-权限列表.html">权限列表</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
<div class="content-right markdown-body " role="main">
|
||||
|
||||
<p>YApi 是高效、易用、功能强大的api管理平台。
|
||||
<!-- 它有扁平化的管理结构(`超管`-`组长`-`组员`),有清晰的接口组织方式(`分组`-`项目`-`接口`),有更方便的mock方案。 --></p>
|
||||
@ -163,7 +198,7 @@
|
||||
<script src="source/app.js"></script>
|
||||
|
||||
<script>
|
||||
var lineHeight = 18;
|
||||
var lineHeight = 17.4;
|
||||
var EXAMPLE_MAX_HEIGHT;
|
||||
|
||||
function fold() {
|
||||
@ -187,8 +222,8 @@
|
||||
var $this = $(this);
|
||||
$this.removeClass('extend').addClass('fold');
|
||||
$this.html('折叠代码');
|
||||
$this.parent().children('.js-code').height('auto');
|
||||
$this.parent().height('auto');
|
||||
$this.prev().height('auto');
|
||||
$this.prev().parent().height('auto');
|
||||
});
|
||||
$('.ydoc-example').delegate('.fold', 'click', function() {
|
||||
var $this = $(this);
|
||||
@ -196,7 +231,7 @@
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
$this.removeClass('fold').addClass('extend');
|
||||
$this.parent().height(EXAMPLE_MAX_HEIGHT); // pre
|
||||
$this.parent().children('.js-code').height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.prev().height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
|
216
static/doc/usage-项目管理.html
Normal file
216
static/doc/usage-项目管理.html
Normal file
@ -0,0 +1,216 @@
|
||||
<!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">
|
||||
<title>YApi 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
<header class="ydoc-header">
|
||||
<div class="ydoc-header-area">
|
||||
|
||||
<a href="http://ued.qunar.com/ymfe/" class="navbar-brand">YMFE</a>
|
||||
|
||||
<button class="ydocIcon navbar-toggle"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="index.html">首页</a>
|
||||
</li>
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="usage.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="manage.html">管理学院</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- <header style="height:20px"></header> -->
|
||||
|
||||
<!-- Docs page layout -->
|
||||
|
||||
<div class="ydoc-banner-bg">
|
||||
<div class="ydoc-banner ">
|
||||
<div class="ydoc-banner-area">
|
||||
<h1 >YApi</h1>
|
||||
<p class="desc ">高效、易用、功能强大的api管理平台,旨在为开发、产品、测试人员提供更优雅的接口管理服务。</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ydoc-container">
|
||||
|
||||
<div class="ydoc-container-content">
|
||||
|
||||
|
||||
<div class="content-left " role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-认识 YApi.html">认识 YApi</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-创建第一个API.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="usage-项目管理.html">项目管理</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#介绍">介绍</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#安装 crossRequest chrome 插件">安装 crossRequest chrome 插件</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#使用说明">使用说明</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口配置.html">接口配置</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口调试.html">接口调试</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用mock功能.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用测试集.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-成为组长.html">成为组长</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-权限列表.html">权限列表</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body " role="main">
|
||||
|
||||
<h2 class="subject" id="介绍">介绍 <a class="hashlink" href="#介绍">#</a></h2><h2 class="subject" id="安装 crossRequest chrome 插件">安装 crossRequest chrome 插件 <a class="hashlink" href="#安装 crossRequest chrome 插件">#</a></h2><h2 class="subject" id="使用说明">使用说明 <a class="hashlink" href="#使用说明">#</a></h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 2016 <a href="http://ued.qunar.com/ymfe/">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>.
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="open-panel"></div>
|
||||
<div class="mask"></div>
|
||||
|
||||
|
||||
<script src="source/main.js"></script>
|
||||
<script src="source/app.js"></script>
|
||||
|
||||
<script>
|
||||
var lineHeight = 17.4;
|
||||
var EXAMPLE_MAX_HEIGHT;
|
||||
|
||||
function fold() {
|
||||
// 折叠code
|
||||
$('.markdown-body pre').css({
|
||||
"line-height": lineHeight + "px"
|
||||
});
|
||||
$('.markdown-body pre').map(function(i, item) {
|
||||
var $item = $(item);
|
||||
var foldnumber = $item.data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
if ($item.height() > EXAMPLE_MAX_HEIGHT) {
|
||||
$item.css({
|
||||
"padding-bottom": 30
|
||||
});
|
||||
$item.find('code').height(EXAMPLE_MAX_HEIGHT);
|
||||
$item.append('<span class="extend">展开更多……</span>');
|
||||
};
|
||||
});
|
||||
$('.ydoc-example').delegate('.extend', 'click', function() {
|
||||
var $this = $(this);
|
||||
$this.removeClass('extend').addClass('fold');
|
||||
$this.html('折叠代码');
|
||||
$this.prev().height('auto');
|
||||
$this.prev().parent().height('auto');
|
||||
});
|
||||
$('.ydoc-example').delegate('.fold', 'click', function() {
|
||||
var $this = $(this);
|
||||
var foldnumber = $this.parent().data('foldnumber');
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
$this.removeClass('fold').addClass('extend');
|
||||
$this.parent().height(EXAMPLE_MAX_HEIGHT); // pre
|
||||
$this.prev().height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -9,13 +9,7 @@
|
||||
<meta name="description" content="description of your site">
|
||||
<meta name="author" content="author of the site">
|
||||
<title>YApi 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.css" />
|
||||
|
||||
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="ydoc">
|
||||
@ -38,6 +32,11 @@
|
||||
<a href="usage.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="manage.html">管理学院</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></a>
|
||||
@ -64,10 +63,10 @@
|
||||
|
||||
<div class="ydoc-container">
|
||||
|
||||
<div class="ydoc-container-content ">
|
||||
<div class="ydoc-container-content">
|
||||
|
||||
|
||||
<div class="content-left staticsidenav" role="complementary">
|
||||
<div class="content-left " role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
@ -83,31 +82,67 @@
|
||||
<a href="usage-创建第一个API.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-项目管理.html">项目管理</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口配置.html">接口配置</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-接口调试.html">接口调试</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用mock功能.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-使用测试集.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-成为组长.html">成为组长</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="usage-权限列表.html">权限列表</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
<div class="content-right markdown-body " role="main">
|
||||
|
||||
<p>YApi 是高效、易用、功能强大的api管理平台。
|
||||
<!-- 它有扁平化的管理结构(`超管`-`组长`-`组员`),有清晰的接口组织方式(`分组`-`项目`-`接口`),有更方便的mock方案。 --></p>
|
||||
<p>在开始使用 YApi 之前,我们先来熟悉一下 YApi 的网站结构,这将让你快速了解YApi。</p>
|
||||
<h2 class="subject" id="登录与注册">登录与注册 <a class="hashlink" href="#登录与注册">#</a></h2><p>想要使用 YApi ,首先要拥有账号,目前支持注册账号登录与QSSO登录两种方式。
|
||||
<h2 class="subject" id="登录与注册7">登录与注册 <a class="hashlink" href="#登录与注册7">#</a></h2><p>想要使用 YApi ,首先要拥有账号,目前支持注册账号登录与QSSO登录两种方式。
|
||||
<img src="./images/usage/login.png" /></p>
|
||||
<h2 class="subject" id="首页">首页 <a class="hashlink" href="#首页">#</a></h2><p>登录后进入首页,首页展示了分组与项目。</p>
|
||||
<h2 class="subject" id="首页8">首页 <a class="hashlink" href="#首页8">#</a></h2><p>登录后进入首页,首页展示了分组与项目。</p>
|
||||
<p>此时你作为新用户,没有任何分组与项目的权限,因此只能搜索、浏览 “公开项目” 的接口,如果在首页找不到任何项目,请联系管理员将你加入对应项目。</p>
|
||||
<p>1.首页头部展示了当前所在的位置、搜索框、新建项目、查看文档和用户信息。</p>
|
||||
<p>2.首页左侧展示分组信息,“分组”是“项目”的集合,只有超级管理员可以管理分组。</p>
|
||||
<p>3.首页右侧是分组下的项目和成员列表,点击左侧的某个分组,右侧会出现该分组下的项目和成员信息。</p>
|
||||
<p>4.点击项目右上角的星星即可关注项目,关注的项目可以在“我的关注”页面查看。</p>
|
||||
<p><img src="./images/usage/index.png" /></p>
|
||||
<h2 class="subject" id="项目页">项目页 <a class="hashlink" href="#项目页">#</a></h2><p>点击一个项目,进入项目页,项目页展示了属于该项目的全部接口,并提供项目、接口的全部操作。</p>
|
||||
<h2 class="subject" id="项目页9">项目页 <a class="hashlink" href="#项目页9">#</a></h2><p>点击一个项目,进入项目页,项目页展示了属于该项目的全部接口,并提供项目、接口的全部操作。</p>
|
||||
<p>此时你作为新用户,只能浏览接口信息,不可以编辑项目或接口,如果需要编辑,请联系管理员将你加入该项目。</p>
|
||||
<p>1.项目页左侧的 “接口列表” 展示了该项目下的所有接口,右侧默认显示该项目下所有接口的列表。</p>
|
||||
<p>2.点击左侧的某个接口,右侧会出现“预览”、“编辑”和“运行”。</p>
|
||||
@ -115,7 +150,7 @@
|
||||
<p>4.点击二级导航的“设置”,项目组长即可编辑项目信息和管理成员列表。</p>
|
||||
<p>5.点击二级导航的“动态”,即可查看项目的操作日志。</p>
|
||||
<p><img src="./images/usage/project.png" /></p>
|
||||
<h2 class="subject" id="个人中心">个人中心 <a class="hashlink" href="#个人中心">#</a></h2><p>鼠标移动到右上角的用户头像或用户名上,即可点击“个人中心”查看个人信息。</p>
|
||||
<h2 class="subject" id="个人中心10">个人中心 <a class="hashlink" href="#个人中心10">#</a></h2><p>鼠标移动到右上角的用户头像或用户名上,即可点击“个人中心”查看个人信息。</p>
|
||||
<p><img src="./images/usage/hover.png" /></p>
|
||||
<p>在个人信息页面可以查看并修改自己的用户名、密码等信息。</p>
|
||||
<p><img src="./images/usage/user.png" /></p>
|
||||
@ -143,7 +178,7 @@
|
||||
<script src="source/app.js"></script>
|
||||
|
||||
<script>
|
||||
var lineHeight = 18;
|
||||
var lineHeight = 17.4;
|
||||
var EXAMPLE_MAX_HEIGHT;
|
||||
|
||||
function fold() {
|
||||
@ -167,8 +202,8 @@
|
||||
var $this = $(this);
|
||||
$this.removeClass('extend').addClass('fold');
|
||||
$this.html('折叠代码');
|
||||
$this.parent().children('.js-code').height('auto');
|
||||
$this.parent().height('auto');
|
||||
$this.prev().height('auto');
|
||||
$this.prev().parent().height('auto');
|
||||
});
|
||||
$('.ydoc-example').delegate('.fold', 'click', function() {
|
||||
var $this = $(this);
|
||||
@ -176,7 +211,7 @@
|
||||
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
|
||||
$this.removeClass('fold').addClass('extend');
|
||||
$this.parent().height(EXAMPLE_MAX_HEIGHT); // pre
|
||||
$this.parent().children('.js-code').height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.prev().height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
|
86
ydoc.json
86
ydoc.json
@ -74,54 +74,60 @@
|
||||
}, {
|
||||
"name": "创建第一个API",
|
||||
"content": "./doc/usage/quickstart.md"
|
||||
},{
|
||||
"name": "项目管理",
|
||||
"content": "./doc/usage/project.md"
|
||||
}
|
||||
, {
|
||||
"name": "接口配置",
|
||||
"content": "./doc/usage/interface.md"
|
||||
},{
|
||||
"name": "接口调试",
|
||||
"content": "./doc/usage/run.md"
|
||||
}
|
||||
// , {
|
||||
// "name": "接口配置",
|
||||
// "content": "./doc/usage/interface.md"
|
||||
// }
|
||||
, {
|
||||
"name": "使用mock功能",
|
||||
"content": "./doc/usage/mock.md"
|
||||
}
|
||||
// , {
|
||||
// "name": "使用测试集",
|
||||
// "content": "./doc/usage/case.md"
|
||||
// }, {
|
||||
// "name": "成为组长",
|
||||
// "content": "./doc/usage/leader.md"
|
||||
// }, {
|
||||
// "name": "权限列表",
|
||||
// "content": "./doc/usage/authority.md"
|
||||
// }
|
||||
, {
|
||||
"name": "使用测试集",
|
||||
"content": "./doc/usage/case.md"
|
||||
}, {
|
||||
"name": "成为组长",
|
||||
"content": "./doc/usage/leader.md"
|
||||
}, {
|
||||
"name": "权限列表",
|
||||
"content": "./doc/usage/authority.md"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
// {
|
||||
// "name": "manage",
|
||||
// "title": "管理学院",
|
||||
// "banner": {
|
||||
// "title": "管理学院",
|
||||
// "description": "超级管理员、分组/项目组长的学院。"
|
||||
// },
|
||||
// "content": {
|
||||
// "sidebar": true,
|
||||
// "multi": true,
|
||||
// "index": "./doc/manage/intro.md",
|
||||
// "pages": [{
|
||||
// "name": "介绍",
|
||||
// "content": "./doc/manage/intro.md"
|
||||
// }, {
|
||||
// "name": "部署",
|
||||
// "content": "./doc/manage/build.md"
|
||||
// }, {
|
||||
// "name": "超管职责",
|
||||
// "content": "./doc/manage/admin.md"
|
||||
// }, {
|
||||
// "name": "版本升级",
|
||||
// "content": "./doc/manage/update.md"
|
||||
// }]
|
||||
// }
|
||||
// },
|
||||
{
|
||||
"name": "manage",
|
||||
"title": "管理学院",
|
||||
"banner": {
|
||||
"title": "管理学院",
|
||||
"description": "超级管理员、分组/项目组长的学院。"
|
||||
},
|
||||
"content": {
|
||||
"sidebar": true,
|
||||
"multi": true,
|
||||
"index": "./doc/manage/intro.md",
|
||||
"pages": [{
|
||||
"name": "介绍",
|
||||
"content": "./doc/manage/intro.md"
|
||||
}, {
|
||||
"name": "部署",
|
||||
"content": "./doc/manage/build.md"
|
||||
}, {
|
||||
"name": "超管职责",
|
||||
"content": "./doc/manage/admin.md"
|
||||
}, {
|
||||
"name": "版本升级",
|
||||
"content": "./doc/manage/update.md"
|
||||
}]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "api",
|
||||
"title": "",
|
||||
|
Loading…
Reference in New Issue
Block a user