userinfo(); return $this->jsonSuccess('登录成功', $user); } //登录 public function login(ApiAuthService $apiAuth) { $data=$this->request->post(); try { validate(UserValidate::class)->scene('edit')->check($data); $ret = $apiAuth->login($data['username'], $data['password']); return $this->jsonSuccess('登录成功', $ret); } catch (ValidateException $e) { return $this->jsonError($e->getError()); }catch (\Exception $e) { return $this->jsonError($e->getMessage()); } } }