PopupController.php 945 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Http\Controllers\User;
  3. use App\Http\Controllers\Controller;
  4. use App\Http\Controllers\Miniprogram\Auth;
  5. use Illuminate\Support\Facades\Redis;
  6. use Illuminate\Support\Facades\Request;
  7. /**
  8. * 弹窗控制器
  9. * Class PopupController
  10. * @package App\Http\Controllers\User
  11. */
  12. class PopupController extends Controller
  13. {
  14. /**
  15. * 走心一画首页弹窗
  16. * @param Request $request
  17. * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response
  18. * @throws \Tymon\JWTAuth\Exceptions\JWTException
  19. */
  20. public function paint(Request $request)
  21. {
  22. $uid = Auth::auth();
  23. $key = "{popup:paint}";
  24. $bool = Redis::Sismember($key, $uid);
  25. Redis::sadd($key, $uid);
  26. return response([
  27. 'code' => 200,
  28. 'message' => 'OK',
  29. 'data' => [
  30. 'result' => $bool,
  31. ]
  32. ]);
  33. }
  34. }