Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev

This commit is contained in:
wenbo.dong 2017-09-05 17:36:57 +08:00
commit 4b12b442ac
2 changed files with 3 additions and 2 deletions

View File

@ -6,7 +6,7 @@
"scripts": {
"dev-server": "nodemon server/app.js dev -L",
"install-server": "node server/install.js",
"dev-client": "ykit s -p 4000",
"dev-client": "ykit watch",
"dev": "npm run dev-server & npm run dev-client",
"server": "node server/app.js"
},

View File

@ -50,7 +50,8 @@ module.exports = function(){
if(yapi.WEBCONFIG.plugins && Array.isArray(yapi.WEBCONFIG.plugins)){
yapi.WEBCONFIG.plugins.forEach(plugin=>{
if(!yapi.commons.fileExist(yapi.path.join(plugin_path, 'yapi-plugin-' + plugin + '/server.js'))){
throw new Error(`请安装插件(${plugin}), npm install yapi-plugin-${plugin}`)
throw new Error(`请安装插件(${plugin}), npm install yapi-plugin-${plugin}`);
process.exit();
}
let pluginModule = require(yapi.path.join(plugin_path, 'yapi-plugin-' + plugin + '/server.js'));
pluginModule.apply(yapi)