|
@@ -10,7 +10,7 @@ import (
|
|
"time"
|
|
"time"
|
|
)
|
|
)
|
|
|
|
|
|
-func AddCygxPageHistoryRecord(user *models.WxUserItem, Ctx *context.Context) {
|
|
|
|
|
|
+func AddCygxPageHistoryRecord(user *models.WxUserItem, Ctx *context.Context) {
|
|
item := new(models.CygxPageHistoryRecord)
|
|
item := new(models.CygxPageHistoryRecord)
|
|
item.UserId = user.UserId
|
|
item.UserId = user.UserId
|
|
item.CreateTime = time.Now()
|
|
item.CreateTime = time.Now()
|
|
@@ -24,7 +24,7 @@ func AddCygxPageHistoryRecord(user *models.WxUserItem, Ctx *context.Context) {
|
|
if index != -1 {
|
|
if index != -1 {
|
|
item.Parameter = item.Router[index+1:]
|
|
item.Parameter = item.Router[index+1:]
|
|
}
|
|
}
|
|
- if Ctx.Input.Method() == "POST" {
|
|
|
|
|
|
+ if Ctx.Input.Method() == "POST" && string(Ctx.Input.RequestBody) != "" {
|
|
item.Parameter = string(Ctx.Input.RequestBody)
|
|
item.Parameter = string(Ctx.Input.RequestBody)
|
|
var pr models.PageRouter
|
|
var pr models.PageRouter
|
|
err := json.Unmarshal(Ctx.Input.RequestBody, &pr)
|
|
err := json.Unmarshal(Ctx.Input.RequestBody, &pr)
|
|
@@ -46,11 +46,10 @@ func AddCygxPageHistoryRecord(user *models.WxUserItem, Ctx *context.Context) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
_, err := models.AddCygxPageHistoryRecord(item)
|
|
_, err := models.AddCygxPageHistoryRecord(item)
|
|
if err != nil {
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
fmt.Println(err)
|
|
utils.FileLog.Info(err.Error())
|
|
utils.FileLog.Info(err.Error())
|
|
return
|
|
return
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|