FindMemberPwVerifyController.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace Themes\kbgolf\pro\app\Http\Controllers\Auth;
  3. use App\Http\Controllers\Controller;
  4. use App\Services\CallApiService;
  5. class FindMemberPwVerifyController extends Controller
  6. {
  7. private $callApiService;
  8. public function __construct(CallApiService $callApiService)
  9. {
  10. $this->callApiService = $callApiService;
  11. }
  12. public function index()
  13. {
  14. $memberPick = $this->callApiService->callApi([
  15. 'url' => 'member-dupl-check',
  16. 'data' => [
  17. 'Email' => request('email')
  18. ]
  19. ]);
  20. if (! $this->callApiService->verifyApiError($memberPick)) {
  21. notify()->error('이메일 계정이 존재하지 않습니다', 'Error', 'bottomRight');
  22. return redirect()->back();
  23. }
  24. // dd(session('member'));
  25. return view('views.auth.find-member-pw-verify', [
  26. 'email' => request('email')
  27. ]);
  28. }
  29. public function store()
  30. {
  31. switch (request('auth')) {
  32. case 'mobile':
  33. return redirect()->route('find-member-pw-verifyinput');
  34. case 'email':
  35. return redirect()->route('find-member-pw-verifyinput', ['email' => request('email')]);
  36. default:
  37. return redirect()->back();
  38. }
  39. }
  40. }