From 6d099cec75156dd8eb9b9c8dc0512e65b1b66426 Mon Sep 17 00:00:00 2001
From: anyv <anyu@bronet.cn>
Date: Fri, 21 Jun 2019 17:33:33 +0800
Subject: [PATCH] 4

---
 app/user/controller/IndexController.php | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/app/user/controller/IndexController.php b/app/user/controller/IndexController.php
index 32a526e..ccff73c 100644
--- a/app/user/controller/IndexController.php
+++ b/app/user/controller/IndexController.php
@@ -37,7 +37,7 @@ class IndexController extends HomeBaseController
                 ->where('app_id', $appId)
                 ->find();
             if ($findThirdPartyUser) {
-                $this->wechatUserLogin($findThirdPartyUser,$openid,$appId);
+                $this->wechatUserLogin($wechat_user,$findThirdPartyUser,$openid,$appId);
             }else{
                 $this->wechatUserRegister($wechat_user,$openid,$appId);
             }
@@ -57,14 +57,15 @@ class IndexController extends HomeBaseController
      * @param $openid
      * @param $appId
      */
-    protected function wechatUserLogin($findThirdPartyUser,$openid,$appId){
+    protected function wechatUserLogin($wechat_user,$findThirdPartyUser,$openid,$appId){
         $currentTime = time();
         $ip          = $this->request->ip(0, true);
         $token = cmf_generate_user_token($findThirdPartyUser['user_id'], 'public');
         $userData = [
             'last_login_ip'   => $ip,
             'last_login_time' => $currentTime,
-            'login_times'     => ['exp', 'login_times+1']
+            'login_times'     => ['exp', 'login_times+1'],
+            'user_nickname'   => $wechat_user['nickname']
         ];
         $row1=Db::name("third_party_user")
             ->where('openid', $openid)
--
libgit2 0.24.0