duqinya 5 years ago
parent
commit
9b774f0aa4
1 changed files with 5 additions and 3 deletions
  1. 5 3
      app/Repositories/BeanRepository.php

+ 5 - 3
app/Repositories/BeanRepository.php

@@ -11,14 +11,16 @@ class BeanRepository
     public function beanDetail($request)
     {
         try {
-            $sign = generateSign(['type' => $request['type']], config('customer.app_secret'));
+            $token = JWTAuth::decode(JWTAuth::getToken());
+            $uid = $token['user']->uid;
+            $sign = generateSign(['type' => $request['type'], 'uid' => $uid], config('customer.app_secret'));
             $url = config("customer.app_service_url") . '/user/v2/beanDetail';
             $array = [
-                'json' => ['sign' => $sign, 'type' => $request['type']], 'query' => [], 'http_errors' => false, 'headers' => ['Authorization' => "Bearer " . JWTAuth::getToken()]
+                'json' => ['sign' => $sign, 'type' => $request['type'], 'uid' => $uid], 'query' => [], 'http_errors' => false, 'headers' => ['Authorization' => "Bearer " . JWTAuth::getToken()]
             ];
             return http($url, $array, 'get');
         } catch (\Exception $e) {
-            Log::debug("beanDetail:".$e->getMessage());
+            Log::debug("beanDetail:" . $e->getMessage());
             return [];
         }
     }