验证码校验
This commit is contained in:
parent
595b233217
commit
42c1356a54
|
@ -1,6 +1,7 @@
|
|||
package controller
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"gitee.com/zhucheer/orange/app"
|
||||
"gitee.com/zhucheer/orange/captcha"
|
||||
)
|
||||
|
@ -35,3 +36,13 @@ func Upload(c *app.Context) error {
|
|||
func Captcha(c *app.Context) error {
|
||||
return captcha.CaptchaImgShow(c, 4)
|
||||
}
|
||||
|
||||
func VerifyImg(c *app.Context) error {
|
||||
code := c.Request().FormValue("code")
|
||||
|
||||
fmt.Println(code)
|
||||
|
||||
return c.ToJson(map[string]interface{}{
|
||||
"result": "upload success",
|
||||
})
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ func (s *Route) ServeMux() {
|
|||
commonGp.ALL("/upload", controller.Upload)
|
||||
|
||||
commonGp.GET("/captcha", controller.Captcha)
|
||||
commonGp.GET("/verifyimg", controller.VerifyImg)
|
||||
}
|
||||
|
||||
authGp := app.GroupRouter("/auth", middleware.NewAuth())
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package session
|
||||
|
||||
import (
|
||||
"gitee.com/zhucheer/orange/logger"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
|
@ -40,6 +39,6 @@ func (st *BlankSessionStore) Flush() (err error) {
|
|||
}
|
||||
|
||||
func (st *BlankSessionStore) warningSession(funcName string) (err error) {
|
||||
logger.Warning("session is not open, %s func is nothing to do, please check config.toml", funcName)
|
||||
//logger.Warning("session is not open, %s func is nothing to do, please check config.toml", funcName)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue