12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace App\Modules\Admin\Controllers\Admin;
- use App\Base\BaseController;
- use App\Modules\Admin\Services\AuthService;
- class AuthController extends BaseController
- {
- protected $authService;
- public function __construct(AuthService $authService)
- {
- $this->authService = $authService;
- }
- public function login()
- {
- $data = $this->valid([
- "username" => "required",
- "password" => "required",
- "fix" => "",
- ]);
- return $this->ok($this->authService->login($data));
- }
- public function profile()
- {
- return $this->ok($this->authService->profile());
- }
- public function changePassword()
- {
- $data = $this->valid([
- "old_password" => "required",
- "password" => "required",
- ]);
- return $this->ok($this->authService->changePassword($data));
- }
- }
|