socketio封装
This commit is contained in:
1 parent
96bfa3f2d3
commit
c764e7097d
9 files changed
+77
-4
No files matched your search
@@ -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