CustomerMiddleware.php 521 B

12345678910111213141516171819
  1. <?php
  2. namespace app\http\middleware;
  3. use app\models\store\StoreService;
  4. use app\models\system\SystemStoreStaff;
  5. use crmeb\interfaces\MiddlewareInterface;
  6. use app\Request;
  7. class CustomerMiddleware implements MiddlewareInterface
  8. {
  9. public function handle(Request $request, \Closure $next)
  10. {
  11. $uid = $request->uid();
  12. if((!StoreService::orderServiceStatus($uid)) && (!SystemStoreStaff::verifyStatus($uid)))
  13. return app('json')->fail('权限不足');
  14. return $next($request);
  15. }
  16. }