Example #1
0
 /// <summary>
 /// 更新用户信息
 /// </summary>
 /// <param name="cer"></param>
 public static ResultMsg UpdateCertificate(CertificateDto cer)
 {
     CertificateDto dto = AuthToken.CurrentUser;
     string jsonData = "{tokenId:'" + dto.tokenId + "',"
                       + "Id:'" + dto.Id + "',"
                       + "UserName:'******',"
                       + "NickName:'" + cer.NickName + "',"
                       + "Phone:'" + cer.Phone + "',"
                       + "Email:'" + cer.Email + "',"
                       + "QQ:'" + cer.QQ + "',"
                       + "Address:'" + cer.Address + "',"
                       + "UserPwd:'" + cer.UserPwd + "',"
                       + "NewPwd:'" + cer.NewPwd + "',"
                       + "Sex:'" + cer.Sex + "'}";
     string result = HttpCrossDomain.Post(getUpdateCertificateUrl, jsonData);
     ResultMsg msg = JsonMapper.ToObject<ResultMsg>(result);
     if (msg.success)
         GetCertificate(dto.tokenId);
     return msg;
 }
Example #2
0
 /// <summary>
 /// 设置登录成功信息
 /// </summary>
 /// <param name="User"></param>
 /// <param name="SessionId"></param>
 /// <param name="time"></param>
 public static void SetAuthToken(CertificateDto cer)
 {
     CookieHelper.SaveCookie(Cfg.Matrix_.ToString() + Cfg.TokenId.ToString(), cer.tokenId.ToString(), 60 * 24 * 30);
     //缓存23分钟就到期,到期后,如果token不为空,那么继续到sso系统认证,延长周期
     CacheHelper.CacheInsertAddMinutes(cer.tokenId + Cfg.Cer, cer, 23);
     //获取具有的权限
     List<PermissionDto> list = SSOHelper.GetPermission(cer.tokenId);
     CacheHelper.CacheInsertAddMinutes(cer.tokenId + Cfg.Permission.ToString(), list, 5);
 }