|
@@ -1,10 +1,15 @@
|
|
|
package middleware
|
|
|
|
|
|
-import "github.com/gogf/gf/v2/net/ghttp"
|
|
|
+import (
|
|
|
+ "github.com/gogf/gf/v2/frame/g"
|
|
|
+ "github.com/gogf/gf/v2/net/ghttp"
|
|
|
+ "github.com/gogf/gf/v2/os/gctx"
|
|
|
+)
|
|
|
|
|
|
// SetSeoRefer seo来源标记
|
|
|
func SetSeoRefer(r *ghttp.Request) {
|
|
|
val := r.Cookie.Get("SESSIONID")
|
|
|
+ g.Log().Info(gctx.New(), "-------------------------------", val.String())
|
|
|
if !val.IsNil() && val.String() != "" {
|
|
|
if val = r.Cookie.Get("SeoRefer"); val.IsNil() {
|
|
|
r.Cookie.Set("SeoRefer", r.Referer())
|