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, '此操作未经授权'); + } }