From 22ae69256f66f4e413f577a32732e9de200e73e5 Mon Sep 17 00:00:00 2001
From: tony.cheng <chengmingwei_1984122@126.com>
Date: Fri, 13 Mar 2026 09:57:19 +0800
Subject: [PATCH] feat: 实现URL auth_token 转换为 Authorization 请求头传递

---
 web-app/src/contexts/CaseDataContext.jsx |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/web-app/src/contexts/CaseDataContext.jsx b/web-app/src/contexts/CaseDataContext.jsx
index 61ab9dd..9b5f344 100644
--- a/web-app/src/contexts/CaseDataContext.jsx
+++ b/web-app/src/contexts/CaseDataContext.jsx
@@ -143,6 +143,7 @@
               personId: item.personId,
               mediationId: item.mediationId,
               caseId: String(caseId), // 添加 caseId 字段用于轮询
+              perTypeName: item.perTypeName || '', // 当事人类型名称(申请方当事人/被申请方当事人)
               perClassName: item.perClassName || '', // 添加人员类型名称
               trueName: item.trueName || '', // 添加真实姓名
               startTime: item.createdTime || item.start_time,
@@ -153,6 +154,7 @@
             failedJobs.push({
               personId: item.personId,
               message: item.message || '未知错误',
+              perTypeName: item.perTypeName || '', // 当事人类型名称(申请方当事人/被申请方当事人)
               perClassName: item.perClassName || '', // 添加人员类型名称
               trueName: item.trueName || '', // 添加真实姓名
               errorCode: item.errorCode, // 添加错误码
@@ -176,6 +178,11 @@
             localStorage.setItem(`${OUTBOUND_JOBS_KEY}_failed`, JSON.stringify(remainingFailedJobs));
             console.log('外呼成功后清除失败记录,清除数量:', storedFailedJobs.length - remainingFailedJobs.length);
           }
+          
+          // 触发自定义事件,通知 OutboundCallWidget 组件立即刷新
+          setTimeout(() => {
+            window.dispatchEvent(new CustomEvent('outbound-jobs-updated'));
+          }, 300);
         }
 
         // 存储失败的任务到 localStorage(用于气泡显示)
@@ -384,11 +391,13 @@
       }
 
       // 调用API获取数据
+      // 将URL中的auth_token转换为authorization传入API
       const response = await ProcessAPIService.getCaseProcessInfo(
         params.caseId,
         {
           caseTypeFirst: params.caseTypeFirst,
-          platform_code: params.platform_code
+          platform_code: params.platform_code,
+          authorization: params.auth_token || params.authorization || ''
         }
       );
 

--
Gitblit v1.8.0