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()}`
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { request } from "@/lib/api/client"
|
||||
import { generateUUID } from "@/lib/utils"
|
||||
import { createWebSocketBaseUrl } from "@/lib/api/websocket"
|
||||
|
||||
export type Paging = {
|
||||
page: number
|
||||
@@ -125,16 +124,6 @@ export function getImVisitorId() {
|
||||
return visitorId
|
||||
}
|
||||
|
||||
export function createImWebSocketUrl() {
|
||||
const baseUrl = createWebSocketBaseUrl()
|
||||
const params = new URLSearchParams({
|
||||
externalId: getImVisitorId(),
|
||||
externalSource: OPEN_IM_EXTERNAL_SOURCE,
|
||||
channelId: OPEN_IM_CHANNEL_ID,
|
||||
})
|
||||
return `${baseUrl}/api/open/im/ws?${params.toString()}`
|
||||
}
|
||||
|
||||
function createImHeaders() {
|
||||
return {
|
||||
"X-External-Source": OPEN_IM_EXTERNAL_SOURCE,
|
||||
|
||||
Reference in New Issue
Block a user