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

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                Beego框架真的很貼心,默認有captcha這個驗證碼插件。在utils/captcha下面 使用方法 ~~~ import( ? "github.com/astaxie/beego/cache" ? "github.com/astaxie/beego/utils/captcha" ) ? var cpt *captcha.Captcha func init() { ? store := cache.NewMemoryCache() ? cpt = captcha.NewWithFilter("/captcha/", store) //一定要寫在構造函數里面,要不然第一次打開頁面有可能是X } ~~~ 在模板里面寫上 ~~~ <form action="/" method="post"> ? {{create_captcha}} ? <input name="captcha" type="text"> </form> ~~~ 就ok了,最貼心的是居然連onclick事件也已經做在了里面,方便。 還有判斷也已經寫好了,只要在post里面寫上 ~~~ if !cpt.VerifyReq(this.Ctx.Request) { //你的代碼 } ~~~ 默認的驗證碼是6位,200px寬,這個是可以自己設置的 cpt是一個結構體: ~~~ // Captcha struct type Captcha struct { ? // beego cache store ? store cache.Cache ? ? // url prefix for captcha image ? URLPrefix string ? ? // specify captcha id input field name ? FieldIdName string ? // specify captcha result input field name ? FieldCaptchaName string ? ? // captcha image width and height ? StdWidth int ? StdHeight int ? ? // captcha chars nums ? ChallengeNums int ? ? // captcha expiration seconds ? Expiration int64 ? ? // cache key prefix ? CachePrefix string } ~~~ 你看到暴露的這些接口了嗎?圖片的大小,字數都是可以調整的,字體、彎曲程度這些就不行。不過寬度也不是可以隨意設置的,我測試的結果是寬度不能小于100,高度不能小于40.不知道是什么情況。 上代碼: ~~~ func init() { store := cache.NewMemoryCache() cpt = captcha.NewWithFilter("/captcha/", store) cpt.ChallengeNums = 4 cpt.StdWidth = 100 cpt.StdHeight = 40 } ~~~
                  <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>

                              哎呀哎呀视频在线观看