mirror of
https://github.com/yexi-by/dsh-unrestricted.git
synced 2026-11-28 10:30:23 +08:00
修复:改用共享 /api Fetch 路由注册插件 RPC,兼容无 webServer 注入的 Connection(v0.2.11)
This commit is contained in:
1 parent
ae6c7663fe
commit
849fc35ac5
12 files changed
+266
-46
No files matched your search
@@ -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(),
|
||||
|
||||
Reference in new issue
Block a user