Преглед изворни кода

Merge branch 'dev-xpy' into dev

xupuyuan пре 11 месеци
родитељ
комит
43f7d7fa2f
1 измењених фајлова са 9 додато и 7 уклоњено
  1. 9 7
      app/controller/api/Auth.php

+ 9 - 7
app/controller/api/Auth.php

@@ -555,19 +555,21 @@ class Auth extends BaseController
555
 //            Db::name("MarketingUser") -> insert($data);
555
 //            Db::name("MarketingUser") -> insert($data);
556
 //        }
556
 //        }
557
 
557
 
558
-        return app('json')->success($repository->returnToken($user, $tokenInfo));
558
+        $result = $repository->returnToken($user, $tokenInfo);
559
+        $result['uid'] = $user->uid;
560
+
561
+        return app('json')->success($result);
562
+
559
     }
563
     }
560
     /**
564
     /**
561
      * 绑定邀请人
565
      * 绑定邀请人
562
      */
566
      */
563
     public function bindSpread(UserRepository $repository)
567
     public function bindSpread(UserRepository $repository)
564
     {
568
     {
565
-        $data = $this->request->params(['spread_phone']);
566
-        $user = $this->request->user();
567
-        if (!$user || empty($user->uid)) {
568
-            return app('json')->fail('用户未登录');
569
-        }
570
-        $uid = $user->uid;
569
+        $data = $this->request->params(['uid','spread_phone']);
570
+
571
+        $user=$repository->accountByUser($data['uid']);
572
+        $uid=$user['uid'];
571
 
573
 
572
         if (empty($data['spread_phone'])) {
574
         if (empty($data['spread_phone'])) {
573
             return app('json')->fail('推荐人手机号不能为空');
575
             return app('json')->fail('推荐人手机号不能为空');