<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                全局異常處理handler ~~~ public function render(\Exception $e) { if($e instanceof BaseException){ // 自定義的異常 $this->code=$e->code; $this->msg=$e->msg; $this->errCode=$e->errCode; }else{ // 系統的異常,判斷是不是調試模式:是,顯示tp5的異常,否則顯示封裝接口的異常 if(config('app.app_debug')){ //使用tp5默認的錯誤提示 return parent::render($e); }else{ $this->code=500; $this->msg='服務器內部錯誤'; $this->errCode=999; //真是的錯誤寫入日志 // echo($e->getMessage()); Log::record($e->getMessage(),'error'); } } //返回錯誤數據 $url=request()->url(); $result=[ 'msg'=>$this->msg, 'errCode'=>$this->errCode, 'url'=>$url ]; return json($result,$this->code); ~~~ 自定義異常類 ~~~ class BaseException extends Exception { //HTTP 狀態碼 404,200 public $code=400; //錯誤具體信息 public $msg="自定義錯誤"; //自定義的錯誤碼 public $errCode=10000; //構造函數初始化類屬性 public function __construct(array $conf=[]) { //防御性代碼 if(!is_array($conf)) return; //屬性初始化 array_key_exists('msg',$conf)&&$this->msg=$conf['msg']; array_key_exists('errCode',$conf)&&$this->errCode=$conf['errCode']; array_key_exists('code',$conf)&&$this->url=$conf['code']; } } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看