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

This commit is contained in:
gaoxiaolin.gao 2018-01-25 17:52:53 +08:00
commit 7343c79212
4 changed files with 9 additions and 3 deletions

View File

@ -11,6 +11,8 @@
* 测试集合点击对应接口侧边栏不切换
* 测试集合处,点击删除不成功
* 修改编辑接口后,再回到测试集合处数据不更新问题
* swagger 数据导入支持 2xx 的httpcode
* 修复mongodb帐号密码配置错误时引发的错误
### v1.3.4

View File

@ -195,7 +195,7 @@ function improtData(importDataModule) {
return res_body;
}
_.each(api, (res, code) => {
if (code == 200) {
if (/^2/.test(code)) {
if (res && typeof res === 'object') {
if (res.schema) {

View File

@ -140,4 +140,6 @@ function setupSql() {
}
install();
if(typeof yapi.connect === 'function'){
install();
}

View File

@ -24,7 +24,9 @@ function connect(callback) {
}
let db = mongoose.connect(`mongodb://${config.db.servername}:${config.db.port}/${config.db.DATABASE}`, options);
let db = mongoose.connect(`mongodb://${config.db.servername}:${config.db.port}/${config.db.DATABASE}`, options, function(err){
yapi.commons.log(err +'mongodb Authentication failed', 'error');
});
db.then(function () {
yapi.commons.log('mongodb load success...');