public with sharing class QuolifiedApplySPOController { @AuraEnabled public static InitData init(String recordId){ InitData res = new initData(); ID myUserID = UserInfo.getUserId(); try { Account report = [SELECT Id,Is_Active__c FROM Account WHERE Id = :recordId]; User userinfo = [SELECT id,ProfileId,Job_Category__c FROM User WHERE Id = :myUserID LIMIT 1]; res.IsActive = report.Is_Active__c; res.ProfileId = userinfo.ProfileId; res.JobCategory = userinfo.Job_Category__c; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } return res; } @AuraEnabled public static String updata(String recordId){ Account rac = new Account(); try { rac.Id = recordId; rac.Quolified_Approve_Status__c = '已提交至SPO'; rac.If_Qualifying__c = true; rac.If_Need_Quolified__c = true; update rac; } catch (Exception e) { throw new AuraHandledException(e.getMessage()); } return 'ok'; } public class InitData{ @AuraEnabled public string IsActive; @AuraEnabled public string ProfileId; @AuraEnabled public string JobCategory; } }