fix: 修复空提交问题
This commit is contained in:
@@ -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 生成并保存邮件注册码(返回生成的验证码,支持设置过期时间)
|
||||
|
||||
Reference in New Issue
Block a user