فهرست منبع

修改剑鱼访问跳转

renzheng 9 سال پیش
والد
کامیت
873f6ea4dc
4فایلهای تغییر یافته به همراه15 افزوده شده و 1 حذف شده
  1. 2 1
      .gitignore
  2. 2 0
      core/src/qfw/front/wxpush.go
  3. 8 0
      core/src/qfw/member/message/swordfish.go
  4. 3 0
      core/src/web/templates/wxpush/index.html

+ 2 - 1
.gitignore

@@ -4,4 +4,5 @@
 */staticres/upload
 */src/src
 *.data
-*/timetask.json
+*/timetask.json
+core/src/timetask.json

+ 2 - 0
core/src/qfw/front/wxpush.go

@@ -16,9 +16,11 @@ type Wxpush struct {
 
 //推送列表
 func (w *Wxpush) WxpushList(s_m_openid string, _id string, msgid string) error {
+	/**
 	go func() {
 		mongodb.Update("message", `{"_id":"`+msgid+`"}`, `{"$set":{"i_status":1}}`, false, false)
 	}()
+	**/
 	w.T["data"] = *mongodb.FindById("wxpush", _id, `{"s_content":1,"s_words":1,"a_visitedindex":1,"a_publishtime":1}`)
 	w.T["_id"] = _id
 	return w.Render("/wxpush/index.html", &w.T)

+ 8 - 0
core/src/qfw/member/message/swordfish.go

@@ -17,6 +17,14 @@ type swordfish struct {
 	*xweb.Action
 	swordfishlist xweb.Mapper `xweb:"/member/message/swordfishlist"` //剑鱼列表
 	setVisited    xweb.Mapper `xweb:"/member/message/setVisited"`    //已经访问过的列表
+	visitRedirect xweb.Mapper `xweb:"/visit/redirect"`               //剑鱼跳转访问请求,后续统计
+}
+
+func (s *swordfish) VisitRedirect() {
+	surl := s.GetString("url")
+	if surl != "" {
+		s.Redirect(surl)
+	}
 }
 
 func (s *swordfish) SetVisited() {

+ 3 - 0
core/src/web/templates/wxpush/index.html

@@ -97,11 +97,14 @@ function redirect(link){
 	if(!/^http/.test(link)){
 		link="http://"+link
 	}
+	window.location.href="/visit/redirect?url="+escape(link)
+	/**
     var arg ='\u003cscript\u003etop.location.replace("'+link+'")\u003c/script\u003e';
     var iframe = document.createElement('iframe');
     iframe.src='javascript:window.name;';
     iframe.name=arg;
     document.body.appendChild(iframe);
+	**/
 }
 function setVisitedIndex(obj){
 	if(obj.hasClass("visited")){