重新适配

This commit is contained in:
2023-02-16 12:01:46 +08:00
parent aef22a3b14
commit c168a1da0c
2 changed files with 4 additions and 3 deletions

View File

@@ -72,7 +72,7 @@ const handleZip = (id, ws) => {
module.exports = {
action: "/custom/getZip", execute: (ws, request) => {
const {id, cid} = request.params
const {id, cid} = request
if (cid) {
controller.abort()
controller = new AbortController()

View File

@@ -18,8 +18,9 @@ module.exports = {
actions[ws.action] = ws.execute
}
}).then(() => ws.on('message', res => {
if (res?.action) {
actions[res.action]?.(ws, JSON.parse(res))
if (res?.data) {
const data = JSON.parse(res.data)
!!data?.action && actions[res.action]?.(ws, data)
}
}))
})