Browse Source

optimize router && add Wechat api

HonorLee 6 years ago
parent
commit
7c875e2e41

+ 5 - 5
config.js

@@ -1,5 +1,5 @@
 /**
 /**
- * @Author  HonorLee (deve@honorlee.me)
+ * @Author  HonorLee (dev@honorlee.me)
  * @Version 1.0 (2018-05-04)
  * @Version 1.0 (2018-05-04)
  * @License MIT
  * @License MIT
  */
  */
@@ -58,12 +58,12 @@ Database:{
 
 
 Wechat:{
 Wechat:{
     on:true,
     on:true,
-    token:'HonorLee',
-    appId:'wxe55b22a89a7743f2',
-    appSecret:'c33d9654d442dc48a6686309838513f0',
+    token:'',
+    appId:'',
+    appSecret:'',
     apiDomain:'api.weixin.qq.com',
     apiDomain:'api.weixin.qq.com',
     handler_path:'/wechat',
     handler_path:'/wechat',
-    StoreType:'Memcache'
+    StoreType:'File'
 },
 },
 
 
 //If Debug on,log && info logs will output in console;except Error!
 //If Debug on,log && info logs will output in console;except Error!

+ 1 - 1
server.js

@@ -1,6 +1,6 @@
 /**
 /**
  * NodeJS-MVC 1.0
  * NodeJS-MVC 1.0
- * @Author  HonorLee (deve@honorlee.me)
+ * @Author  HonorLee (dev@honorlee.me)
  * @Version 1.0 (2018-05-04)
  * @Version 1.0 (2018-05-04)
  * @License MIT
  * @License MIT
  */
  */

+ 2 - 2
system/core.js

@@ -1,5 +1,5 @@
 /**
 /**
- * @Author  HonorLee (deve@honorlee.me)
+ * @Author  HonorLee (dev@honorlee.me)
  * @Version 1.0 (2018-05-04)
  * @Version 1.0 (2018-05-04)
  * @License MIT
  * @License MIT
  */
  */
@@ -25,7 +25,7 @@ global.Core.Path = {
 };
 };
 
 
 //Global Extension Require 
 //Global Extension Require 
-global.serverUID   = (Math.ceil(Math.random()*61439+4096)).toString(16).toUpperCase();
+global.serverUID    = (Math.ceil(Math.random()*61439+4096)).toString(16).toUpperCase();
 global.Moment       = require('moment-range').extendMoment(require('moment'));
 global.Moment       = require('moment-range').extendMoment(require('moment'));
 global.URL          = require('url');
 global.URL          = require('url');
 global.Querystring  = require('querystring');
 global.Querystring  = require('querystring');

+ 5 - 1
system/lib/core/handler.js

@@ -1,5 +1,5 @@
 /**
 /**
- * @Author  HonorLee (deve@honorlee.me)
+ * @Author  HonorLee (dev@honorlee.me)
  * @Version 1.0 (2018-05-04)
  * @Version 1.0 (2018-05-04)
  * @License MIT
  * @License MIT
  */
  */
@@ -38,6 +38,10 @@ module.exports = function(req,res){
         this.Response.write(endContent);
         this.Response.write(endContent);
         this.Response.end();
         this.Response.end();
     }
     }
+    this.endRedirect = this.responseRedirect = function(status,location){
+        this.Response.writeHead(status,{'Location':location});
+        this.Response.end();
+    }
     /**
     /**
      * [responseInJSON description]
      * [responseInJSON description]
      * @param  {[type]} somthing [String,Number,Object]
      * @param  {[type]} somthing [String,Number,Object]

+ 1 - 1
system/lib/core/helper.js

@@ -1,5 +1,5 @@
 /**
 /**
- * @Author  HonorLee (deve@honorlee.me)
+ * @Author  HonorLee (dev@honorlee.me)
  * @Version 1.0 (2018-05-04)
  * @Version 1.0 (2018-05-04)
  * @License MIT
  * @License MIT
  */
  */

