chore: WebSocket 演示地址切换为 wss://echo.websocket.org(含存量数据迁移)
This commit is contained in:
1 parent
f1911450d1
commit
2ff3f4270b
3 files changed
+12
-3
No files matched your search
@@ -31,7 +31,7 @@ export function WebsocketEditor({ node }: { node: WebsocketApiNode }) {
|
||||
<span className="ops-chip inline-flex items-center gap-1" style={{ padding: "2px 10px" }}><Icon name="zap" size={13} /> WS</span>
|
||||
<VarHintInput
|
||||
className="ops-input flex-1 font-mono text-[13px]"
|
||||
placeholder="wss://echo.websocket.events"
|
||||
placeholder="wss://echo.websocket.org"
|
||||
value={data.url}
|
||||
onChange={(v) => patch({ url: v })}
|
||||
/>
|
||||
|
||||
@@ -148,6 +148,15 @@ function sanitizeCollections(collections: Collection[]): Collection[] {
|
||||
const fix = (nodes: CollectionNode[]): CollectionNode[] =>
|
||||
nodes.map((n) => {
|
||||
if (n.type === "folder") return { ...n, children: fix(n.children) };
|
||||
// 一次性迁移:旧演示地址更新为新的公共 echo 服务
|
||||
if (
|
||||
n.type === "request" &&
|
||||
n.kind === "websocket" &&
|
||||
n.data &&
|
||||
(n.data as { url?: string }).url === "wss://echo.websocket.events"
|
||||
) {
|
||||
(n.data as { url: string }).url = "wss://echo.websocket.org";
|
||||
}
|
||||
if (n.type === "request" && (!n.data || !n.kind)) {
|
||||
const kind = (n.kind ?? "http") as RequestKind;
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user