fix: 修复空提交问题

This commit is contained in:
1
2025-11-23 23:38:03 +00:00
parent aa4574b5eb
commit 240c349b8a
45 changed files with 113 additions and 4438 deletions

View File

@@ -2,13 +2,13 @@ package share
import (
"context"
"math/rand"
"time"
"blazing/cool"
"github.com/gogf/gf/v2/os/gctx"
"github.com/gogf/gf/v2/util/gconv"
"github.com/gogf/gf/v2/util/grand"
)
// newSessionStore 创建会话缓存实例
@@ -94,8 +94,8 @@ func (m *sessionManager) UserOnlineExists(userID uint32) (bool, error) {
// generate6DigitCode 生成6位数字注册码100000-999999
func (m *sessionManager) generate6DigitCode() int {
// 初始化随机数生成器(确保每次调用生成不同序列)
r := rand.New(rand.NewSource(time.Now().UnixNano()))
return r.Intn(900000) + 100000
return grand.Intn(900000) + 100000
}
// SaveEmailCode 生成并保存邮件注册码(返回生成的验证码,支持设置过期时间)