Browse Source

h5注册

tmp
huangjiajun 4 weeks ago
parent
commit
f3ceaad096
2 changed files with 5 additions and 1 deletions
  1. +3
    -0
      app/es/md/es.go
  2. +2
    -1
      app/hdl/hdl_user.go

+ 3
- 0
app/es/md/es.go View File

@@ -12,6 +12,9 @@ const EggUserShortLinkMap = `
"uid":{ "uid":{
"type": "integer" "type": "integer"
}, },
"date":{
"type": "integer"
},
"link":{ "link":{
"type": "keyword" "type": "keyword"
}, },


+ 2
- 1
app/hdl/hdl_user.go View File

@@ -351,7 +351,7 @@ func InviteUrl(c *gin.Context) {
continue continue
} }
jsonByte, _ := hit.Source.MarshalJSON() 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 isHas = 1
link = gjson.Get(string(jsonByte), "short_link").String() link = gjson.Get(string(jsonByte), "short_link").String()
} }
@@ -367,6 +367,7 @@ func InviteUrl(c *gin.Context) {
"uid": user.Id, "uid": user.Id,
"link": oldLink, "link": oldLink,
"short_link": link, "short_link": link,
"date": time.Now().Unix() + 365*86400,
} }
doc, _ := es.FirstDoc(EggUserShortLink, uniqueId) doc, _ := es.FirstDoc(EggUserShortLink, uniqueId)
if doc == nil { if doc == nil {


Loading…
Cancel
Save