AuthController.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace App\Modules\Pc\Controllers;
  3. use App\Base\BaseController;
  4. use App\Modules\Pc\Services\EmailService;
  5. use Faker\Provider\Image;
  6. class AuthController extends BaseController
  7. {
  8. public function emailCaptcha()
  9. {
  10. $params = $this->valid([
  11. "email" => "required|email",
  12. "source" => "required",
  13. ]);
  14. return $this->ok(app(EmailService::class)->emailCaptcha($params['email'], $params['source']));
  15. }
  16. public function profile()
  17. {
  18. return $this->ok([
  19. "id" => 1,
  20. "token" => "token",
  21. "name" => "用户名称",
  22. "avatar" => Image::imageUrl(),
  23. "company" => [
  24. "id" => 1,
  25. "name" => "公司名称",
  26. ],
  27. ]);
  28. }
  29. public function register()
  30. {
  31. return $this->ok([
  32. "token" => "token",
  33. "name" => "",
  34. "phone" => "",
  35. ]);
  36. }
  37. public function login()
  38. {
  39. return $this->ok([
  40. "token" => "token",
  41. "name" => "",
  42. "phone" => "",
  43. ]);
  44. }
  45. public function resetPassword()
  46. {
  47. return $this->ok([
  48. "token" => "token",
  49. "name" => "",
  50. "phone" => "",
  51. ]);
  52. }
  53. }