修复:改用共享 /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

+3 -2
View File
@@ -8,7 +8,8 @@ window.__ModuleLoader__.load({
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
let react_jsx_runtime = require("react/jsx-runtime");
//#region src/client/controller.ts
const RPC_CHANNEL = "/dsh-unrestricted";
const RPC_CHANNEL = "/api";
const RPC_NAMESPACE = "dsh-unrestricted";
const SETTINGS_NS = "unrestricted";
/** Human-readable error text for the banner. */
function messageOf(error) {
@@ -64,7 +65,7 @@ window.__ModuleLoader__.load({
};
}
async function call(endpoint, payload) {
const result = await connection.rpc.call(RPC_CHANNEL, endpoint, payload);
const result = await connection.rpc.call(RPC_CHANNEL, `${RPC_NAMESPACE}/${endpoint}`, payload);
if (!result.ok) throw new Error(result.error.message);
return result.value;
}