From 3c0747fed090f850312155ab890c889521eba877 Mon Sep 17 00:00:00 2001 From: wangxinglong <2371974647@qq.com> Date: Wed, 22 Dec 2021 09:34:46 +0800 Subject: [PATCH] settter --- app/controller/api/Comment.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controller/api/Comment.php b/app/controller/api/Comment.php index 6ad09c9..3dbd689 100644 --- a/app/controller/api/Comment.php +++ b/app/controller/api/Comment.php @@ -51,11 +51,11 @@ class Comment extends Base }); if (empty($account)) { - throw new RepositoryException('用户无效!'); + throw new ValidateException('用户无效!'); } - + if(strtotime($account->blank_time) >time()){ - throw new RepositoryException('用户被加入黑名单,暂时不能评论,请在' .$account->blank_time . "后评论"); + throw new ValidateException('用户被加入黑名单,暂时不能评论,请在' .$account->blank_time . "后评论"); } $param = [ @@ -86,7 +86,7 @@ class Comment extends Base } catch (ValidateException $e) { return $this->json(4001, $e->getError()); } catch (RepositoryException $e) { - return $this->json(4001, $e->getError()); + return $this->json(4001, $e->getMessage()); } catch (Exception $e) { echo $e->getMessage(); return $this->json(5001, '服务器繁忙!获取用户个人信息失败');