diff --git a/controllers/BlogController.go b/controllers/BlogController.go index de2cd58..ce14187 100644 --- a/controllers/BlogController.go +++ b/controllers/BlogController.go @@ -116,8 +116,10 @@ func (this *BlogController) Get() { this.Data["NickName"] = this.GetSession("nickname") this.Data["IsLogin"] = this.GetSession("nickname") != nil this.TplName = "blog.html" - service.CountBrows(blog.UserId) - service.EditBlogBrows(id) + if this.Ctx.Input.GetData("refresh") != true { + service.CountBrows(blog.UserId) + service.EditBlogBrows(id) + } return } diff --git a/filter/Security.go b/filter/Security.go index 70e28fc..f59a527 100644 --- a/filter/Security.go +++ b/filter/Security.go @@ -6,8 +6,13 @@ import ( ) var FilterAdmin = func(ctx *context.Context) { - url := ctx.Input.URL() + url := ctx.Input.URI() + refer := ctx.Input.Refer() + site := ctx.Input.Site() logs.Info(url) + if site+url == refer { + ctx.Input.SetData("refresh",true) + } //beego.Informational(url) //if url != "/login"{ // ctx.Redirect(302, "/login") diff --git a/views/blog.html b/views/blog.html index d872e27..43ab4ec 100644 --- a/views/blog.html +++ b/views/blog.html @@ -148,7 +148,7 @@ s.parentNode.insertBefore(bp, s); /*360收录*/ -/* var qihuo = document.createElement('script'); + var qihuo = document.createElement('script'); if (curProtocol === 'https') { qihuo.src = 'https://jspassport.ssl.qhimg.com/11.0.1.js?d33b14200fa89b7ecd3780341cd234c'; } @@ -157,7 +157,7 @@ } qihuo.id = "sozz" var s = document.getElementsByTagName("script")[1]; - s.parentNode.insertBefore(qihuo, s);*/ + s.parentNode.insertBefore(qihuo, s); }) function recomm(pid, flag) { layer.prompt({title: '请输入评论内容', value: name, formType: 2}, function (val, index) { diff --git a/views/index.html b/views/index.html index aac075a..739d11e 100644 --- a/views/index.html +++ b/views/index.html @@ -8,7 +8,10 @@