Explorar o código

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

xupuyuan hai 11 meses
pai
achega
6e8c473c25
Modificáronse 1 ficheiros con 1 adicións e 4 borrados
  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
             $tokenInfo = $repository->createToken($user);
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
         }catch (Exception $exception){
2139
         }catch (Exception $exception){
2143
             Db::name('log')->insert(['data'=>'获取手机号失败--'.$exception->getFile().':'.$exception->getLine().'【'.$exception->getMessage().'】']);
2140
             Db::name('log')->insert(['data'=>'获取手机号失败--'.$exception->getFile().':'.$exception->getLine().'【'.$exception->getMessage().'】']);
2144
         }
2141
         }