コード例 #1
0
 /// <summary>
 /// 登陆用户
 /// </summary>
 /// <param name="userInfo"></param>
 public static void UserLogin(string uId, RInsuranceUserInfo userInfo)
 {
     try
     {
         RedisLib.Config.RedisHelper.SetHash(db, Tabels.UserInfo, uId, userInfo);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
コード例 #2
0
 /// <summary>
 /// 获取所有角色权限
 /// </summary>
 /// <param name="userInfo"></param>
 /// <returns></returns>
 public static List <string> GetRolePower(RInsuranceUserInfo userInfo)
 {
     try
     {
         if (!userInfo.RoleId.HasValue)
         {
             return(new List <string>());
         }
         var rolePower = RedisLib.Config.RedisHelper.GetHashItem <RRolePower>(db, Tabels.RolePower, userInfo.RoleId.ToString());
         return(rolePower.Powers);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }