feat: publish sanitized custom.97 source
This commit is contained in:
1022 files changed
+69903
-19207
No files matched your search
+3
-2
@@ -2,6 +2,7 @@ package common
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
@@ -130,12 +131,12 @@ func ValidateNumericCode(code string) (string, error) {
|
||||
code = strings.ReplaceAll(code, " ", "")
|
||||
|
||||
if len(code) != 6 {
|
||||
return "", fmt.Errorf("验证码必须是6位数字")
|
||||
return "", errors.New("the verification code must be 6 digits")
|
||||
}
|
||||
|
||||
// 检查是否为纯数字
|
||||
if _, err := strconv.Atoi(code); err != nil {
|
||||
return "", fmt.Errorf("验证码只能包含数字")
|
||||
return "", errors.New("the verification code must contain only digits")
|
||||
}
|
||||
|
||||
return code, nil
|
||||
|
||||
Reference in new issue
Block a user