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