<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 功能強大 支持多語言、二開方便! 廣告
                [TOC] # 跳轉 ~~~ func (this *AdminController) Post() { //跳轉 this.Redirect("/", 302) this.Ctx.WriteString("-------test----------") } ~~~ # 中止此請求并拋出異常 `this.Abort("401")`之后的代碼不會再執行 ~~~ func (this *AdminController) Post() { this.Abort("401") this.Ctx.WriteString("-------test----------") } ~~~ 你可以自定義一些404頁面,具體看框架文檔 # 自定義字符串錯誤處理 beego 更加人性化的還有一個設計就是支持用戶自定義字符串錯誤類型處理函數,例如下面的代碼,用戶注冊了一個數據庫出錯的處理頁面: ~~~ func dbError(rw http.ResponseWriter, r *http.Request){ t,_:= template.New("dberror.html").ParseFiles(beego.BConfig.WebConfig.ViewsPath+"/dberror.html") data :=make(map[string]interface{}) data["content"] = "database is now down" t.Execute(rw, data) } func main() { beego.ErrorHandler("dbError",dbError) beego.Router("/", &controllers.MainController{}) beego.Run() } ~~~ 一旦在入口注冊該錯誤處理代碼,那么你可以在任何你的邏輯中遇到數據庫錯誤調用`this.Abort("dbError")`來進行異常頁面處理。
                  <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>

                              哎呀哎呀视频在线观看