feat(ctrt): 完成 CTRT-01~03 响应契约统一 - 三端拦截器+portal_token清理+调用点适配
This commit is contained in:
@@ -18,10 +18,9 @@ import router from '@/router'
|
||||
import { useWebSocket } from '@/composables/useWebSocket'
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Token 存储 key
|
||||
// Token 存储 key(C8:移除 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))
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user