浏览代码

Update mysql funcs

HonorLee 7 年之前
父节点
当前提交
8849644f16
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      system/lib/core/view.js

+ 4 - 3
system/lib/core/view.js

@@ -5,13 +5,14 @@ var View = function(src,params){
     this.params = params?params:{};
     this.params = params?params:{};
 
 
     if(!src.match(Core.Path.View)){
     if(!src.match(Core.Path.View)){
-        src = Core.Path.View + src;
+        src = Core.Path.View + src + '.html';
     }
     }
 
 
-    if(FILE.existsSync(src)){
+    try{
+        FILE.statSync(src);
         var data = FILE.readFileSync(src,'UTF-8');
         var data = FILE.readFileSync(src,'UTF-8');
         this.html = EJS.render(data,this.params);
         this.html = EJS.render(data,this.params);
-    }else{
+    }catch(e){
         return null;
         return null;
     }
     }