feat(ctrt): 完成 CTRT-01~03 响应契约统一 - 三端拦截器+portal_token清理+调用点适配

This commit is contained in:
Simon
2026-07-07 22:56:49 +08:00
parent d56a9a6079
commit 6f0fbbb066
48 changed files with 6183 additions and 613 deletions
+3 -4
View File
@@ -18,10 +18,9 @@ import router from '@/router'
import { useWebSocket } from '@/composables/useWebSocket'
// --------------------------------------------------------------------------
// Token 存储 key
// Token 存储 keyC8:移除 portal_token
// --------------------------------------------------------------------------
const TOKEN_KEY = 'agent_token'
const PORTAL_TOKEN_KEY = 'portal_token'
const AGENT_USER_ID_KEY = 'agent_user_id'
// --------------------------------------------------------------------------
@@ -35,8 +34,8 @@ export const useAgentStore = defineStore('agent', () => {
/** 当前登录的坐席信息 */
const agentInfo = ref<Agent | null>(null)
/** 认证 token — 优先从 agent_token 读取,降级读取 portal_token */
const token = ref<string | null>(localStorage.getItem(TOKEN_KEY) || localStorage.getItem(PORTAL_TOKEN_KEY))
/** 认证 token — 从 agent_token 读取C8:移除 portal_token */
const token = ref<string | null>(localStorage.getItem(TOKEN_KEY))
/** 坐席用户ID */
const agentUserId = ref<string | null>(localStorage.getItem(AGENT_USER_ID_KEY))
+2 -6
View File
@@ -21,14 +21,10 @@ import {
} from '@/api/automation'
// --------------------------------------------------------------------------
// WebSocket 辅助
// WebSocket 辅助C8:移除 portal_token
// --------------------------------------------------------------------------
function getAgentToken(): string {
return (
localStorage.getItem('agent_token') ||
localStorage.getItem('portal_token') ||
''
)
return localStorage.getItem('agent_token') || ''
}
function buildWsUrl(sessionId: string): string {