...
|
...
|
@@ -26,7 +26,7 @@ Controller.prototype.__parseReq=function(req){ |
|
|
}
|
|
|
}
|
|
|
|
|
|
Controller.prototype.__define=function(method,router,view,apis,callback,clientmodel){
|
|
|
Controller.prototype.__define=function(method,router,view,apis,callback,clientmodel,clientsrc){
|
|
|
var me=this,isObj=false;
|
|
|
if(typeof apis=="string"){
|
|
|
apis=[apis];
|
...
|
...
|
@@ -49,7 +49,7 @@ Controller.prototype.__define=function(method,router,view,apis,callback,clientmo |
|
|
model=callback.apply(local, args);
|
|
|
}
|
|
|
if(view){
|
|
|
res.render(view,local,me.client(res,view,model,clientmodel));
|
|
|
res.render(view,local,me.client(res,clientsrc,model,clientmodel));
|
|
|
}
|
|
|
|
|
|
return;
|
...
|
...
|
@@ -78,7 +78,7 @@ Controller.prototype.__define=function(method,router,view,apis,callback,clientmo |
|
|
if (model&&model.readable) {
|
|
|
model.pipe(res);
|
|
|
}else if (view && method == "get" && !req.xhr) {
|
|
|
res.render(view, local, me.client(res, view, model,clientmodel));
|
|
|
res.render(view, local, me.client(res, clientsrc, model,clientmodel));
|
|
|
} else {
|
|
|
res.json(model);
|
|
|
}
|
...
|
...
|
@@ -106,7 +106,7 @@ Controller.prototype.vue=function(router,views,apis,callback){ |
|
|
apis=[];
|
|
|
}
|
|
|
apis=apis||[];
|
|
|
me.__define("get",router,views,apis,callback,"vue");
|
|
|
me.__define("get",router,"common.Vue",apis,callback,"vue",views);
|
|
|
}
|
|
|
Controller.prototype.get=function(router,views,apis,callback){
|
|
|
var me=this;
|
...
|
...
|
@@ -120,7 +120,7 @@ Controller.prototype.get=function(router,views,apis,callback){ |
|
|
apis=[];
|
|
|
}
|
|
|
apis=apis||[];
|
|
|
me.__define("get",router,views,apis,callback,"jquery");
|
|
|
me.__define("get",router,views,apis,callback,"jquery",views);
|
|
|
}
|
|
|
Controller.prototype.post=function(router,apis,callback){
|
|
|
var me=this;
|
...
|
...
|
|