Go实战--golang中使用图片和验证码(dchest/captcha)

喜欢ヅ旅行 2022-06-06 10:54 302阅读 0赞

声明不止,继续 go go go !!!

昨天分享了iris框架中,如何使用Google的recaptcha。今天就一起分享学一学golang中如何使用图片验证码以及语音验证码,当然最开始我们还是要面向github编程了。

使用recaptcha

其实recaptcha的使用很简单,这里不使用iris框架,也很容易自己实现的。

https://github.com/haisum/recaptcha/blob/master/recaptcha.go

  1. package recaptcha
  2. import (
  3. "encoding/json"
  4. "io/ioutil"
  5. "net/http"
  6. "net/url"
  7. "time"
  8. )
  9. // R type represents an object of Recaptcha and has public property Secret,

发表评论

表情:
评论列表 (有 0 条评论,302人围观)

还没有评论,来说两句吧...

相关阅读