public Task <HttpResponseMessage> CheckLogin(string uuid) { ResponseBase <CheckLoginResponse> response = new ResponseBase <CheckLoginResponse>(); try { var result = _wechat.CheckLoginQRCode(uuid); CheckLoginResponse checkLoginResponse = new CheckLoginResponse(); checkLoginResponse.State = result.State; checkLoginResponse.Uuid = result.Uuid; checkLoginResponse.WxId = result.WxId; checkLoginResponse.NickName = result.NickName; checkLoginResponse.Device = result.Device; checkLoginResponse.HeadUrl = result.HeadUrl; checkLoginResponse.Mobile = result.BindMobile; checkLoginResponse.Email = result.BindEmail; checkLoginResponse.Alias = result.Alias; response.Data = checkLoginResponse; } catch (ExpiredException ex) { response.Success = false; response.Code = "401"; response.Message = ex.Message; } catch (Exception ex) { response.Success = false; response.Code = "500"; response.Message = ex.Message; } return(response.ToHttpResponseAsync()); }
public Error <CheckLoginResp> CheckLogin([FromRoute] string qrCodeId) { var result = _wechat.CheckLoginQRCode(qrCodeId); if (result != null) { CheckLoginResp checkLoginResponse = new CheckLoginResp(); checkLoginResponse.State = result.State; checkLoginResponse.Uuid = result.Uuid; checkLoginResponse.WxId = result.WxId; checkLoginResponse.NickName = result.NickName; checkLoginResponse.Device = result.Device; checkLoginResponse.HeadUrl = result.HeadUrl; checkLoginResponse.Mobile = result.BindMobile; checkLoginResponse.Email = result.BindEmail; checkLoginResponse.Alias = result.Alias; return(Error <CheckLoginResp> .New().WithCode(ErrorCode.OK).WithData(checkLoginResponse)); } return(Error <CheckLoginResp> .New().WithCode(ErrorCode.ErrInterServcerErr).WithMessage("登录失败")); }
public Task <HttpResponseMessage> CheckLogin(string uuid) { ResponseBase <CheckLoginResponse> response = new ResponseBase <CheckLoginResponse>(); var result = _wechat.CheckLoginQRCode(uuid); CheckLoginResponse checkLoginResponse = new CheckLoginResponse(); checkLoginResponse.State = result.State; checkLoginResponse.Uuid = result.Uuid; checkLoginResponse.WxId = result.WxId; checkLoginResponse.NickName = result.NickName; checkLoginResponse.Device = result.Device; checkLoginResponse.HeadUrl = result.HeadUrl; checkLoginResponse.Mobile = result.BindMobile; checkLoginResponse.Email = result.BindEmail; checkLoginResponse.Alias = result.Alias; checkLoginResponse.Data62 = result.Remark; response.Data = checkLoginResponse; return(response.ToHttpResponseAsync()); }