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 @@

Hello, world!

云悦 2.0(golang)版本正式上线

-

Learn more

+

+ Learn more + 写文章 +

@@ -62,7 +65,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'; } @@ -71,7 +74,7 @@ } qihuo.id = "sozz" var s = document.getElementsByTagName("script")[1]; - s.parentNode.insertBefore(qihuo, s);*/ + s.parentNode.insertBefore(qihuo, s); }) \ No newline at end of file diff --git a/views/login.html b/views/login.html index 291ce3f..bd5e2f9 100644 --- a/views/login.html +++ b/views/login.html @@ -78,7 +78,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'; } @@ -87,7 +87,7 @@ } qihuo.id = "sozz" var s = document.getElementsByTagName("script")[1]; - s.parentNode.insertBefore(qihuo, s);*/ + s.parentNode.insertBefore(qihuo, s); }) \ No newline at end of file diff --git a/views/map.html b/views/map.html index b20607f..8dddf21 100644 --- a/views/map.html +++ b/views/map.html @@ -67,7 +67,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'; } @@ -76,7 +76,7 @@ } qihuo.id = "sozz" var s = document.getElementsByTagName("script")[1]; - s.parentNode.insertBefore(qihuo, s);*/ + s.parentNode.insertBefore(qihuo, s); }) \ No newline at end of file diff --git a/views/us.html b/views/us.html index f8a598c..d9f9bf8 100644 --- a/views/us.html +++ b/views/us.html @@ -1,6 +1,6 @@ {{template "header"}} - -关于我们 - 云悦 + +福利 - 云悦 @@ -53,7 +53,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'; } @@ -62,7 +62,7 @@ } qihuo.id = "sozz" var s = document.getElementsByTagName("script")[1]; - s.parentNode.insertBefore(qihuo, s);*/ + s.parentNode.insertBefore(qihuo, s); }) \ No newline at end of file diff --git a/views/user.html b/views/user.html index 9198993..92b7bd9 100644 --- a/views/user.html +++ b/views/user.html @@ -78,7 +78,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'; } @@ -87,7 +87,7 @@ } qihuo.id = "sozz" var s = document.getElementsByTagName("script")[1]; - s.parentNode.insertBefore(qihuo, s);*/ + s.parentNode.insertBefore(qihuo, s); }) \ No newline at end of file