🎨 update redis storage time
This commit is contained in:
@@ -32,7 +32,7 @@ func (ClientAPI) GenerateClientId(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
// 生成新的客户端ID
|
// 生成新的客户端ID
|
||||||
v1 := uuid.NewV1()
|
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 {
|
if err != nil {
|
||||||
global.LOG.Error(err)
|
global.LOG.Error(err)
|
||||||
return
|
return
|
||||||
|
@@ -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 {
|
if err != nil {
|
||||||
global.LOG.Error(err)
|
global.LOG.Error(err)
|
||||||
result.FailWithMessage(ginI18n.MustGetMessage(c, "QRCodeGetFailed"), c)
|
result.FailWithMessage(ginI18n.MustGetMessage(c, "QRCodeGetFailed"), c)
|
||||||
@@ -156,7 +156,7 @@ func (OAuthAPI) GetTempQrCode(c *gin.Context) {
|
|||||||
result.FailWithMessage(ginI18n.MustGetMessage(c, "QRCodeGetFailed"), c)
|
result.FailWithMessage(ginI18n.MustGetMessage(c, "QRCodeGetFailed"), c)
|
||||||
return
|
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)
|
global.LOG.Error(err)
|
||||||
result.FailWithMessage(ginI18n.MustGetMessage(c, "QRCodeGetFailed"), c)
|
result.FailWithMessage(ginI18n.MustGetMessage(c, "QRCodeGetFailed"), c)
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user