重新适配
This commit is contained in:
@@ -72,7 +72,7 @@ const handleZip = (id, ws) => {
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
action: "/custom/getZip", execute: (ws, request) => {
|
action: "/custom/getZip", execute: (ws, request) => {
|
||||||
const {id, cid} = request.params
|
const {id, cid} = request
|
||||||
if (cid) {
|
if (cid) {
|
||||||
controller.abort()
|
controller.abort()
|
||||||
controller = new AbortController()
|
controller = new AbortController()
|
||||||
|
|||||||
@@ -18,8 +18,9 @@ module.exports = {
|
|||||||
actions[ws.action] = ws.execute
|
actions[ws.action] = ws.execute
|
||||||
}
|
}
|
||||||
}).then(() => ws.on('message', res => {
|
}).then(() => ws.on('message', res => {
|
||||||
if (res?.action) {
|
if (res?.data) {
|
||||||
actions[res.action]?.(ws, JSON.parse(res))
|
const data = JSON.parse(res.data)
|
||||||
|
!!data?.action && actions[res.action]?.(ws, data)
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user