From 1a63180b4cabdf8b63e9a93eab8d715a72a01514 Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期三, 24 五月 2023 13:36:46 +0800
Subject: [PATCH] commit

---
 force-app/main/default/classes/LayoutDescriberHelper.cls |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/force-app/main/default/classes/LayoutDescriberHelper.cls b/force-app/main/default/classes/LayoutDescriberHelper.cls
index 967fa25..8041efd 100644
--- a/force-app/main/default/classes/LayoutDescriberHelper.cls
+++ b/force-app/main/default/classes/LayoutDescriberHelper.cls
@@ -40,7 +40,8 @@
         requiredFieldAPIList = new List<String>();
         fieldAPIToLabelMap = new Map<String,String>();
         layoutSections = new List<LayoutSection>();
-        String theRespBody = getLayoutSchema(recordTypeId, objectType,userMode);      
+        String theRespBody = getLayoutSchema(recordTypeId, objectType,userMode);
+        System.debug('theRespBody = ' + theRespBody);      
         Map<String, Object> layoutSection = (Map<String, Object>) JSON.deserializeUntyped(theRespBody);
         Map<String,object> m = new Map<String,object>();
         if(String.isBlank(recordTypeId)){
@@ -210,32 +211,23 @@
     }
 
     public static String getLayoutSchema(Id recordTypeId, String objectType,String userMode){
-        System.debug(LoggingLevel.INFO, '*** recordTypeId: ' + recordTypeId);
-        System.debug(LoggingLevel.INFO, '*** objectType: ' + objectType);
-        System.debug(LoggingLevel.INFO, '*** userMode: ' + userMode);
         String urlPost = '/services/data/v53.0/sobjects/'+objectType+'/describe/layouts/';
-        System.debug(LoggingLevel.INFO, '*** urlPost: ' + urlPost);
         if(String.isNotEmpty(recordTypeId) && String.isNotBlank(recordTypeId)){
             urlPost = urlPost + recordTypeId;
         }
-        System.debug(LoggingLevel.INFO, '*** urlPost: ' + urlPost);
         String urlForClassic = 'https://'+getUrlPrefix()+urlPost;
+        
         system.debug('URL Post:'+urlForClassic);
-        System.debug(LoggingLevel.INFO, '*** UserInfo.getsessionid(): ' + UserInfo.getsessionid());
-        System.debug(LoggingLevel.INFO, '*** paramvalue: ' + EncodingUtil.base64Encode(Blob.valueOf(userinfo.getSessionId())));
         HttpResponse resp = null;
         HttpRequest req = new HttpRequest();         
         req.setMethod('GET');        
         if(userMode =='lightning'){
-            /*req.setEndPoint('callout:SF_Rest_API'+urlPost);
-            system.debug('callout:SF_Rest_API'+urlPost);*/
-            req.setEndpoint(urlForClassic); 
-            req.setHeader('Authorization', 'Bearer ' + UserInfo.getsessionid());
+            req.setEndPoint('callout:SF_Rest_API'+urlPost);
+            system.debug('callout:SF_Rest_API'+urlPost);
         }else if(userMode == 'classic'){
             req.setEndpoint(urlForClassic); 
             req.setHeader('Authorization', 'Bearer ' + UserInfo.getsessionid());
-        }
-        System.debug(LoggingLevel.INFO, '*** req: ' + req);       
+        }       
         Http client = new Http();    
         resp = client.send(req);
         system.debug('Schema Body:'+JSON.serialize(resp.getBody()));
@@ -278,7 +270,6 @@
     }
 public static Integer ControllerUtil() {
 Integer i = 0;
-
 return i;
 }
 

--
Gitblit v1.9.1