From f230c720655620fccb5cc5fd8d1991ffbf10c982 Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期二, 30 五月 2023 14:13:04 +0800
Subject: [PATCH] bakcupclass

---
 force-app/main/default/classes/LayoutDescriberHelper.cls |   32 ++++++++++++--------------------
 1 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/force-app/main/default/classes/LayoutDescriberHelper.cls b/force-app/main/default/classes/LayoutDescriberHelper.cls
index 967fa25..9df6681 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,33 +211,25 @@
     }
 
     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();    
+        }       
+        Http client = new Http(); 
+        System.debug('req = ' + req);   
         resp = client.send(req);
         system.debug('Schema Body:'+JSON.serialize(resp.getBody()));
         return resp.getBody();
@@ -276,10 +269,9 @@
         @AuraEnabled public boolean isPlaceHolder {get;set;}      
         @AuraEnabled public String defaultValue{set;get;}      
     }
-public static Integer ControllerUtil() {
-Integer i = 0;
-
-return i;
-}
+    public static Integer ControllerUtil() {
+        Integer i = 0;
+        return i;
+    }
 
 }
\ No newline at end of file

--
Gitblit v1.9.1