|
@ -1,6 +1,7 @@ |
|
|
package api |
|
|
package api |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
|
|
|
"gin-vue-admin/config" |
|
|
"gin-vue-admin/controller/servers" |
|
|
"gin-vue-admin/controller/servers" |
|
|
"github.com/dchest/captcha" |
|
|
"github.com/dchest/captcha" |
|
|
"github.com/gin-gonic/gin" |
|
|
"github.com/gin-gonic/gin" |
|
@ -15,11 +16,11 @@ import ( |
|
|
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
|
|
|
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
|
|
|
// @Router /base/captcha [post]
|
|
|
// @Router /base/captcha [post]
|
|
|
func Captcha(c *gin.Context) { |
|
|
func Captcha(c *gin.Context) { |
|
|
captchaId := captcha.NewLen(6) |
|
|
|
|
|
servers.ReportFormat(c,true,"验证码获取成功",gin.H{ |
|
|
|
|
|
"captchaId":captchaId, |
|
|
|
|
|
"picPath":"/base/captcha/"+captchaId+".png", |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
captchaId := captcha.NewLen(config.GinVueAdminconfig.Captcha.KeyLong) |
|
|
|
|
|
servers.ReportFormat(c, true, "验证码获取成功", gin.H{ |
|
|
|
|
|
"captchaId": captchaId, |
|
|
|
|
|
"picPath": "/base/captcha/" + captchaId + ".png", |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// @Tags base
|
|
|
// @Tags base
|
|
@ -32,10 +33,3 @@ func Captcha(c *gin.Context) { |
|
|
func CaptchaImg(c *gin.Context) { |
|
|
func CaptchaImg(c *gin.Context) { |
|
|
servers.GinCapthcaServeHTTP(c.Writer, c.Request) |
|
|
servers.GinCapthcaServeHTTP(c.Writer, c.Request) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|