Просмотр исходного кода

Merge remote-tracking branch 'origin/dev3.4.8' into dev3.4.8

wangkaiyue 4 лет назад
Родитель
Сommit
88e39e7fbe

+ 8 - 6
src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html

@@ -870,17 +870,19 @@
                 infoId:{{.T.obj._id}}
             },
             success:function(data){
-                console.log(data)
-                if(data.data !=null&&data.data.length!=0){
+                if(data.data.len==0){
+                  $(".atta-download").hide();
+                }
+                if(data.data.attachment !=null&&data.data.attachment.length!=0){
                     var html = ''
                     if(mySysIsIos()){
-                        for(var i=0;i<data.data.length;i++) {
-                            html += "<li class='downs'>"+"<a class='downfiles' downurl="+data.data[i].downurl+">"+data.data[i].filename+"</a></li>"
+                        for(var i=0;i<data.data.attachment.length;i++) {
+                            html += "<li class='downs'>"+"<a class='downfiles' downurl="+data.data.attachment[i].downurl+">"+data.data.attachment[i].filename+"</a></li>"
                         }
                     }else{
-                        for(var i=0;i<data.data.length;i++) {
+                        for(var i=0;i<data.data.attachment.length;i++) {
                             // html += "<li class='downs'>"+"<a class='downfiles' download="+data.data[i].filename+" href="+data.data[i].downurl+">"+data.data[i].filename+"</a></li>"
-                            html += "<li class='downs'>"+"<a class='menu_list' href="+data.data[i].downurl+">"+data.data[i].filename+"</a></li>"
+                            html += "<li class='downs'>"+"<a class='menu_list' href="+data.data.attachment[i].downurl+">"+data.data.attachment[i].filename+"</a></li>"
                         }
                     }
 

+ 3 - 2
src/jfw/modules/bigmember/src/filter/sessionfilter.go

@@ -3,10 +3,11 @@ package filter
 import (
 	. "api"
 	"db"
-	"github.com/go-xweb/xweb"
 	"net/http"
 	"qfw/util/jy"
 	"regexp"
+
+	"github.com/go-xweb/xweb"
 )
 
 //登录限制
@@ -15,7 +16,7 @@ type sessionfilter struct {
 }
 
 //需要权限判断的地址
-var needReg = regexp.MustCompile("^/bigmember/(potential|report|forecast|decision|attachment|analysis|subscribe)/.+$") //画像接口中判断权限
+var needReg = regexp.MustCompile("^/bigmember/(potential|report|forecast|decision|analysis|subscribe)/.+$") //画像接口中判断权限
 
 func init() {
 	jy.InitBigVipService(db.Mysql)

+ 9 - 1
src/jfw/modules/bigmember/src/service/use/use.go

@@ -346,7 +346,15 @@ func (u *Use) Attachment() {
 		if rep.Rep == nil {
 			rep.Rep = []map[string]interface{}{}
 		}
-		return Result{Data: rep.Rep}
+		m := rep.Rep
+		status := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo).Status
+		if status <= 0 {
+			m = []map[string]interface{}{}
+		}
+		return Result{Data: map[string]interface{}{
+			"attachment": m,
+			"len":        len(rep.Rep),
+		}}
 	}()
 	u.ServeJson(r)
 }

+ 4 - 3
src/jfw/modules/pc/server/src/config.json

@@ -1,5 +1,6 @@
 {
-  "port":":8082",
-  "redisAddr":"other=192.168.3.18:2379",
-  "redisOfflineMsgTimeout":604800
+	"port":":8082",
+ 	"redisAddr":"other=192.168.3.18:2379",
+  	"redisOfflineMsgTimeout":604800,
+  	"subscribePushRpc":"127.0.0.1:1122"
 }

+ 1 - 0
src/jfw/modules/pc/server/src/config/config.go

@@ -11,6 +11,7 @@ type Config struct {
 	Port                   string `json:"port"`
 	RedisAddr              string `json:"redisAddr"`
 	RedisOfflineMsgTimeout int    `json:"redisOfflineMsgTimeout"`
+	SubscribePushRpc       string `json:"subscribePushRpc"`
 }
 
 var SysConfig Config

+ 2 - 0
src/jfw/modules/pc/server/src/push/client.go

@@ -18,6 +18,7 @@ var (
 )
 
 func Add(code string, con *websocket.Conn) {
+	go IsOnLine(code, true)
 	lock.Lock()
 	//断开老连接
 	if v, ok := mapping[code]; ok {
@@ -36,6 +37,7 @@ func Add(code string, con *websocket.Conn) {
 }
 
 func Remove(code string) {
+	go IsOnLine(code, false)
 	lock.Lock()
 	//断开老连接
 	if v, ok := mapping[code]; ok {

+ 7 - 8
src/jfw/modules/pc/server/src/push/push.go

@@ -35,15 +35,14 @@ type (
 	}
 )
 
-func (s *Service) IsOnLine(request *string, repl *string) error {
-	lock.Lock()
-	defer lock.Unlock()
-	//断开老连接
-	if _, ok := mapping[*request]; ok {
-		*repl = "y"
-	} else {
-		*repl = "n"
+func (s *Service) AllOnLine(request *string, repl *[]string) error {
+	r := []string{}
+	lock.RLock()
+	for k, _ := range mapping {
+		r = append(r, k)
 	}
+	lock.RUnlock()
+	*repl = r
 	return nil
 }
 func (s *Service) PushMsg(request *[]byte, repl *string) error {

+ 27 - 0
src/jfw/modules/pc/server/src/push/rpccall.go

@@ -0,0 +1,27 @@
+package push
+
+import (
+	. "config"
+	"encoding/json"
+	"net/rpc"
+	"qfw/util"
+
+	"github.com/donnie4w/go-logger/logger"
+)
+
+//
+func IsOnLine(key string, flag bool) {
+	defer util.Catch()
+	var repl string
+	client, err := rpc.DialHTTP("tcp", SysConfig.SubscribePushRpc)
+	if err != nil {
+		logger.Error(err.Error())
+		return
+	}
+	defer client.Close()
+	b, _ := json.Marshal(map[string]bool{key: flag})
+	err = client.Call("Rpc.PcHelperIsOnLine", b, &repl)
+	if err != nil {
+		logger.Error(err.Error())
+	}
+}

+ 2 - 0
src/web/templates/pc/dataExport_sieve.html

@@ -1750,10 +1750,12 @@
         InfoArr.clear(InfoArr.arr);
         //buyer
         $("#inputDel_1").find("div[data-arr='inputDel_1']").remove();
+        window['inputDel_1'] = [];
         $("#addBuyer").hide();
         $("#buyerInput").show();
         //winner
         $("#inputDel_2").find("div[data-arr='inputDel_2']").remove();
+        window['inputDel_2'] = [];
         $("#addWinner").hide();
         $("#winnerInput").show();
     });