Authored by htoooth

refactor

@@ -20,7 +20,7 @@ const logger = global.yoho.logger; @@ -20,7 +20,7 @@ const logger = global.yoho.logger;
20 20
21 const TYPE = require('./type'); 21 const TYPE = require('./type');
22 22
23 -const DIR = './rule/'; 23 +const DIR = './rules/';
24 24
25 const curDir = path.resolve(__dirname, DIR); 25 const curDir = path.resolve(__dirname, DIR);
26 const files = fs.readdirSync(curDir); 26 const files = fs.readdirSync(curDir);
@@ -38,7 +38,7 @@ files.forEach((file) => { @@ -38,7 +38,7 @@ files.forEach((file) => {
38 try { 38 try {
39 domainRules[module] = require(loadPath); 39 domainRules[module] = require(loadPath);
40 } catch (e) { 40 } catch (e) {
41 - logger.error('load rule wrong', e); 41 + logger.error('load rules wrong', e);
42 } 42 }
43 } 43 }
44 }); 44 });
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 */ 3 */
4 4
5 'use strict'; 5 'use strict';
  6 +
6 const helpers = global.yoho.helpers; 7 const helpers = global.yoho.helpers;
7 const TYPE = require('../type'); 8 const TYPE = require('../type');
8 9
1 /** 1 /**
2 * Created by TaoHuang on 2017/2/21. 2 * Created by TaoHuang on 2017/2/21.
3 */ 3 */
4 -'use strict;' 4 +
  5 +'use strict';
5 6
6 const helpers = global.yoho.helpers; 7 const helpers = global.yoho.helpers;
7 const TYPE = require('../type'); 8 const TYPE = require('../type');
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
3 */ 3 */
4 4
5 'use strict'; 5 'use strict';
  6 +
6 const helpers = global.yoho.helpers; 7 const helpers = global.yoho.helpers;
7 const TYPE = require('../type'); 8 const TYPE = require('../type');
8 9
@@ -4,7 +4,6 @@ @@ -4,7 +4,6 @@
4 * @date: 2016/6/16 4 * @date: 2016/6/16
5 */ 5 */
6 'use strict'; 6 'use strict';
7 -const helpers = global.yoho.helpers;  
8 7
9 module.exports = () => { 8 module.exports = () => {
10 return (req, res, next) => { 9 return (req, res, next) => {