| | |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取用户头像 |
| | | /// </summary> |
| | | /// <param name="userId"></param> |
| | | public void GetUserHeadImage(string userId) |
| | | { |
| | | var imageKey = ImageUtlis.Current.GetHeadImageKey(userId); |
| | | |
| | | var headImageBytes = ImageUtlis.Current.DownHeadImage(userId); |
| | | |
| | | if (headImageBytes != null && headImageBytes.Length > 0) |
| | | { |
| | | //UserInfo.Current.headImagePageBytes = headImageBytes; |
| | | UserInfo.Current.headImagePagePath = imageKey; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新用户昵称 |
| | |
| | | isProduce = false; |
| | | #endif |
| | | |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushDeviceToken)) { |
| | | if (string.IsNullOrEmpty(UserInfo.Current.PushDeviceToken)) { |
| | | Utlis.WriteLine("PushDeviceToken 为空"); |
| | | return false; |
| | | } |
| | | |
| | | var mAddpushinfoObj = new AddpushinfoObj() |
| | | { |
| | | pushToken = OnAppConfig.Instance.PushDeviceToken, |
| | | deviceName = OnAppConfig.Instance.PhoneName, |
| | | pushToken = UserInfo.Current.PushDeviceToken, |
| | | deviceName = UserInfo.Current.PhoneName, |
| | | deviceType = deviceType, |
| | | produce = isProduce, |
| | | }; |
| | |
| | | var pushId = revertObj.Data.ToString(); |
| | | if (!string.IsNullOrEmpty(pushId)) |
| | | { |
| | | OnAppConfig.Instance.PushId = pushId; |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | UserInfo.Current.PushId = pushId; |
| | | UserInfo.Current.SaveUserInfo(); |
| | | |
| | | return true; |
| | | } |
| | |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(new GetMessageListObj() |
| | | { |
| | | pushId = OnAppConfig.Instance.PushId, |
| | | pushId = UserInfo.Current.PushId, |
| | | pushType = pushType |
| | | }); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_Getpushmessagelist, requestJson); |
| | |
| | | /// <returns></returns> |
| | | public bool PushSerivceClearmessagelist() |
| | | { |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false; |
| | | if (string.IsNullOrEmpty(UserInfo.Current.PushId)) return false; |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj() |
| | | { |
| | | pushId = OnAppConfig.Instance.PushId |
| | | pushId = UserInfo.Current.PushId |
| | | }); |
| | | |
| | | var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_Clearmessagelist, requestJson); |
| | |
| | | /// <returns></returns> |
| | | public bool PushSerivceSignOut() |
| | | { |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false; |
| | | if (string.IsNullOrEmpty(UserInfo.Current.PushId)) return false; |
| | | try |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj() { |
| | | pushId = OnAppConfig.Instance.PushId |
| | | pushId = UserInfo.Current.PushId |
| | | }); |
| | | |
| | | var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_DeleteToken, requestJson); |
| | |
| | | /// <returns></returns> |
| | | public bool PushSerivceMarkAllMessageRead() |
| | | { |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false; |
| | | if (string.IsNullOrEmpty(UserInfo.Current.PushId)) return false; |
| | | |
| | | try |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj() |
| | | { |
| | | pushId = OnAppConfig.Instance.PushId |
| | | pushId = UserInfo.Current.PushId |
| | | }); |
| | | var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_ALLMarkread, requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | |
| | | /// <returns></returns> |
| | | public bool PushSerivceMarkMessageRead(string msgId) |
| | | { |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false; |
| | | if (string.IsNullOrEmpty(UserInfo.Current.PushId)) return false; |
| | | |
| | | try |
| | | { |
| | |
| | | /// <returns></returns> |
| | | public bool PushSerivceDeleteMessage(string msgId) |
| | | { |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false; |
| | | if (string.IsNullOrEmpty(UserInfo.Current.PushId)) return false; |
| | | |
| | | try |
| | | { |