socketio封装
This commit is contained in:
@@ -6,8 +6,8 @@ const config = require("./config")
|
||||
const EventEmitter = require('events');
|
||||
module.exports = async (app) => {
|
||||
app.event = new EventEmitter()
|
||||
const evList = await app.load(config.path)
|
||||
evList.forEach(item => {
|
||||
const list = await app.load(config.path)
|
||||
list.forEach(item => {
|
||||
Object.keys(item.res).forEach(key => {
|
||||
//载入所有事件
|
||||
app.event.on(key, item.res[key])
|
||||
|
||||
Reference in New Issue
Block a user