// +---------------------------------------------------------------------- namespace app\controller\auth; use app\controller\Base; use app\services\auth\LoginService; class Index extends Base{ public function login(LoginService $service){ try { $data = $service->authLogin($this->request); $this->data['data'] = $data; } catch (\think\Exception $e) { $this->data['code'] = 0; $this->data['message'] = $e->getMessage(); } return $this->data; } }