Authored by weiqingting

提交

... ... @@ -20,12 +20,23 @@ util.inherits(Interfacer,Emitter);
Interfacer.prototype.register = function(mos) {
var me=this,name=mos.namespace;
if(!name){
console.info(" Interfacer name can not empty");
}
for(var key in mos.apis){
var name_key=name+"_"+key;
if(me.isExisted(name_key)){
console.info("can not add repeat Interfacer key,please checkout");
}
/*需要进行验证判断*/
me.apis[name+"_"+key]=mos.apis[key];
me.apis[name_key]=mos.apis[key];
}
};
Interfacer.prototype.isExisted=function(key){
return !!this.apis[key];
};
function __requestApi(config, apiOpt, req, callback){
var me=this;
if (typeof apiOpt == "function") {
... ... @@ -52,6 +63,9 @@ function __requestApi(config, apiOpt, req, callback){
if(_.isPlainObject(apiOpt.params)){
for(var name in apiOpt.params){
var param=apiOpt.params[name];
if(param.default){
data[name]=param.type(param.default);
}
if(req.param(name)){
data[name]=param.type(req.param(name));
}
... ...
... ... @@ -39,7 +39,7 @@
<div class="panel-footer">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<a class="btn btn-default" href="/supplier/baseproduct/index">取消</a>
<a class="btn btn-default" href="/product/base/index">取消</a>
<button type="submit" class="btn btn-success mr5" data-loading-text="保存中..." id="btnReview">提交审核</button>
</div>
</div>
... ...