wangshan 2 жил өмнө
parent
commit
be5c9bf877

+ 11 - 3
src/jfw/modules/app/src/app/front/tags.go

@@ -10,6 +10,7 @@ import (
 	"jy/src/jfw/modules/app/src/app/jyutil"
 	"jy/src/jfw/modules/app/src/jfw/config"
 	"log"
+	"net/http"
 	"strconv"
 	"strings"
 )
@@ -99,12 +100,19 @@ func init() {
 
 func (tg *Tags) TagsIndex(first, types, name string) error {
 	defer qu.Catch()
+	if userId, _ := tg.GetSession("userId").(string); userId != "" {
+		tg.SetCookie(&http.Cookie{
+			Name:     "isLogin",
+			Value:    "1",
+			Path:     "/",
+			HttpOnly: false,
+			MaxAge:   600, //十分钟
+		})
+		return tg.Redirect("/jyapp/jylab/mainSearch")
+	}
 	if !firstList[first] {
 		return tg.Redirect("/jyapp/free/swordfish/about?from=tags")
 	}
-	if userId, _ := tg.GetSession("userId").(string); userId != "" {
-		return tg.Redirect("/jyapp/jylab/mainSearch?isLogin=1")
-	}
 onceAgain:
 	tagsMobileKey := fmt.Sprintf("tags_mobile_key_%s_%s", types, name)
 	if res := redis.Get("seoCache", tagsMobileKey); res == nil || res == "" {