/// <summary> /// 8、 更新用户信息[PUT]:v1/core/{companyCode}/{appKey}/user /// </summary> /// <param name="input">更新用户输入</param> /// <param name="errorCode">错误代码</param> /// <param name="errorMsg">提示信息</param> /// <returns>是否更新成功</returns> public bool UpdateUser(AntSdkUpdateUserInput input, ref int errorCode, ref string errorMsg) { var output = new AntSdkBaseOutput(); return(AntSdkHttpCommonMethod(AntSdkService.MdAntsdkhttpMethod.UpdateUserInfo, input, ref output, ref errorCode, ref errorMsg, RequestMethod.PUT)); }
/// <summary> /// 保存用户信息 /// </summary> /// <returns></returns> private void SaveUserInfo() { var errCode = 0; string errMsg = string.Empty; if (string.IsNullOrEmpty(HeadPic)) { return; } AntSdkUpdateUserInput userInfoInput = new AntSdkUpdateUserInput(); if (!HeadPic.StartsWith("pack://application:,,,/AntennaChat;Component/Images/198-头像.png")) { if (HeadPic != CurrentProfile.picture) { SendCutImageDto scid = new SendCutImageDto(); scid.cmpcd = GlobalVariable.CompanyCode; scid.seId = ""; scid.fileFileName = ""; scid.file = HeadPic; //TODO:AntSdk_Modify AntSdkSendFileInput fileInput = new AntSdkSendFileInput(); fileInput.cmpcd = GlobalVariable.CompanyCode; fileInput.seId = fileInput.file = HeadPic; AntSdkFailOrSucessMessageDto failMessage = new AntSdkFailOrSucessMessageDto(); failMessage.mtp = (int)AntSdkMsgType.ChatMsgPicture; failMessage.content = ""; //failMessage.sessionid = s_ctt.sessionId; DateTime dt = DateTime.Now; failMessage.lastDatetime = dt.ToString(); fileInput.FailOrSucess = failMessage; var fileOutput = AntSdkService.FileUpload(fileInput, ref errCode, ref errMsg); //ReturnCutImageDto dto = (new HttpService()).FileUpload<ReturnCutImageDto>(scid); if (fileOutput != null) { string url = fileOutput.dowmnloadUrl; HeadPic = url; AntSdkService.AntSdkCurrentUserInfo.picture = url; } else { LogHelper.WriteError("上传新头像失败:" + errMsg); userInfoInput.picture = ""; } } } //TODO:AntSdk_Modify //DONE:AntSdk_Modify if (HeadPic.StartsWith("pack://application:,,,/AntennaChat;Component/Images/198-头像.png")) { userInfoInput.picture = ""; } else { userInfoInput.picture = HeadPic; } userInfoInput.sex = Sex; userInfoInput.signature = this.Signature; //userInfoInput.voiceMode = CurrentProfile.voiceMode; //userInfoInput.vibrateMode = CurrentProfile.vibrateMode; bool isResult = AntSdkService.AntSdkUpdateUser(userInfoInput, ref errCode, ref errMsg); if (!isResult) { LogHelper.WriteError("更新用户信息失败:" + errMsg); } else { AntSdkService.AntSdkCurrentUserInfo.signature = this.Signature; AntSdkService.AntSdkCurrentUserInfo.sex = Sex; } }