From f3ceaad096e082771c0ef76f1290f652781840ca Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 13 Dec 2024 20:18:44 +0800 Subject: [PATCH] =?UTF-8?q?h5=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/es/md/es.go | 3 +++ app/hdl/hdl_user.go | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/es/md/es.go b/app/es/md/es.go index a1dae32..ac1902c 100644 --- a/app/es/md/es.go +++ b/app/es/md/es.go @@ -12,6 +12,9 @@ const EggUserShortLinkMap = ` "uid":{ "type": "integer" }, + "date":{ + "type": "integer" + }, "link":{ "type": "keyword" }, diff --git a/app/hdl/hdl_user.go b/app/hdl/hdl_user.go index d3ab576..5e3efe8 100644 --- a/app/hdl/hdl_user.go +++ b/app/hdl/hdl_user.go @@ -351,7 +351,7 @@ func InviteUrl(c *gin.Context) { continue } jsonByte, _ := hit.Source.MarshalJSON() - if gjson.Get(string(jsonByte), "short_link").String() != "" { + if gjson.Get(string(jsonByte), "short_link").String() != "" && gjson.Get(string(jsonByte), "date").Int() > time.Now().Unix() { isHas = 1 link = gjson.Get(string(jsonByte), "short_link").String() } @@ -367,6 +367,7 @@ func InviteUrl(c *gin.Context) { "uid": user.Id, "link": oldLink, "short_link": link, + "date": time.Now().Unix() + 365*86400, } doc, _ := es.FirstDoc(EggUserShortLink, uniqueId) if doc == nil {