From 321d2f007c7f85e933b3f90266af07e10c6b4658 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期四, 03 十二月 2020 21:06:20 +0800
Subject: [PATCH] 2020-12-03 1.修改推送ID保存方法

---
 HDL_ON/DAL/Server/HttpServerRequest.cs |   45 ++++++++++++++++++++++++++++++---------------
 1 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index f156f7b..ed2cfd2 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -359,7 +359,22 @@
 
         }
 
-       
+        /// <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>
         /// 鏇存柊鐢ㄦ埛鏄电О
@@ -942,15 +957,15 @@
                 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,
                 };
@@ -965,8 +980,8 @@
                         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;
                         }
@@ -1010,7 +1025,7 @@
 
             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);
@@ -1022,11 +1037,11 @@
         /// <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);
@@ -1047,11 +1062,11 @@
         /// <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);
@@ -1078,13 +1093,13 @@
         /// <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)
@@ -1110,7 +1125,7 @@
         /// <returns></returns>
         public bool PushSerivceMarkMessageRead(string msgId)
         {
-            if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false;
+            if (string.IsNullOrEmpty(UserInfo.Current.PushId)) return false;
 
             try
             {
@@ -1143,7 +1158,7 @@
         /// <returns></returns>
         public bool PushSerivceDeleteMessage(string msgId)
         {
-            if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false;
+            if (string.IsNullOrEmpty(UserInfo.Current.PushId)) return false;
 
             try
             {

--
Gitblit v1.8.0