1234567891011121314151617181920212223242526272829 |
- <?php
- namespace App\Http\Middleware;
- use Closure;
- use App\Exceptions\ApiException;
- class BindExportToken
- {
- use CheckTokenTrait;
- /**
- * @param $request
- * @param Closure $next
- * @return mixed
- * @throws ApiException
- */
- public function handle($request, Closure $next)
- {
- // 接口中的token(如有则绑定token到全局)
- $all = $request->all();
- $token = getProp($all, 'd_token');
- if ($token) {
- $this->checkTokenTrait($token);
- }
- return $next($request);
- }
- }
|