factroy store

This commit is contained in:
2026-09-15 15:23:30 +08:00
parent 21ee6f47ec
commit 88c3cdada2
64 changed files with 3649 additions and 305 deletions
-21
View File
@@ -256,21 +256,6 @@ func Decrypt(str string) (string, Error) {
return str, nil
}
func DecryptMobile(mobile string) string {
mobile, err := Decrypt(mobile)
if err != nil {
logx.Error("decrypt mobile error", mobile, err)
return mobile
}
if len(mobile) < 11 {
return mobile
}
return mobile[:3] + "****" + mobile[7:11]
}
// 接收 [startDate, endDate](格式 "YYYY-MM-DD"),
// 返回 [2006-01-02 00:00:00, 2006-01-02 23:59:59]
func DateRangeWithTime(dates []string) [2]string {
@@ -323,12 +308,6 @@ func CalcAgeStr(birthday string) string {
return strconv.Itoa(age)
}
func MaskData(data string, first, end uint8) string {
// 2. 截取前3位 + **** + 后4位
// Go字符串按字节截取,数字字符单字节,直接切片即可
return data[:first] + "****" + data[end:]
}
func RandString(num uint8) string {
chars := "23456789abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ"
rand.Seed(time.Now().UnixNano())