Browse Source

不含新个险登录的万能险

zmm 6 years ago
parent
commit
a188296403
1 changed files with 6 additions and 39 deletions
  1. 6 39
      CZKJ.GBRS2.WebMVC/Controllers/UserController.cs

+ 6 - 39
CZKJ.GBRS2.WebMVC/Controllers/UserController.cs

@@ -9,11 +9,13 @@ using System.Threading.Tasks;
9 9
 using System.Web;
10 10
 using CZFW.Core;
11 11
 using CZFW.Framework.Interface;
12
+using CZFW.Framework.Model;
12 13
 using CZKJ.GBRS2.Interface;
13 14
 using CZKJ.GBRS2.Model;
14 15
 using CZKJ.GBRS2.ViewModel;
15 16
 using Microsoft.AspNetCore.Http;
16 17
 using Microsoft.AspNetCore.Mvc;
18
+using Microsoft.Extensions.Logging;
17 19
 using Newtonsoft.Json;
18 20
 using Newtonsoft.Json.Linq;
19 21
 
@@ -38,14 +40,9 @@ namespace CZKJ.GBRS2.WebMVC.Controllers
38 40
         public IActionResult Index(string code = null)
39 41
         {
40 42
             string session = HttpContext.Session.GetString("GBRS2018");
41
-            //个人登录跳转链接
42
-            var loginurl = ConfigHelper.GetValue<string>("LoginCallback:Url");
43 43
             if (session != null)
44 44
             {
45
-                var userinfo = JsonConvert.DeserializeObject<UserInfoModel>(session);
46
-                var userIndexUrl = $"{loginurl}?personalId={userinfo.User_id}";
47
-                return Redirect(userIndexUrl);
48
-                //return View(JsonConvert.DeserializeObject<UserInfoModel>(session));
45
+                return View(JsonConvert.DeserializeObject<UserInfoModel>(session));
49 46
             }
50 47
             //获取当前请求地址
51 48
             var url = HttpUtility.UrlEncode($"{ConfigHelper.GetValue<string>("Login:Scheme")}://{Request.Host}{Request.Path}").Replace("%3a", "%3A").Replace("%2f", "%2F");
@@ -152,33 +149,7 @@ namespace CZKJ.GBRS2.WebMVC.Controllers
152 149
             //    //_clogic.ExcuteSql($"UPDATE gbrs2_customerinfo SET LastLoginTime='{DateTime.Now.ToString()}' WHERE User_id={user.User_id}");
153 150
             //    _clogic.EditEntity(queryUser);
154 151
             //}         
155
-            //if (string.IsNullOrWhiteSpace(user.Core_customer_code))
156
-            //{
157
-            //    return View("Notice",user);
158
-            //}
159
-            //:http://uat01.guobaojinrong.com/wef/pc/api/personaluser/callback?personalId=xxxx&openId=xxx   
160
-            var personalRedirectUrl = $"{loginurl}?personalId={user.User_id}";
161
-            return Redirect(personalRedirectUrl);
162
-            //return View(user);
163
-        }
164
-        //回调官网
165
-        public IActionResult CallBackHome(string personalId)
166
-        {
167
-            string session = HttpContext.Session.GetString("GBRS2018");
168
-            if (session != null)
169
-            {
170
-                var user = JsonConvert.DeserializeObject<UserInfoModel>(session);
171
-                if (user.User_id != personalId)
172
-                {
173
-                    //从session获取用户信息
174
-                    string sessiontoken = HttpContext.Session.GetString("token");
175
-                    //拼接登出链接
176
-                    var logOutUrl = $"{ConfigHelper.GetValue<string>("Login:Url")}/uai/api/oauth20/logout?access_token={sessiontoken}";
177
-                    var res = HttpHelper.HttpGet(logOutUrl);
178
-                    HttpContext.Session.Remove("GBRS2018");
179
-                }
180
-            }
181
-            return Redirect("/");
152
+            return View(user);
182 153
         }
183 154
 
184 155
 
@@ -186,7 +157,7 @@ namespace CZKJ.GBRS2.WebMVC.Controllers
186 157
         /// 登出
187 158
         /// </summary>
188 159
         /// <returns></returns>
189
-        public IActionResult LogOut(string personalId)
160
+        public IActionResult LogOut()
190 161
         {
191 162
             //从session获取用户信息
192 163
             string session = HttpContext.Session.GetString("token");
@@ -322,11 +293,7 @@ namespace CZKJ.GBRS2.WebMVC.Controllers
322 293
                 //_clogic.ExcuteSql($"UPDATE gbrs2_customerinfo SET LastLoginTime='{DateTime.Now.ToString()}' WHERE User_id={user.User_id}");
323 294
                 _clogic.EditEntity(queryUser);
324 295
             }
325
-
326
-            var loginurl = ConfigHelper.GetValue<string>("LoginCallback:Url");
327
-            var personalRedirectUrl = $"{loginurl}?personalId={user.User_id}";
328
-            return Redirect(personalRedirectUrl);
329
-            //return RedirectToAction("Index", "User");
296
+            return RedirectToAction("Index", "User");
330 297
         }
331 298
         /// <summary>
332 299
         /// 根据保单号查询保单详情