<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                由于管理后臺幾乎所有的請求都是通過 ajax 請求的,默認的異常直接拋出,會導致 ajax 返回的 json 個數錯誤,于是對框架拋出的異常做了自定義處理,將 ajax 請求時的異常以 json 格式拋出,其他異常繼承與異常處理方法 ``` use think\exception\Handle; use think\exception\HttpException; use think\Request; class TpException extends Handle { public function render(\Exception $e) { if ($e instanceof HttpException) { $statusCode = $e->getStatusCode(); http_response_code($statusCode); } //可以在此交由系統處理 if (Request::instance()->isAjax()) { $error_code = $this->getCode($e) ?: 1; return ajax_return_adv_error($this->getMessage($e), $error_code); } return parent::render($e); } } ``` 如果需要請修改 `extend\TpException.php` 文件 >[info] 以后在使用時無論是否有 ajax 請求,都可以輕松拋出一個異常,都不會導致沒有正確的 json 格式數據返回
                  <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>

                              哎呀哎呀视频在线观看