mirror of
https://github.com/thinkjs/thinkjs.git
synced 2026-01-25 14:42:47 +00:00
29 lines
789 B
JavaScript
29 lines
789 B
JavaScript
/**
|
|
* controller
|
|
* @return
|
|
*/
|
|
module.exports = Controller(function(){
|
|
return {
|
|
indexAction: function(){
|
|
this.display("index:index");
|
|
},
|
|
docAction: function(doc){
|
|
var viewFile = VIEW_PATH + "/Home/doc_" + doc + ".html";
|
|
if (isFile(viewFile)) {
|
|
this.assign("nav", doc);
|
|
return this.display("doc:" + doc);
|
|
}else{
|
|
this.assign("nav", "index");
|
|
return this.display("index:index");
|
|
}
|
|
},
|
|
testAction: function(){
|
|
this.session("name", "suredywww");
|
|
var self = this;
|
|
return this.session("name").then(function(value){
|
|
console.log(value);
|
|
self.end();
|
|
})
|
|
}
|
|
}
|
|
}); |