zhangchangchun hace 6 años
padre
commit
f6c06b4339
Se han modificado 1 ficheros con 1 adiciones y 3 borrados
  1. 1 3
      app/Http/Controllers/V1/AuthController.php

+ 1 - 3
app/Http/Controllers/V1/AuthController.php

@@ -64,9 +64,7 @@ class AuthController extends Controller {
             return $this->jsonError('登陆失败');
         }else{
             $shopAccount = Auth::user();
-//            $shopAccount->token = $token;
-//            $shopAccount->token_ttl = config('jwt.ttl');
-            $factory = JWTFactory::customClaims(['shop'=>['shop_id'=>$shopAccount->id,'sign'=>md5($shopAccount->id)]]);
+            $factory = JWTFactory::customClaims(['shop'=>['uid'=>$shopAccount->id,'shop_id'=>$shopAccount->shop_id,'sign'=>md5($shopAccount->id).env('JWT_SECRET')]]);
             $payload = $factory->make();
 
             $token = JWTAuth::encode($payload);