From ead4df22dca33a867279471821ca675f91dec760 Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期六, 14 五月 2022 18:44:54 +0800
Subject: [PATCH] FixIssue0514

---
 force-app/main/default/pages/SWOFileUploadPage.page |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/force-app/main/default/pages/SWOFileUploadPage.page b/force-app/main/default/pages/SWOFileUploadPage.page
index 561fb41..837505c 100644
--- a/force-app/main/default/pages/SWOFileUploadPage.page
+++ b/force-app/main/default/pages/SWOFileUploadPage.page
@@ -1,5 +1,5 @@
 <!-- 璇ラ〉闈㈢敤浜嶭ead瀵硅薄涓婁紶PDF锛屾湭鏉ュ鏋滆娣诲姞鍏朵粬瀵硅薄鐨勪笂浼燩DF鍔熻兘锛屽鍒惰椤甸潰锛屽皢**standardController**淇敼涓哄叾浠栧璞PI鍚嶇О鍗冲彲 -->
-<apex:page standardController="SWO__c" extensions="FileUploadController" id="page" lightningStyleSheets="true">
+<apex:page standardController="SWO__c" showHeader="false" sidebar="false" extensions="FileUploadController" id="page" lightningStyleSheets="true">
     <apex:includeScript value="{! URLFOR($Resource.AWSService, 'AWSService.js') }" />
     <script>
         var staticResources = JSON.parse('{!staticResource}');
@@ -56,16 +56,22 @@
         }
         function confirmTrans(transId, isSuccess) {
             
-            AWSService.post(staticResources.updateUrl, JSON.stringify({
-                "txId":transId,
-                "sfRecordId":"",
-                "isSuccess":isSuccess
-            }), function(result){
+            fetch(staticResources.updateUrl, {
+                method: 'POST',
+                body: JSON.stringify({ 'txId': transId, "isSuccess": isSuccess }),
+                headers: {
+                    'Content-Type': 'application/json',
+                    'pi-token': staticResources.token
+                }
+            }).then((data) => {
+                return data.json();
+            }).then(data => {
                 console.log("confirmTrans-" + JSON.stringify(data));
                 document.getElementById("file").files[0].name = '';
                 enableButtonStatus();
-                refreshFiles();   
-            }, staticResources.token);
+                refreshFiles();            
+                return data.status;
+            })
             
         }
         function calculateFileSize(fileObject) {

--
Gitblit v1.9.1