+ 1 - 1
system/lib/core/image.js

@@ -1,5 +1,5 @@
 /**
 /**
- * @Author  HonorLee (deve@honorlee.me)
+ * @Author  HonorLee (dev@honorlee.me)
  * @Version 1.0 (2018-05-04)
  * @Version 1.0 (2018-05-04)
  * @License MIT
  * @License MIT
  */
  */

+ 1 - 1
system/lib/core/logger.js

@@ -1,5 +1,5 @@
 /**
 /**
- * @Author  HonorLee (deve@honorlee.me)
+ * @Author  HonorLee (dev@honorlee.me)
  * @Version 1.0 (2018-05-04)
  * @Version 1.0 (2018-05-04)
  * @License MIT
  * @License MIT
  */
  */

+ 1 - 1
system/lib/core/router.js

@@ -1,5 +1,5 @@
 /**
 /**
- * @Author  HonorLee (deve@honorlee.me)
+ * @Author  HonorLee (dev@honorlee.me)
  * @Version 1.0 (2018-05-04)
  * @Version 1.0 (2018-05-04)
  * @License MIT
  * @License MIT
  */
  */

+ 1 - 1
system/lib/core/session.js

@@ -1,5 +1,5 @@
 /**
 /**
- * @Author  HonorLee (deve@honorlee.me)
+ * @Author  HonorLee (dev@honorlee.me)
  * @Version 1.0 (2018-05-04)
  * @Version 1.0 (2018-05-04)
  * @License MIT
  * @License MIT
  */
  */

+ 1 - 1
system/lib/core/static.js

@@ -1,5 +1,5 @@
 /**
 /**
- * @Author  HonorLee (deve@honorlee.me)
+ * @Author  HonorLee (dev@honorlee.me)
  * @Version 1.0 (2018-05-04)
  * @Version 1.0 (2018-05-04)
  * @License MIT
  * @License MIT
  */
  */

+ 1 - 1
system/lib/core/system.js

@@ -1,5 +1,5 @@
 /**
 /**
- * @Author  HonorLee (deve@honorlee.me)
+ * @Author  HonorLee (dev@honorlee.me)
  * @Version 1.0 (2018-05-04)
  * @Version 1.0 (2018-05-04)
  * @License MIT
  * @License MIT
  */
  */

+ 1 - 1
system/lib/core/view.js

@@ -1,5 +1,5 @@
 /**
 /**
- * @Author  HonorLee (deve@honorlee.me)
+ * @Author  HonorLee (dev@honorlee.me)
  * @Version 1.0 (2018-05-04)
  * @Version 1.0 (2018-05-04)
  * @License MIT
  * @License MIT
  */
  */

+ 1 - 1
system/lib/extra/wechat/errMsg.js

@@ -1,5 +1,5 @@
 /**
 /**
- * @Author  HonorLee (deve@honorlee.me)
+ * @Author  HonorLee (dev@honorlee.me)
  * @Version 1.0 (2018-05-05)
  * @Version 1.0 (2018-05-05)
  * @License MIT
  * @License MIT
  */
  */

+ 1 - 1
system/lib/extra/wechat/wechat.js

@@ -1,5 +1,5 @@
 /**
 /**
- * @Author  HonorLee (deve@honorlee.me)
+ * @Author  HonorLee (dev@honorlee.me)
  * @Version 1.0 (2018-05-05)
  * @Version 1.0 (2018-05-05)
  * @License MIT
  * @License MIT
  */
  */

+ 1 - 1
system/lib/helper/mysqldb.js

@@ -1,5 +1,5 @@
 /**
 /**
- * @Author  HonorLee (deve@honorlee.me)
+ * @Author  HonorLee (dev@honorlee.me)
  * @Version 1.0 (2018-05-04)
  * @Version 1.0 (2018-05-04)
  * @License MIT
  * @License MIT
  */
  */