feat: modify db config_dev

This commit is contained in:
suxiaoxin 2017-07-17 15:51:15 +08:00
parent c3c232694f
commit de689bc921
3 changed files with 11 additions and 12 deletions

View File

@ -26,7 +26,7 @@ class LeftMenu extends Component {
title: '个人资料',
path: '/user/profile'
}, {
title: '用户管理11',
title: '用户管理',
path: '/user/list'
}
]

View File

@ -6,8 +6,8 @@
"servername": "10.86.40.194",
"DATABASE": "yapi",
"port": 27017,
"user": "admin",
"pass": "qunar.com"
"user": "yapi",
"pass": "yapi"
},
"mail": {
"host": "smtp.163.com",

View File

@ -18,24 +18,23 @@ module.exports = async (ctx, next) => {
return ctx.body = yapi.commons.resReturn(null, 403, e.message);
}
let matchProject = [];
let matchProject = false, maxBasepath = 0;
for(let i=0, l = projects.length; i< l; i++){
let project = projects[i];
if(ctx.path && ctx.path.indexOf(project.basepath) === 0 && project.basepath[project.basepath.length -1] === '/'){
matchProject.push(project);
if(project.basepath.length > maxBasepath){
maxBasepath = project.basepath.length;
matchProject = project;
}
}
}
if(matchProject.length === 0){
if(matchProject === false){
return ctx.body = yapi.commons.resReturn(null, 400, '不存在的domain');
}
if(matchProject.length > 1){
return ctx.body = yapi.commons.resReturn(null, 401, '存在多个project,请检查数据库');
}
let project = matchProject[0], interfaceData;
let project = matchProject, interfaceData;
let interfaceInst = yapi.getInst(interfaceModel);
try{
interfaceData = await interfaceInst.getByPath(project._id, ctx.path.substr(project.basepath.length));