From 2daf43e81ea2ce67fbb50fa40b260c5ddbc90474 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 22 Mar 2024 23:51:23 +0800 Subject: [PATCH] fix: add unauthorized message --- src/exception/Unauthorized.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/exception/Unauthorized.php b/src/exception/Unauthorized.php index c9ee299..bd56191 100644 --- a/src/exception/Unauthorized.php +++ b/src/exception/Unauthorized.php @@ -2,6 +2,17 @@ namespace tauthz\exception; -class Unauthorized extends \Exception +use think\exception\HttpException; + +class Unauthorized extends HttpException { + /** + * Create a new exception instance. + * + * @return void + */ + public function __construct() + { + parent::__construct(403, '此操作未经授权'); + } }