🔒 token encryption

This commit is contained in:
landaiqing
2024-08-14 19:57:37 +08:00
parent 368adadf52
commit 55759a33db
19 changed files with 241 additions and 39 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/pkg6/go-sms/gateways"
"github.com/pkg6/go-sms/gateways/aliyun"
"github.com/pkg6/go-sms/gateways/smsbao"
"schisandra-cloud-album/common/constant"
"schisandra-cloud-album/common/redis"
"schisandra-cloud-album/common/result"
"schisandra-cloud-album/global"
@@ -102,7 +103,7 @@ func (SmsAPI) SendMessageTest(c *gin.Context) {
return
}
code := utils.GenValidateCode(6)
err := redis.Set("user:login:sms:"+phone, code, time.Minute).Err()
err := redis.Set(constant.UserLoginSmsRedisKey+phone, code, time.Minute).Err()
if err != nil {
global.LOG.Error(err)
result.FailWithMessage(ginI18n.MustGetMessage(c, "CaptchaSendFailed"), c)