예제 #1
0
 public static void GetPermission()
 {
     if (EnablePermission)
     {
         //未获取,或者不是同一个人,或者不是同一个应用,则从权限中心获取
         if (Wanda.Platform.Permission.ClientComponent.PermissionCenterProxy.GetPCDataStatus() == Wanda.Platform.Permission.ClientComponent.PermissionCenterDataStatus.NotReady ||
             GetCurrentUser != PermissionCenterProxy.GetUserLoginName() ||
             PCClientIdentity.CurrentApplicationCode != PermissionCenterProxy.GetApplicationCode()
             )
         {
             try
             {
                 PermissionCenterProxy.GetPermission();
                 NLogHelper.Log.Info(string.Format("{0} {1} GetPermission", PermissionCenterProxy.GetUserLoginName(), DateTime.Now.ToString()),
                                     NLogHelper.MakeLogObj(NLogHelper.BusinessID_Const, PermissionCenterProxy.GetUserLoginName()),
                                     NLogHelper.MakeLogObj(NLogHelper.MethodName_Const, "GetPermission"),
                                     NLogHelper.MakeLogObj(NLogHelper.BizAppCode_Const, "ZCPT")
                                     );
             }
             catch (Exception e)
             {
                 NLogHelper.Log.Error(e.ToString(),
                                      NLogHelper.MakeLogObj(NLogHelper.BusinessID_Const, PermissionCenterProxy.GetUserLoginName()),
                                      NLogHelper.MakeLogObj(NLogHelper.MethodName_Const, "GetPermission"),
                                      NLogHelper.MakeLogObj(NLogHelper.BizAppCode_Const, "ZCPT")
                                      );
             }
         }
     }
 }