验证码配置参数修改进配置文件,前端角色id不再允许输入英文字符

This commit is contained in:
QM303176530
2020-06-26 21:40:26 +08:00
parent 9c40447071
commit f6c951dd13
3 changed files with 131 additions and 118 deletions

View File

@@ -2,6 +2,7 @@ package v1
import (
"fmt"
"gin-vue-admin/global"
"gin-vue-admin/global/response"
resp "gin-vue-admin/model/response"
"github.com/gin-gonic/gin"
@@ -20,7 +21,7 @@ var store = base64Captcha.DefaultMemStore
func Captcha(c *gin.Context) {
//字符,公式,验证码配置
// 生成默认数字的driver
driver := base64Captcha.NewDriverDigit(80, 240, 5, 0.7, 80)
driver := base64Captcha.NewDriverDigit(global.GVA_CONFIG.Captcha.ImgHeight, global.GVA_CONFIG.Captcha.ImgWidth, global.GVA_CONFIG.Captcha.KeyLong, 0.7, 80)
cp := base64Captcha.NewCaptcha(driver, store)
id, b64s, err := cp.Generate()
if err != nil {