refactor(api): remove unused WebSocket URL creation functions from agent and im modules
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import { request } from "@/lib/api/client"
|
||||
import { readSession } from "@/lib/auth"
|
||||
import { createWebSocketBaseUrl } from "@/lib/api/websocket"
|
||||
|
||||
export type Paging = {
|
||||
page: number
|
||||
@@ -254,16 +252,3 @@ export function removeConversationTag(payload: {
|
||||
body: JSON.stringify(payload),
|
||||
})
|
||||
}
|
||||
|
||||
export function createAgentWebSocketUrl() {
|
||||
const session = readSession()
|
||||
if (!session?.accessToken) {
|
||||
throw new Error("未登录或登录已过期")
|
||||
}
|
||||
|
||||
const baseUrl = createWebSocketBaseUrl()
|
||||
const params = new URLSearchParams({
|
||||
accessToken: session.accessToken,
|
||||
})
|
||||
return `${baseUrl}/api/dashboard/ws?${params.toString()}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user