Authored by dongjunjie

添加路由校验

... ... @@ -109,6 +109,23 @@ module.exports = function (apiCofig) {
ROU[router.method].apply(ROU, args);
});
/*路由重复校验*/
var checkUsedRouter={};
ContRegisters.routers.forEach(function (router) {
if(checkUsedRouter.hasOwnProperty(router.url)){
console.info("检查下控制器是否重复");
console.log(router.url);
}else{
checkUsedRouter[router.url]=true;
}
var ROU = Router.route([router.url]);
var args = FilterRegisters.use(router.url, router.method).
concat(KLH(ContRegisters, "emit", router.guid));
ROU[router.method].apply(ROU, args);
});
checkUsedRouter=null;
App.use(apiCofig.baseUrl, Router);
App.use(function (req, res, next) {
... ...
... ... @@ -109,6 +109,23 @@ module.exports = function (apiCofig) {
ROU[router.method].apply(ROU, args);
});
/*路由重复校验*/
var checkUsedRouter={};
ContRegisters.routers.forEach(function (router) {
if(checkUsedRouter.hasOwnProperty(router.url)){
console.info("检查下控制器是否重复");
console.log(router.url);
}else{
checkUsedRouter[router.url]=true;
}
var ROU = Router.route([router.url]);
var args = FilterRegisters.use(router.url, router.method).
concat(KLH(ContRegisters, "emit", router.guid));
ROU[router.method].apply(ROU, args);
});
checkUsedRouter=null;
App.use(apiCofig.baseUrl, Router);
App.use(function (req, res, next) {
... ...