mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-06 12:45:22 +08:00
Merge branch 'doc' into dev-doc
This commit is contained in:
commit
4dc00aed43
63
doc/page/plugin/dev.md
Normal file
63
doc/page/plugin/dev.md
Normal file
@ -0,0 +1,63 @@
|
||||
## 运行开发服务器
|
||||
```
|
||||
npm install
|
||||
npm install -g ykit //依赖 ykit
|
||||
npm run dev
|
||||
```
|
||||
## 初始化目录
|
||||
|
||||
可参考 项目vendors/exts 目录下的插件
|
||||
|
||||
在 vendors/node_modules 下新建 yapi-plugin-demo 目录和 npm init,最后生成的目录接口如下
|
||||
```
|
||||
yapi-plugin-demo
|
||||
client.js //客户端入口文件
|
||||
server.js //服务端入口文件
|
||||
packjson.json //插件依赖管理
|
||||
index.js //插件配置文件
|
||||
```
|
||||
|
||||
## index.js 配置说明
|
||||
```
|
||||
server: true // 如果为true,表名该插件需要经过后端服务器加载
|
||||
client: true // 如果为true,表名该插件需要经过前端编译
|
||||
```
|
||||
|
||||
## server.js
|
||||
在server.js 需要导出一个 function ,例如: module.exports = function(options){}
|
||||
|
||||
options 可在 config.json 配置
|
||||
### 绑定钩子
|
||||
```
|
||||
this.bindHook(hookname, listener) //绑定钩子
|
||||
hookname //钩子名
|
||||
listener //监听函数,可以是普通函数,也可以是 asyncFunction
|
||||
```
|
||||
|
||||
### 如何使用 YApi vendors/server 目录下的模块
|
||||
可以直接 require vendors 目录下的模块,注意:后端 node 不能使用 import关键字,只能使用 require
|
||||
例如: require('yapi')
|
||||
|
||||
### 加载插件
|
||||
在config.json plugins配置项,加入 demo,例如:
|
||||
```
|
||||
{
|
||||
...
|
||||
plugins: {
|
||||
name: 'demo'
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### controller 和 model
|
||||
新增 controller 需要继承 baseController(controller/base.js)
|
||||
|
||||
新增 model 需要继承 baseModel(model/base.js)
|
||||
|
||||
## client.js
|
||||
### 绑定钩子(同后端 server.js )
|
||||
```
|
||||
this.bindHook(hookname, listener) //绑定钩子
|
||||
hookname //钩子名
|
||||
listener //监听函数,可以是普通函数,也可以是 asyncFunction
|
||||
```
|
165
doc/page/plugin/hooks.md
Normal file
165
doc/page/plugin/hooks.md
Normal file
@ -0,0 +1,165 @@
|
||||
## 后端 hookList
|
||||
目前 hooksList 只有下面列出的部分,如果您有其他的需求,可提建议到 github 或者 qq群
|
||||
```
|
||||
/**
|
||||
* 钩子配置
|
||||
*/
|
||||
var hooks = {
|
||||
/**
|
||||
* 第三方sso登录钩子,暂只支持设置一个
|
||||
* @param ctx
|
||||
*/
|
||||
'third_login': {
|
||||
type: 'single',
|
||||
listener: null
|
||||
},
|
||||
/**
|
||||
* 客户端增加接口成功后触发
|
||||
* @param id 接口id
|
||||
*/
|
||||
'interface_add': {
|
||||
type: 'multi',
|
||||
listener: []
|
||||
},
|
||||
/**
|
||||
* 客户端删除接口成功后触发
|
||||
* @param id 接口id
|
||||
*/
|
||||
'interface_del': {
|
||||
type: 'multi',
|
||||
listener: []
|
||||
},
|
||||
/**
|
||||
* 客户端更新接口成功后触发
|
||||
* @param id 接口id
|
||||
*/
|
||||
'interface_update':{
|
||||
type: 'multi',
|
||||
listener: []
|
||||
},
|
||||
/**
|
||||
* 客户端获取接口数据列表
|
||||
* @param id project_id
|
||||
*/
|
||||
'interface_list':{
|
||||
type: 'multi',
|
||||
listener: []
|
||||
},
|
||||
/**
|
||||
* 客户端获取一条接口信息触发
|
||||
* @param id 接口id
|
||||
*/
|
||||
'interface_get':{
|
||||
type: 'multi',
|
||||
listener: []
|
||||
},
|
||||
/**
|
||||
* 客户端增加一个新项目
|
||||
* @param id 项目id
|
||||
*/
|
||||
'project_add':{
|
||||
type: 'multi',
|
||||
listener: []
|
||||
},
|
||||
/**
|
||||
* 客户端删除删除一个项目
|
||||
* @param id 项目id
|
||||
*/
|
||||
'project_del':{
|
||||
type: 'multi',
|
||||
listener: []
|
||||
},
|
||||
/**
|
||||
* MockServer生成mock数据后触发
|
||||
* @param context Object
|
||||
* {
|
||||
* projectData: project,
|
||||
interfaceData: interfaceData,
|
||||
ctx: ctx,
|
||||
mockJson: res
|
||||
* }
|
||||
*
|
||||
*/
|
||||
mock_after: {
|
||||
type: 'multi',
|
||||
listener: []
|
||||
},
|
||||
/**
|
||||
* 增加路由的钩子
|
||||
* type Sync
|
||||
* @param addPluginRouter Function
|
||||
* addPLuginPLugin(config)
|
||||
* config = {
|
||||
* path, // String
|
||||
* method, // String
|
||||
* controller // Class 继承baseController的class
|
||||
* action // String controller的Action
|
||||
* }
|
||||
*/
|
||||
add_router: {
|
||||
type: 'multi',
|
||||
listener: []
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
## 前端 hookList
|
||||
```
|
||||
/**
|
||||
* type component 组件
|
||||
* listener 监听函数
|
||||
* mulit 是否绑定多个监听函数
|
||||
*
|
||||
*/
|
||||
|
||||
hooks = {
|
||||
/**
|
||||
* 第三方登录 //可参考 yapi-plugin-qsso 插件
|
||||
*/
|
||||
third_login: {
|
||||
type: 'component',
|
||||
mulit: false,
|
||||
listener: null
|
||||
},
|
||||
/**
|
||||
* 导入数据
|
||||
* @param importDataModule
|
||||
*
|
||||
* @info
|
||||
* 可参考 vendors/exts/yapi-plugin-import-swagger插件
|
||||
* importDataModule = {};
|
||||
*
|
||||
*/
|
||||
import_data: {
|
||||
type: 'listener',
|
||||
mulit: true,
|
||||
listener: []
|
||||
},
|
||||
/**
|
||||
* 接口页面 tab 钩子
|
||||
* @param InterfaceTabs
|
||||
*
|
||||
* @info
|
||||
* 可参考 vendors/exts/yapi-plugin-advanced-mock
|
||||
* let InterfaceTabs = {
|
||||
view: {
|
||||
component: View,
|
||||
name: '预览'
|
||||
},
|
||||
edit: {
|
||||
component: Edit,
|
||||
name: '编辑'
|
||||
},
|
||||
run: {
|
||||
component: Run,
|
||||
name: '运行'
|
||||
}
|
||||
}
|
||||
*/
|
||||
interface_tab: {
|
||||
type: 'listener',
|
||||
mulit: true,
|
||||
listener: []
|
||||
}
|
||||
};
|
||||
```
|
13
doc/page/plugin/index.md
Normal file
13
doc/page/plugin/index.md
Normal file
@ -0,0 +1,13 @@
|
||||
## 安装
|
||||
假设插件名为:yapi-plugin-demo,安装方法如下:
|
||||
```
|
||||
cd {项目目录}
|
||||
yapi-cli plugin yapi-plugin-demo
|
||||
```
|
||||
|
||||
## 卸载插件
|
||||
假设插件名为:yapi-plugin-demo,卸载方法如下:
|
||||
```
|
||||
cd {项目目录}
|
||||
yapi-cli unplugin yapi-plugin-demo
|
||||
```
|
18
doc/page/plugin/list.md
Normal file
18
doc/page/plugin/list.md
Normal file
@ -0,0 +1,18 @@
|
||||
## 插件列表
|
||||
<ul id="list">
|
||||
|
||||
</ul>
|
||||
|
||||
<script>
|
||||
window.onload = function(){
|
||||
var list = [{
|
||||
title: 'yapi-plugin-qsso',
|
||||
url: 'https://github.com/ymfe/yapi-plugin-qsso',
|
||||
desc: 'qunar 专用 sso 第三方登录'
|
||||
}];
|
||||
var el = $('#list');
|
||||
list.forEach(function(item){
|
||||
el.append("<li>" + '<a target="_black" href=' + item.url + ">" + item.title + "</a>" + " " + item.desc + "</li>")
|
||||
})
|
||||
}
|
||||
</script>
|
@ -289,9 +289,11 @@ class interfaceController extends baseController {
|
||||
desc: 'string',
|
||||
catid: 'number'
|
||||
});
|
||||
|
||||
params.method = params.method || 'GET';
|
||||
params.method = params.method.toUpperCase();
|
||||
if (!_.isUndefined(params.method)) {
|
||||
params.method = params.method || 'GET';
|
||||
params.method = params.method.toUpperCase();
|
||||
}
|
||||
|
||||
|
||||
let id = ctx.request.body.id;
|
||||
|
||||
|
@ -38,6 +38,11 @@
|
||||
<a href="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
|
@ -38,6 +38,11 @@
|
||||
<a href="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
|
@ -38,6 +38,11 @@
|
||||
<a href="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
|
@ -38,6 +38,11 @@
|
||||
<a href="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
|
@ -38,6 +38,11 @@
|
||||
<a href="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
|
@ -38,6 +38,11 @@
|
||||
<a href="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
|
@ -38,6 +38,11 @@
|
||||
<a href="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
|
@ -38,6 +38,11 @@
|
||||
<a href="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
|
@ -38,6 +38,11 @@
|
||||
<a href="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
|
200
static/doc/plugin-dev.html
Normal file
200
static/doc/plugin-dev.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 插件Wiki</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.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="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="http://yapi.demo.qunar.com/" target="_blank">YApi Demo</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 staticsidenav" role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="plugin-index.html">插件管理</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="plugin-dev.html">插件开发</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#运行开发服务器">运行开发服务器</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#初始化目录">初始化目录</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#index.js_配置说明">index.js 配置说明</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#server.js">server.js</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#client.js">client.js</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="plugin-hooks.html">钩子列表</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="plugin-list.html">插件列表</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
|
||||
<h2 class="subject" id="运行开发服务器">运行开发服务器 <a class="hashlink" href="#运行开发服务器">#</a></h2><pre><code>npm install
|
||||
npm install -g ykit //依赖 ykit
|
||||
npm run dev
|
||||
</code></pre><h2 class="subject" id="初始化目录">初始化目录 <a class="hashlink" href="#初始化目录">#</a></h2><p>可参考 项目vendors/exts 目录下的插件</p>
|
||||
<p>在 vendors/node_modules 下新建 yapi-plugin-demo 目录和 npm init,最后生成的目录接口如下</p>
|
||||
<pre><code>yapi-plugin-demo
|
||||
client.js //客户端入口文件
|
||||
server.js //服务端入口文件
|
||||
packjson.json //插件依赖管理
|
||||
index.js //插件配置文件
|
||||
</code></pre><h2 class="subject" id="index.js_配置说明">index.js 配置说明 <a class="hashlink" href="#index.js_配置说明">#</a></h2><pre><code>server<span class="token operator">:</span> <span class="token boolean">true</span> // 如果为<span class="token boolean">true</span><span class="token punctuation">,</span>表名该插件需要经过后端服务器加载
|
||||
client<span class="token operator">:</span> <span class="token boolean">true</span> // 如果为<span class="token boolean">true</span><span class="token punctuation">,</span>表名该插件需要经过前端编译
|
||||
</code></pre><h2 class="subject" id="server.js">server.js <a class="hashlink" href="#server.js">#</a></h2><p>在server.js 需要导出一个 function ,例如: module.exports = function(options){}</p>
|
||||
<p>options 可在 config.json 配置</p>
|
||||
<h3 class="subject" id="绑定钩子">绑定钩子 <a class="hashlink" href="#绑定钩子">#</a></h3><pre><code>this.bindHook(hookname<span class="token punctuation">,</span> listener<span class="token punctuation">)</span> //绑定钩子
|
||||
hookname //钩子名
|
||||
listener //监听函数,可以是普通函数,也可以是 asyncFunction
|
||||
</code></pre><h3 class="subject" id="如何使用_YApi_vendors_server_目录下的模块">如何使用 YApi vendors/server 目录下的模块 <a class="hashlink" href="#如何使用_YApi_vendors_server_目录下的模块">#</a></h3><p>可以直接 require vendors 目录下的模块,注意:后端 node 不能使用 import关键字,只能使用 require
|
||||
例如: require('yapi')</p>
|
||||
<h3 class="subject" id="加载插件">加载插件 <a class="hashlink" href="#加载插件">#</a></h3><p>在config.json plugins配置项,加入 demo,例如:</p>
|
||||
<pre><code><span class="token punctuation">{</span>
|
||||
...
|
||||
plugins<span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
name<span class="token operator">:</span> 'demo'
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre><h3 class="subject" id="controller_和_model">controller 和 model <a class="hashlink" href="#controller_和_model">#</a></h3><p>新增 controller 需要继承 baseController(controller/base.js)</p>
|
||||
<p>新增 model 需要继承 baseModel(model/base.js)</p>
|
||||
<h2 class="subject" id="client.js">client.js <a class="hashlink" href="#client.js">#</a></h2><h3 class="subject" id="绑定钩子_同后端_server.js__">绑定钩子(同后端 server.js ) <a class="hashlink" href="#绑定钩子_同后端_server.js__">#</a></h3><pre><code>this.bindHook(hookname<span class="token punctuation">,</span> listener<span class="token punctuation">)</span> //绑定钩子
|
||||
hookname //钩子名
|
||||
listener //监听函数,可以是普通函数,也可以是 asyncFunction
|
||||
</code></pre>
|
||||
</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>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
315
static/doc/plugin-hooks.html
Normal file
315
static/doc/plugin-hooks.html
Normal file
@ -0,0 +1,315 @@
|
||||
<!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 插件Wiki</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.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="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="http://yapi.demo.qunar.com/" target="_blank">YApi Demo</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 staticsidenav" role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="plugin-index.html">插件管理</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="plugin-dev.html">插件开发</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="plugin-hooks.html">钩子列表</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#后端_hookList">后端 hookList</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#前端_hookList">前端 hookList</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="plugin-list.html">插件列表</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
|
||||
<h2 class="subject" id="后端_hookList">后端 hookList <a class="hashlink" href="#后端_hookList">#</a></h2><p>目前 hooksList 只有下面列出的部分,如果您有其他的需求,可提建议到 github 或者 qq群</p>
|
||||
<pre><code>/**
|
||||
* 钩子配置
|
||||
*/
|
||||
var hooks = <span class="token punctuation">{</span>
|
||||
/**
|
||||
* 第三方sso登录钩子,暂只支持设置一个
|
||||
* @param ctx
|
||||
*/
|
||||
'third_login'<span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
type<span class="token operator">:</span> 'single'<span class="token punctuation">,</span>
|
||||
listener<span class="token operator">:</span> <span class="token null">null</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
/**
|
||||
* 客户端增加接口成功后触发
|
||||
* @param id 接口id
|
||||
*/
|
||||
'interface_add'<span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
type<span class="token operator">:</span> 'multi'<span class="token punctuation">,</span>
|
||||
listener<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
/**
|
||||
* 客户端删除接口成功后触发
|
||||
* @param id 接口id
|
||||
*/
|
||||
'interface_del'<span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
type<span class="token operator">:</span> 'multi'<span class="token punctuation">,</span>
|
||||
listener<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
/**
|
||||
* 客户端更新接口成功后触发
|
||||
* @param id 接口id
|
||||
*/
|
||||
'interface_update'<span class="token operator">:</span><span class="token punctuation">{</span>
|
||||
type<span class="token operator">:</span> 'multi'<span class="token punctuation">,</span>
|
||||
listener<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
/**
|
||||
* 客户端获取接口数据列表
|
||||
* @param id project_id
|
||||
*/
|
||||
'interface_list'<span class="token operator">:</span><span class="token punctuation">{</span>
|
||||
type<span class="token operator">:</span> 'multi'<span class="token punctuation">,</span>
|
||||
listener<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
/**
|
||||
* 客户端获取一条接口信息触发
|
||||
* @param id 接口id
|
||||
*/
|
||||
'interface_get'<span class="token operator">:</span><span class="token punctuation">{</span>
|
||||
type<span class="token operator">:</span> 'multi'<span class="token punctuation">,</span>
|
||||
listener<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
/**
|
||||
* 客户端增加一个新项目
|
||||
* @param id 项目id
|
||||
*/
|
||||
'project_add'<span class="token operator">:</span><span class="token punctuation">{</span>
|
||||
type<span class="token operator">:</span> 'multi'<span class="token punctuation">,</span>
|
||||
listener<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
/**
|
||||
* 客户端删除删除一个项目
|
||||
* @param id 项目id
|
||||
*/
|
||||
'project_del'<span class="token operator">:</span><span class="token punctuation">{</span>
|
||||
type<span class="token operator">:</span> 'multi'<span class="token punctuation">,</span>
|
||||
listener<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
/**
|
||||
* MockServer生成mock数据后触发
|
||||
* @param context Object
|
||||
* <span class="token punctuation">{</span>
|
||||
* projectData<span class="token operator">:</span> project<span class="token punctuation">,</span>
|
||||
interfaceData<span class="token operator">:</span> interfaceData<span class="token punctuation">,</span>
|
||||
ctx<span class="token operator">:</span> ctx<span class="token punctuation">,</span>
|
||||
mockJson<span class="token operator">:</span> res
|
||||
* <span class="token punctuation">}</span>
|
||||
*
|
||||
*/
|
||||
mock_after<span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
type<span class="token operator">:</span> 'multi'<span class="token punctuation">,</span>
|
||||
listener<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
/**
|
||||
* 增加路由的钩子
|
||||
* type Sync
|
||||
* @param addPluginRouter Function
|
||||
* addPLuginPLugin(config<span class="token punctuation">)</span>
|
||||
* config = <span class="token punctuation">{</span>
|
||||
* path<span class="token punctuation">,</span> // String
|
||||
* method<span class="token punctuation">,</span> // String
|
||||
* controller // Class 继承baseController的class
|
||||
* action // String controller的Action
|
||||
* <span class="token punctuation">}</span>
|
||||
*/
|
||||
add_router<span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
type<span class="token operator">:</span> 'multi'<span class="token punctuation">,</span>
|
||||
listener<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">;</span>
|
||||
</code></pre><h2 class="subject" id="前端_hookList">前端 hookList <a class="hashlink" href="#前端_hookList">#</a></h2><pre><code>/**
|
||||
* type component 组件
|
||||
* listener 监听函数
|
||||
* mulit 是否绑定多个监听函数
|
||||
*
|
||||
*/
|
||||
|
||||
hooks = <span class="token punctuation">{</span>
|
||||
/**
|
||||
* 第三方登录 //可参考 yapi-plugin-qsso 插件
|
||||
*/
|
||||
third_login<span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
type<span class="token operator">:</span> 'component'<span class="token punctuation">,</span>
|
||||
mulit<span class="token operator">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>
|
||||
listener<span class="token operator">:</span> <span class="token null">null</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
/**
|
||||
* 导入数据
|
||||
* @param importDataModule
|
||||
*
|
||||
* @info
|
||||
* 可参考 vendors/exts/yapi-plugin-import-swagger插件
|
||||
* importDataModule = <span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">;</span>
|
||||
*
|
||||
*/
|
||||
import_data<span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
type<span class="token operator">:</span> 'listener'<span class="token punctuation">,</span>
|
||||
mulit<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
|
||||
listener<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
/**
|
||||
* 接口页面 tab 钩子
|
||||
* @param InterfaceTabs
|
||||
*
|
||||
* @info
|
||||
* 可参考 vendors/exts/yapi-plugin-advanced-mock
|
||||
* let InterfaceTabs = <span class="token punctuation">{</span>
|
||||
view<span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
component<span class="token operator">:</span> View<span class="token punctuation">,</span>
|
||||
name<span class="token operator">:</span> '预览'
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
edit<span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
component<span class="token operator">:</span> Edit<span class="token punctuation">,</span>
|
||||
name<span class="token operator">:</span> '编辑'
|
||||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||||
run<span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
component<span class="token operator">:</span> Run<span class="token punctuation">,</span>
|
||||
name<span class="token operator">:</span> '运行'
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">}</span>
|
||||
*/
|
||||
interface_tab<span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
type<span class="token operator">:</span> 'listener'<span class="token punctuation">,</span>
|
||||
mulit<span class="token operator">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>
|
||||
listener<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">;</span>
|
||||
</code></pre>
|
||||
</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>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
163
static/doc/plugin-index.html
Normal file
163
static/doc/plugin-index.html
Normal file
@ -0,0 +1,163 @@
|
||||
<!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 插件Wiki</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.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="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="http://yapi.demo.qunar.com/" target="_blank">YApi Demo</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 staticsidenav" 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="plugin-index.html">插件管理</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#安装">安装</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#卸载插件">卸载插件</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="plugin-dev.html">插件开发</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="plugin-hooks.html">钩子列表</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="plugin-list.html">插件列表</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
|
||||
<h2 class="subject" id="安装">安装 <a class="hashlink" href="#安装">#</a></h2><p>假设插件名为:yapi-plugin-demo,安装方法如下:</p>
|
||||
<pre><code>cd <span class="token punctuation">{</span>项目目录<span class="token punctuation">}</span>
|
||||
yapi-cli plugin yapi-plugin-demo
|
||||
</code></pre><h2 class="subject" id="卸载插件">卸载插件 <a class="hashlink" href="#卸载插件">#</a></h2><p>假设插件名为:yapi-plugin-demo,卸载方法如下:</p>
|
||||
<pre><code>cd <span class="token punctuation">{</span>项目目录<span class="token punctuation">}</span>
|
||||
yapi-cli unplugin yapi-plugin-demo
|
||||
</code></pre>
|
||||
</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>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
169
static/doc/plugin-list.html
Normal file
169
static/doc/plugin-list.html
Normal file
@ -0,0 +1,169 @@
|
||||
<!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 插件Wiki</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.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="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="http://yapi.demo.qunar.com/" target="_blank">YApi Demo</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 staticsidenav" role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="plugin-index.html">插件管理</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="plugin-dev.html">插件开发</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="plugin-hooks.html">钩子列表</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="plugin-list.html">插件列表</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" style="display:block;" >
|
||||
|
||||
<li class="active" >
|
||||
<a href="#插件列表">插件列表</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
|
||||
<h2 class="subject" id="插件列表">插件列表 <a class="hashlink" href="#插件列表">#</a></h2><ul id="list">
|
||||
|
||||
</ul>
|
||||
|
||||
<script>
|
||||
window.onload = function(){
|
||||
var list = [{
|
||||
title: 'yapi-plugin-qsso',
|
||||
url: 'https://github.com/ymfe/yapi-plugin-qsso',
|
||||
desc: 'qunar 专用 sso 第三方登录'
|
||||
}];
|
||||
var el = $('#list');
|
||||
list.forEach(function(item){
|
||||
el.append("<li>" + '<a target="_black" href=' + item.url + ">" + item.title + "</a>" + " " + item.desc + "</li>")
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</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>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
151
static/doc/plugin.html
Normal file
151
static/doc/plugin.html
Normal file
@ -0,0 +1,151 @@
|
||||
<!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 插件Wiki</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.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="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="http://yapi.demo.qunar.com/" target="_blank">YApi Demo</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 staticsidenav" role="complementary">
|
||||
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
|
||||
<ul class="nav docs-sidenav">
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="plugin-index.html">插件管理</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="plugin-dev.html">插件开发</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="plugin-hooks.html">钩子列表</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="plugin-list.html">插件列表</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
|
||||
<h2 class="subject" id="安装">安装 <a class="hashlink" href="#安装">#</a></h2><p>假设插件名为:yapi-plugin-demo,安装方法如下:</p>
|
||||
<pre><code>cd <span class="token punctuation">{</span>项目目录<span class="token punctuation">}</span>
|
||||
yapi-cli plugin yapi-plugin-demo
|
||||
</code></pre><h2 class="subject" id="卸载插件">卸载插件 <a class="hashlink" href="#卸载插件">#</a></h2><p>假设插件名为:yapi-plugin-demo,卸载方法如下:</p>
|
||||
<pre><code>cd <span class="token punctuation">{</span>项目目录<span class="token punctuation">}</span>
|
||||
yapi-cli unplugin yapi-plugin-demo
|
||||
</code></pre>
|
||||
</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>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
@ -38,6 +38,11 @@
|
||||
<a href="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
|
@ -38,6 +38,11 @@
|
||||
<a href="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
|
@ -38,6 +38,11 @@
|
||||
<a href="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
|
@ -38,6 +38,11 @@
|
||||
<a href="devops.html">内网部署</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="plugin.html">插件Wiki</a>
|
||||
</li>
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
|
31
ydoc.json
31
ydoc.json
@ -104,6 +104,37 @@
|
||||
"compile": "markdown",
|
||||
"menuLevel": 2,
|
||||
"content": "./doc/page/manage/build.md"
|
||||
},
|
||||
{
|
||||
"name": "plugin",
|
||||
"title": "插件Wiki",
|
||||
"banner": {
|
||||
"title": "插件",
|
||||
"description": "可根据业务需求,定制化功能"
|
||||
},
|
||||
"content": {
|
||||
"sidebar": true,
|
||||
"multi": true,
|
||||
"index": "./doc/page/plugin/index.md",
|
||||
"pages": [{
|
||||
"name": "插件管理",
|
||||
"index": "plugin-index",
|
||||
"content": "./doc/page/plugin/index.md"
|
||||
},{
|
||||
"name": "插件开发",
|
||||
"index": "plugin-dev",
|
||||
"content": "./doc/page/plugin/dev.md"
|
||||
},{
|
||||
"name": "钩子列表",
|
||||
"index": "plugin-hooks",
|
||||
"content": "./doc/page/plugin/hooks.md"
|
||||
},{
|
||||
"name": "插件列表",
|
||||
"index": "plugin-list",
|
||||
"content": "./doc/page/plugin/list.md"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "releases",
|
||||
|
Loading…
Reference in New Issue
Block a user