We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f1ed50 commit 5227831Copy full SHA for 5227831
internal/controller/user_controller.go
@@ -717,9 +717,12 @@ func (uc *UserController) SearchUserListByName(ctx *gin.Context) {
717
}
718
719
func (uc *UserController) setVisitCookies(ctx *gin.Context, visitToken string, force bool) {
720
- cookie, err := ctx.Cookie(constant.UserVisitCookiesCacheKey)
721
- if err == nil && len(cookie) > 0 && !force {
722
- return
+ if !force {
+ cookie, _ := ctx.Cookie(constant.UserVisitCookiesCacheKey)
+ // If the cookie is the same as the visitToken, no need to set it again
723
+ if cookie == visitToken {
724
+ return
725
+ }
726
727
general, err := uc.siteInfoCommonService.GetSiteGeneral(ctx)
728
if err != nil {
0 commit comments