修复:改用共享 /api Fetch 路由注册插件 RPC,兼容无 webServer 注入的 Connection(v0.2.11)

This commit is contained in:
yexi committed 2026-11-17 19:36:10 +08:00
1 parent ae6c7663fe
commit 849fc35ac5
12 files changed
+266 -46

No files matched your search

+9 -1
View File
@@ -28,7 +28,15 @@ async function fixture() {
set: (field, next) => defer('write', { field, next }),
}
const ctx = {
get: () => ({ rpc: { call: (_channel, endpoint, payload) => defer(endpoint, payload) } }),
get: () => ({
rpc: {
call: (channel, method, payload) => {
assert.equal(channel, '/api')
assert.match(method, /^dsh-unrestricted\//)
return defer(method.slice('dsh-unrestricted/'.length), payload)
},
},
}),
configForms: { get: () => settings },
remote: { $on(event, listener) { events.set(event, listener); return () => events.delete(event) } },
effect: effect => effect(),