feat: adjust deploy password and login limit

This commit is contained in:
engigu
2026-02-10 14:19:32 +08:00
parent 70a66c4693
commit b855400cec
6 changed files with 67 additions and 5 deletions
+18
View File
@@ -0,0 +1,18 @@
package utils
import (
"crypto/rand"
"math/big"
)
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
// RandomString 生成指定长度的随机字符串
func RandomString(n int) string {
b := make([]byte, n)
for i := range b {
num, _ := rand.Int(rand.Reader, big.NewInt(int64(len(charset))))
b[i] = charset[num.Int64()]
}
return string(b)
}