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

APP小程序-注册登录功能改进-一键登录检测是否新用户

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

+ 1 - 4
app/controller/api/Auth.php

@@ -2134,11 +2134,8 @@ class Auth extends BaseController
2134 2134
 
2135 2135
             $tokenInfo = $repository->createToken($user);
2136 2136
 
2137
-            if($isnew){
2138
-                return app('json')->success(['usernew' => 1]);
2139
-            }
2137
+            return app('json')->success(array_merge($repository->returnToken($user, $tokenInfo), ['is_new' => $isnew ? 1 : 0]));
2140 2138
 
2141
-            return app('json')->success($repository->returnToken($user, $tokenInfo));
2142 2139
         }catch (Exception $exception){
2143 2140
             Db::name('log')->insert(['data'=>'获取手机号失败--'.$exception->getFile().':'.$exception->getLine().'【'.$exception->getMessage().'】']);
2144 2141
         }