🎨 update redis storage time

This commit is contained in:
landaiqing
2024-09-05 17:11:30 +08:00
parent 01305c2fa7
commit b3ae27dd20
2 changed files with 3 additions and 3 deletions

View File

@@ -32,7 +32,7 @@ func (ClientAPI) GenerateClientId(c *gin.Context) {
}
// 生成新的客户端ID
v1 := uuid.NewV1()
err := redis.Set(constant.UserLoginClientRedisKey+ip, v1.String(), time.Hour*24*30).Err()
err := redis.Set(constant.UserLoginClientRedisKey+ip, v1.String(), time.Hour*24*7).Err()
if err != nil {
global.LOG.Error(err)
return

View File

@@ -142,7 +142,7 @@ func (OAuthAPI) GetTempQrCode(c *gin.Context) {
}
// 生成临时二维码
data, err := global.Wechat.QRCode.Temporary(c.Request.Context(), clientId, 30*24*3600)
data, err := global.Wechat.QRCode.Temporary(c.Request.Context(), clientId, 7*24*3600)
if err != nil {
global.LOG.Error(err)
result.FailWithMessage(ginI18n.MustGetMessage(c, "QRCodeGetFailed"), c)
@@ -156,7 +156,7 @@ func (OAuthAPI) GetTempQrCode(c *gin.Context) {
result.FailWithMessage(ginI18n.MustGetMessage(c, "QRCodeGetFailed"), c)
return
}
if err := redis.Set(key, serializedData, time.Hour*24*30).Err(); err != nil {
if err := redis.Set(key, serializedData, time.Hour*24*7).Err(); err != nil {
global.LOG.Error(err)
result.FailWithMessage(ginI18n.MustGetMessage(c, "QRCodeGetFailed"), c)
return