1234567891011121314151617181920212223 |
- /*
- * @Author: HonorLee
- * @Version 1.0
- * @LastUpdate 2018/6/21
- * @License MIT
- */
- 'use strict'
- global.M = function(moduleName){
- if(!moduleName){
- LOGGER.error('Module name is empty!');
- return null;
- }
- let modulePath = Core.Path.Module + '/' + moduleName + '.js';
- let Module;
- try{
- Module = require(modulePath);
- }catch(e){
- LOGGER.error('Module load error:');
- LOGGER.error(e);
- return null;
- }
- return Module;
- };
|