1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace App\Repositories;
- use App\Models\Behavior;
- use GuzzleHttp\Client;
- use GuzzleHttp\Exception\RequestException;
- use Tymon\JWTAuth\Facades\JWTAuth;
- /**
- * Created by PhpStorm.
- * User: durong
- * Date: 2019/6/10
- * Time: 上午11:11
- */
- class BehaviorRepository
- {
- public function __construct(Behavior $behavior)
- {
- $this->behavior = $behavior;
- }
- public function index($request)
- {
- try {
- $app = config('constants.VIRUS_APP_ID');
- $signKey = [
- 'app' => config('constants.VIRUS_APP_ID')
- ];
- ksort($signKey);
- $signKey = urldecode(http_build_query($signKey));
- $sign = md5(config('constants.VIRUS_APP_SECRET') . $signKey);
- $url = config("customer.manage_service_url") . '/virus/behaviorList';
- $array = [
- 'json' => ['app' => $app,'sign' => $sign], 'query' => [], 'http_errors' => false, 'headers' => ['Authorization' => "Bearer " . JWTAuth::getToken()]
- ];
- return http($url, $array, 'get');
- } catch (\Exception $e) {
- return [];
- }
- }
- }
|