Просмотр исходного кода

Merge remote-tracking branch 'origin/dev' into dev

Vanessa 3 лет назад
Родитель
Сommit
bc0f4819dd

+ 2 - 2
app/appearance/langs/en_US.json

@@ -776,8 +776,8 @@
     "18": "Get community user account failed",
     "18": "Get community user account failed",
     "19": "User information has expired, please log in again",
     "19": "User information has expired, please log in again",
     "20": "Cannot be converted to heading when including sub-documents",
     "20": "Cannot be converted to heading when including sub-documents",
-    "21": "TODO",
-    "22": "TODO",
+    "21": "Please enter the captcha",
+    "22": "The captcha is incorrect",
     "23": "TODO",
     "23": "TODO",
     "24": "TODO",
     "24": "TODO",
     "25": "The attribute name only supports English letters and digits",
     "25": "The attribute name only supports English letters and digits",

+ 2 - 2
app/appearance/langs/es_ES.json

@@ -776,8 +776,8 @@
     "18": "Falló la obtención de la cuenta de usuario de la comunidad",
     "18": "Falló la obtención de la cuenta de usuario de la comunidad",
     "19": "La información del usuario ha caducado, por favor, inicie sesión de nuevo",
     "19": "La información del usuario ha caducado, por favor, inicie sesión de nuevo",
     "20": "No se puede convertir en título al incluir subdocumentos",
     "20": "No se puede convertir en título al incluir subdocumentos",
-    "21": "TODO",
-    "22": "TODO",
+    "21": "Por favor ingrese el captcha",
+    "22": "El captcha es incorrecto",
     "23": "TODO",
     "23": "TODO",
     "24": "TODO",
     "24": "TODO",
     "25": "El nombre del atributo sólo admite letras y dígitos en inglés",
     "25": "El nombre del atributo sólo admite letras y dígitos en inglés",

+ 2 - 2
app/appearance/langs/fr_FR.json

@@ -776,8 +776,8 @@
     "18": "Échec de la récupération du compte utilisateur communautaire",
     "18": "Échec de la récupération du compte utilisateur communautaire",
     "19": "Les informations de l'utilisateur ont expiré, veuillez vous connecter à nouveau.",
     "19": "Les informations de l'utilisateur ont expiré, veuillez vous connecter à nouveau.",
     "20": "Ne peut pas être converti en titre lorsque des sous-documents sont inclus.",
     "20": "Ne peut pas être converti en titre lorsque des sous-documents sont inclus.",
-    "21": "TODO",
-    "22": "TODO",
+    "21": "Veuillez entrer le captcha",
+    "22": "Le captcha est incorrect",
     "23": "TODO",
     "23": "TODO",
     "24": "TODO",
     "24": "TODO",
     "25": "Le nom de l'attribut ne supporte que les lettres et les chiffres anglais.",
     "25": "Le nom de l'attribut ne supporte que les lettres et les chiffres anglais.",

+ 2 - 2
app/appearance/langs/zh_CHT.json

@@ -776,8 +776,8 @@
     "18": "獲取社區用戶帳號失敗",
     "18": "獲取社區用戶帳號失敗",
     "19": "使用者資訊已過期,請重新登入帳號",
     "19": "使用者資訊已過期,請重新登入帳號",
     "20": "包含子文檔時無法轉換為標題",
     "20": "包含子文檔時無法轉換為標題",
-    "21": "TODO",
-    "22": "TODO",
+    "21": "請輸入驗證碼",
+    "22": "驗證碼不正確",
     "23": "TODO",
     "23": "TODO",
     "24": "TODO",
     "24": "TODO",
     "25": "屬性名僅支援英文字母和阿拉伯數字",
     "25": "屬性名僅支援英文字母和阿拉伯數字",

+ 2 - 2
app/appearance/langs/zh_CN.json

@@ -777,8 +777,8 @@
     "18": "获取社区用户账号失败",
     "18": "获取社区用户账号失败",
     "19": "用户信息已过期,请重新登录账号",
     "19": "用户信息已过期,请重新登录账号",
     "20": "包含子文档时无法转换为标题",
     "20": "包含子文档时无法转换为标题",
-    "21": "TODO",
-    "22": "TODO",
+    "21": "请输入验证码",
+    "22": "验证码不正确",
     "23": "TODO",
     "23": "TODO",
     "24": "TODO",
     "24": "TODO",
     "25": "属性名仅支持英文字母和阿拉伯数字",
     "25": "属性名仅支持英文字母和阿拉伯数字",

+ 4 - 5
kernel/model/session.go

@@ -66,14 +66,14 @@ func LoginAuth(c *gin.Context) {
 		captchaArg := arg["captcha"]
 		captchaArg := arg["captcha"]
 		if nil == captchaArg {
 		if nil == captchaArg {
 			ret.Code = 1
 			ret.Code = 1
-			ret.Msg = "need input captcha"
+			ret.Msg = Conf.Language(21)
 			return
 			return
 		}
 		}
 		inputCaptcha = captchaArg.(string)
 		inputCaptcha = captchaArg.(string)
 
 
-		if session.Captcha != inputCaptcha {
+		if strings.ToLower(session.Captcha) != strings.ToLower(inputCaptcha) {
 			ret.Code = 1
 			ret.Code = 1
-			ret.Msg = "invalid captcha"
+			ret.Msg = Conf.Language(22)
 			return
 			return
 		}
 		}
 	}
 	}
@@ -109,10 +109,9 @@ func LoginAuth(c *gin.Context) {
 
 
 func GetCaptcha(c *gin.Context) {
 func GetCaptcha(c *gin.Context) {
 	img, err := captcha.New(100, 26, func(options *captcha.Options) {
 	img, err := captcha.New(100, 26, func(options *captcha.Options) {
-		options.CharPreset = "abcdefghjkmnpqrtuvwxyz2346789"
+		options.CharPreset = "ABCDEFGHKLMNPQRSTUVWXYZ23456789"
 		options.Noise = 0.5
 		options.Noise = 0.5
 		options.CurveNumber = 0
 		options.CurveNumber = 0
-		options.FontScale = 1.2
 	})
 	})
 	if nil != err {
 	if nil != err {
 		util.LogErrorf("generates captcha failed: " + err.Error())
 		util.LogErrorf("generates captcha failed: " + err.Error())