123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace App\Exceptions;
- use Exception;
- use Throwable;
- /**
- * 低于适配版本的升级提醒
- * Class VersionException
- * @package App\Exceptions
- */
- class VersionException extends Exception
- {
- public function __construct(string $message = "", int $code = 200, Throwable $previous = null)
- {
- parent::__construct($message, $code, $previous);
- }
- /**
- * 将异常渲染到 HTTP 响应中。
- *
- * @param \Illuminate\Http\Request
- * @return void
- */
- public function render($request)
- {
- return response([
- 'code' => $this->getCode(),
- 'error_message' => $this->getMessage(),
- 'message' => '检测到你当前使用的版本过低,可能影响后续使用,可点击确认按钮,升级至最新版本。'
- ]);
- }
- }
|