From 41ba02113ebf4078617833f1f9b9d1bf8d4ec62f Mon Sep 17 00:00:00 2001 From: "mail_yanpeng@163.com" Date: Tue, 18 Dec 2018 14:24:49 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2=E5=88=B7=E6=96=B0=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E9=98=85=E8=AF=BB=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/BlogController.go | 6 ++++-- filter/Security.go | 7 ++++++- views/blog.html | 4 ++-- views/index.html | 9 ++++++--- views/login.html | 4 ++-- views/map.html | 4 ++-- views/us.html | 8 ++++---- views/user.html | 4 ++-- 8 files changed, 28 insertions(+), 18 deletions(-) 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