소스 검색

分销程序权限修改

WH01243 2 년 전
부모
커밋
0bbf9cf805

+ 102 - 98
src/jfw/modules/distribution/src/config.json

@@ -1,103 +1,107 @@
 {
-	"webport": "8086",
-	"webdomain":"http://web-jydev-wh.jianyu360.cn",
-	"mongodb": {
-		"main": {
-			"address": "192.168.3.206:27080",
-	 		"size": 5,
-	 		"dbName": "qfw"
-		},
-		"log": {
-			"address": "192.168.3.206:27080",
-	 		"size": 5,
-	 		"dbName": "qfw",
-			"userName": "admin",
-			"password": "123456"
-		}
-	},
-    "redis": {
-    	"main": {
-			"address": "other=192.168.3.206:1712,session=192.168.3.206:1712"
-		}
+  "webport": "8086",
+  "webdomain": "http://web-jydev-wh.jianyu360.cn",
+  "mongodb": {
+    "main": {
+      "address": "192.168.3.206:27080",
+      "size": 5,
+      "dbName": "qfw"
     },
-    "mysql": {
-	    "main": {
-	        "dbName": "jianyu",
-	        "address": "192.168.3.11:3366",
-	        "userName": "root",
-	        "passWord": "Topnet123",
-			"maxOpenConns": 20,
-			"maxIdleConns": 20
-	    }
+    "log": {
+      "address": "192.168.3.206:27080",
+      "size": 5,
+      "dbName": "qfw",
+      "userName": "admin",
+      "password": "123456"
+    }
+  },
+  "redis": {
+    "main": {
+      "address": "other=192.168.3.206:1712,session=192.168.3.206:1712"
+    }
+  },
+  "mysql": {
+    "main": {
+      "dbName": "jianyu",
+      "address": "192.168.3.11:3366",
+      "userName": "root",
+      "passWord": "Topnet123",
+      "maxOpenConns": 20,
+      "maxIdleConns": 20
+    }
+  },
+  "mail": [
+    {
+      "addr": "smtp.exmail.qq.com",
+      "port": 465,
+      "pwd": "ue9Rg9Sf4CVtdm5a",
+      "user": "public03@topnet.net.cn"
     },
-    "mail": [
-        {
-            "addr": "smtp.exmail.qq.com",
-            "port": 465,
-            "pwd": "ue9Rg9Sf4CVtdm5a",
-            "user": "public03@topnet.net.cn"
-        },
-        {
-            "addr": "smtp.exmail.qq.com",
-            "port": 465,
-            "pwd": "ue9Rg9Sf4CVtdm5a",
-            "user": "public03@topnet.net.cn"
-        }
-    ],
-    "workerNum":10,
-	"jobNum":20,
-    "modular":{
-    	"bottomTxt": "- 全国招标信息免费看,不遮挡 -",
-		"butTxt": "打 开",
-		"subTitle": "向您推荐了剑鱼标讯  %s",
-		"title": "您的好友 %s",
-		"imgUrl":"/jyapp/images/jyicon_new.png",
-    	"A":{
-			"name":"超级订阅",
-			"url":"/front/vipsubscribe/introducePage",
-			"appUrl":"/jyapp/vipsubscribe/introducePage",
-			"upgradeUrl":"/front/vipsubscribe/toSubVipSetPage"
-			},
-    	"B":{
-			"name":"数据导出",
-			"url":"/front/wx_dataExport/toSieve",
-			"appUrl":"/jyapp/front/dataExport/toSieve"
-			},
-    	"C":{
-			"name":"数据报告",
-			"url":"/datareport/page/home",
-			"appUrl":"/datareport/page/home"
-			},
-		"X":{
-			"name":"公告信息",
-			"url":"/datareport/page/home",
-			"appUrl":"/datareport/page/home"
-		},
-		"E": {
-			"name":"数据流量包",
-			"url":"/jy_mobile/common/order/create/datapack",
-			"appUrl":"/frontPage/flowpacket/free/data",
-			"packetFilterUrl": "/front/wx_dataExport/toSieve",
-			"appPacketFilterUrl": "/front/dataExport/toSieve",
-			"buyUrl": "/jy_mobile/common/order/create/datapack",
-			"appBuyUrl": "/jy_mobile/common/order/create/datapack"
-		},
-		"F": {
-			"name":"中标必听课",
-			"url":"/frontPage/flowpacket/free/data",
-			"appUrl":"/front/dataExport/toSieve",
-			"courselistUrl": "/jyxsapp/"
-		}
+    {
+      "addr": "smtp.exmail.qq.com",
+      "port": 465,
+      "pwd": "ue9Rg9Sf4CVtdm5a",
+      "user": "public03@topnet.net.cn"
+    }
+  ],
+  "workerNum": 10,
+  "jobNum": 20,
+  "modular": {
+    "bottomTxt": "- 全国招标信息免费看,不遮挡 -",
+    "butTxt": "打 开",
+    "subTitle": "向您推荐了剑鱼标讯  %s",
+    "title": "您的好友 %s",
+    "imgUrl": "/jyapp/images/jyicon_new.png",
+    "A": {
+      "name": "超级订阅",
+      "url": "/front/vipsubscribe/introducePage",
+      "appUrl": "/jyapp/vipsubscribe/introducePage",
+      "upgradeUrl": "/front/vipsubscribe/toSubVipSetPage"
     },
-    "uploadPath":"/uploadFile/",
-    "catchoutTimesMonth":2,
-    "authCost":1.2,
-	"termValidity":3600,
-	"sourceCenter":"http://192.168.3.206:8889",
-	"phoneFilterFlag":true,
-	"accountMergeOnline":"2055-03-30 00:00:00",
-	"regurl":[
-		"^distribution/share/shareLink$"
-	],
-    "smsServiceRpc":"127.0.0.1:932"
+    "B": {
+      "name": "数据导出",
+      "url": "/front/wx_dataExport/toSieve",
+      "appUrl": "/jyapp/front/dataExport/toSieve"
+    },
+    "C": {
+      "name": "数据报告",
+      "url": "/datareport/page/home",
+      "appUrl": "/datareport/page/home"
+    },
+    "X": {
+      "name": "公告信息",
+      "url": "/datareport/page/home",
+      "appUrl": "/datareport/page/home"
+    },
+    "E": {
+      "name": "数据流量包",
+      "url": "/jy_mobile/common/order/create/datapack",
+      "appUrl": "/frontPage/flowpacket/free/data",
+      "packetFilterUrl": "/front/wx_dataExport/toSieve",
+      "appPacketFilterUrl": "/front/dataExport/toSieve",
+      "buyUrl": "/jy_mobile/common/order/create/datapack",
+      "appBuyUrl": "/jy_mobile/common/order/create/datapack"
+    },
+    "F": {
+      "name": "中标必听课",
+      "url": "/frontPage/flowpacket/free/data",
+      "appUrl": "/front/dataExport/toSieve",
+      "courselistUrl": "/jyxsapp/"
+    }
+  },
+  "uploadPath": "/uploadFile/",
+  "catchoutTimesMonth": 2,
+  "authCost": 1.2,
+  "termValidity": 3600,
+  "sourceCenter": "http://192.168.3.206:8889",
+  "phoneFilterFlag": true,
+  "accountMergeOnline": "2055-03-30 00:00:00",
+  "regurl": [
+    "^distribution/share/shareLink$"
+  ],
+  "smsServiceRpc": "127.0.0.1:932",
+  "etcd": {
+    "hosts": "192.168.3.206:27080",
+    "key": "powercheck.rpc"
+  }
 }

+ 78 - 6
src/jfw/modules/distribution/src/go.mod

@@ -3,37 +3,109 @@ module jy/src/jfw/modules/distribution/src
 go 1.18
 
 require (
-	app.yhyue.com/moapp/jybase v0.0.0-20230110071808-0c8ff7f798c6
-	app.yhyue.com/moapp/jypkg v0.0.0-20221229090523-854669eee0ff
+	app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a
+	app.yhyue.com/moapp/jypkg v0.0.0-20230131063426-ccffb86d71ba
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/tealeg/xlsx v1.0.5
 )
 
 require (
 	app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d // indirect
-	app.yhyue.com/moapp/message v0.0.0-20221202072401-d825fc65512c // indirect
+	app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae // indirect
+	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230128033309-a6b26e74a68c // indirect
+	github.com/beorn7/perks v1.0.1 // indirect
+	github.com/cenkalti/backoff/v4 v4.1.3 // indirect
+	github.com/cespare/xxhash/v2 v2.1.2 // indirect
+	github.com/coreos/go-semver v0.3.0 // indirect
+	github.com/coreos/go-systemd/v22 v22.3.2 // indirect
+	github.com/davecgh/go-spew v1.1.1 // indirect
 	github.com/dchest/captcha v0.0.0-20200903113550-03f5f0333e1f // indirect
+	github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
+	github.com/fatih/color v1.13.0 // indirect
+	github.com/felixge/fgprof v0.9.3 // indirect
 	github.com/garyburd/redigo v1.6.2 // indirect
-	github.com/go-sql-driver/mysql v1.6.0 // indirect
+	github.com/go-logr/logr v1.2.3 // indirect
+	github.com/go-logr/stdr v1.2.2 // indirect
+	github.com/go-redis/redis/v8 v8.11.5 // indirect
+	github.com/go-sql-driver/mysql v1.7.0 // indirect
+	github.com/gogo/protobuf v1.3.2 // indirect
+	github.com/golang-jwt/jwt/v4 v4.4.3 // indirect
+	github.com/golang/mock v1.6.0 // indirect
+	github.com/golang/protobuf v1.5.2 // indirect
 	github.com/golang/snappy v0.0.4 // indirect
 	github.com/gomodule/redigo v1.8.9 // indirect
+	github.com/google/go-cmp v0.5.9 // indirect
+	github.com/google/gofuzz v1.2.0 // indirect
+	github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect
+	github.com/googleapis/gnostic v0.5.5 // indirect
+	github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
 	github.com/howeyc/fsnotify v0.9.0 // indirect
 	github.com/jinzhu/inflection v1.0.0 // indirect
 	github.com/jinzhu/now v1.1.1 // indirect
+	github.com/json-iterator/go v1.1.12 // indirect
 	github.com/klauspost/compress v1.13.6 // indirect
+	github.com/mattn/go-colorable v0.1.9 // indirect
+	github.com/mattn/go-isatty v0.0.14 // indirect
+	github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
+	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+	github.com/modern-go/reflect2 v1.0.2 // indirect
 	github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
 	github.com/nsqio/go-nsq v1.1.0 // indirect
 	github.com/olivere/elastic v6.2.37+incompatible // indirect
+	github.com/openzipkin/zipkin-go v0.4.0 // indirect
+	github.com/pelletier/go-toml/v2 v2.0.6 // indirect
 	github.com/pkg/errors v0.9.1 // indirect
+	github.com/prometheus/client_golang v1.13.0 // indirect
+	github.com/prometheus/client_model v0.2.0 // indirect
+	github.com/prometheus/common v0.37.0 // indirect
+	github.com/prometheus/procfs v0.8.0 // indirect
+	github.com/spaolacci/murmur3 v1.1.0 // indirect
 	github.com/xdg-go/pbkdf2 v1.0.0 // indirect
 	github.com/xdg-go/scram v1.1.1 // indirect
 	github.com/xdg-go/stringprep v1.0.3 // indirect
 	github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
+	github.com/zeromicro/go-zero v1.4.4 // indirect
+	go.etcd.io/etcd/api/v3 v3.5.5 // indirect
+	go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect
+	go.etcd.io/etcd/client/v3 v3.5.5 // indirect
 	go.mongodb.org/mongo-driver v1.11.1 // indirect
+	go.opentelemetry.io/otel v1.11.0 // indirect
+	go.opentelemetry.io/otel/exporters/jaeger v1.11.0 // indirect
+	go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.0 // indirect
+	go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.0 // indirect
+	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.0 // indirect
+	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.10.0 // indirect
+	go.opentelemetry.io/otel/exporters/zipkin v1.11.0 // indirect
+	go.opentelemetry.io/otel/sdk v1.11.0 // indirect
+	go.opentelemetry.io/otel/trace v1.11.0 // indirect
+	go.opentelemetry.io/proto/otlp v0.19.0 // indirect
+	go.uber.org/atomic v1.9.0 // indirect
+	go.uber.org/automaxprocs v1.5.1 // indirect
+	go.uber.org/multierr v1.8.0 // indirect
+	go.uber.org/zap v1.21.0 // indirect
 	golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
-	golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
-	golang.org/x/text v0.3.8-0.20211105212822-18b340fc7af2 // indirect
+	golang.org/x/net v0.0.0-20221014081412-f15817d10f9b // indirect
+	golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect
+	golang.org/x/sync v0.1.0 // indirect
+	golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect
+	golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
+	golang.org/x/text v0.4.0 // indirect
+	golang.org/x/time v0.3.0 // indirect
+	google.golang.org/appengine v1.6.7 // indirect
+	google.golang.org/genproto v0.0.0-20221111202108-142d8a6fa32e // indirect
+	google.golang.org/grpc v1.51.0 // indirect
+	google.golang.org/protobuf v1.28.1 // indirect
 	gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
+	gopkg.in/inf.v0 v0.9.1 // indirect
+	gopkg.in/yaml.v2 v2.4.0 // indirect
+	gopkg.in/yaml.v3 v3.0.1 // indirect
 	gorm.io/driver/mysql v1.0.5 // indirect
 	gorm.io/gorm v1.21.3 // indirect
+	k8s.io/api v0.22.9 // indirect
+	k8s.io/apimachinery v0.22.9 // indirect
+	k8s.io/client-go v0.22.9 // indirect
+	k8s.io/klog/v2 v2.80.1 // indirect
+	k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 // indirect
+	sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
+	sigs.k8s.io/yaml v1.2.0 // indirect
 )

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 534 - 9
src/jfw/modules/distribution/src/go.sum


+ 34 - 36
src/jfw/modules/distribution/src/service/action/share.go

@@ -13,7 +13,6 @@ import (
 	"sync"
 	"time"
 
-	qu "app.yhyue.com/moapp/jybase/common"
 	util "app.yhyue.com/moapp/jybase/common"
 	. "app.yhyue.com/moapp/jybase/date"
 	"app.yhyue.com/moapp/jybase/redis"
@@ -106,26 +105,25 @@ func (this *Share) LinkShare(discored string) error {
 	disType := discored[:1]
 	if openid == "" || discored == "" {
 		/*if disType == "E" { //数据流量包
-			return this.Redirect("/frontPage/flowpacket/free/data")
-		} else if disType == "F" { //中标必听课
-			return this.Redirect("/frontPage/coursepage/free/data")
-		} else {
-			//提示关注页面
-			return this.Redirect("/")
-		}*/
+		  	return this.Redirect("/frontPage/flowpacket/free/data")
+		  } else if disType == "F" { //中标必听课
+		  	return this.Redirect("/frontPage/coursepage/free/data")
+		  } else {
+		  	//提示关注页面
+		  	return this.Redirect("/")
+		  }*/
 		//提示关注页面
 		return this.Redirect("/")
 	}
 	userId, _ := this.Session().Get("userId").(string)
-	//userId = "5fdac5cea3246ebb79d1e24e"
 	url := ""
 	fmt.Println(userId, openid, "user", `{"s_m_openid":"`+openid+`}`, `{"o_jy":1:"o_vipjy":1,"i_vip_status":1}`)
 	if discored[len(discored)-4:len(discored)-2] == "GX" {
 		if disType == "A" {
 			//user, ok := MQFW.FindOneByField("user", `{"s_m_openid":"`+openid+`"}`, `{"o_jy":1:"o_vipjy":1,"i_vip_status":1}`)
-			user := jy.GetBigVipUserBaseMsg(this.Session(), MQFW, "f", "10000")
+			user := jy.GetBigVipUserBaseMsg("10000", this.Session(), Sysconfig.Etcd.Hosts, Sysconfig.Etcd.Key)
 			log.Println(user)
-			if ok && user != nil {
+			if user != nil {
 				i_vip_status := user.VipStatus
 				if i_vip_status > 0 {
 					modular := util.ObjToMap(Sysconfig.Modular[discored[:1]])
@@ -138,21 +136,21 @@ func (this *Share) LinkShare(discored string) error {
 		} else if disType == "E" {
 			//判断用户是否否买过数据流量包
 			/*req, _ := http.NewRequest("GET", Sysconfig.SourceCenter+"/resources/findBalance?accountId="+userId, nil)
-			fmt.Println(Sysconfig.SourceCenter + "/resources/findBalance?accountId=" + userId)
-			res, _ := http.DefaultClient.Do(req)
-			defer res.Body.Close()
-			body, _ := ioutil.ReadAll(res.Body)
-			dat := BalanceRes{}
-			_ = json.Unmarshal([]byte(body), &dat)
-			if dat.Data != nil && len(dat.Data) > 0 {
-				//页面跳转至数据包筛选页面
-				modular := util.ObjToMap(Sysconfig.Modular[disType])
-				url = (*modular)["packetFilterUrl"].(string) + "?disWord=" + discored
-			} else {
-				//没有购买流量包,跳转至购买页面
-				modular := util.ObjToMap(Sysconfig.Modular[disType])
-				url = (*modular)["buyUrl"].(string) + "?disWord=" + discored
-			}*/
+			  fmt.Println(Sysconfig.SourceCenter + "/resources/findBalance?accountId=" + userId)
+			  res, _ := http.DefaultClient.Do(req)
+			  defer res.Body.Close()
+			  body, _ := ioutil.ReadAll(res.Body)
+			  dat := BalanceRes{}
+			  _ = json.Unmarshal([]byte(body), &dat)
+			  if dat.Data != nil && len(dat.Data) > 0 {
+			  	//页面跳转至数据包筛选页面
+			  	modular := util.ObjToMap(Sysconfig.Modular[disType])
+			  	url = (*modular)["packetFilterUrl"].(string) + "?disWord=" + discored
+			  } else {
+			  	//没有购买流量包,跳转至购买页面
+			  	modular := util.ObjToMap(Sysconfig.Modular[disType])
+			  	url = (*modular)["buyUrl"].(string) + "?disWord=" + discored
+			  }*/
 			//新老用户打开链接跳转至购买界面
 			modular := util.ObjToMap(Sysconfig.Modular[disType])
 			url = (*modular)["buyUrl"].(string) + "?disWord=" + discored
@@ -229,11 +227,11 @@ func analyseWord(discored, userId string, isBuy bool) (name, url, appUrl, shareN
 		}
 	}
 	/*//redis 获取分销者信息
-	redisDis := redis.GetStr("other", "DIS_"+discored[1:])
-	if redisDis != "" {
-		//分销者昵称
-		shareNickname = strings.Split(redisDis, "##")[0]
-	}*/
+	  redisDis := redis.GetStr("other", "DIS_"+discored[1:])
+	  if redisDis != "" {
+	  	//分销者昵称
+	  	shareNickname = strings.Split(redisDis, "##")[0]
+	  }*/
 	return name, url, appUrl, shareNickname
 
 }
@@ -350,11 +348,11 @@ func appAnalyseWord(discored, userId string, isBuy bool) (name, url, appUrl, sha
 
 	}
 	/*//redis 获取分销者信息
-	redisDis := redis.GetStr("other", "DIS_"+discored[1:])
-	if redisDis != "" {
-		//分销者昵称
-		shareNickname = strings.Split(redisDis, "##")[0]
-	}*/
+	  redisDis := redis.GetStr("other", "DIS_"+discored[1:])
+	  if redisDis != "" {
+	  	//分销者昵称
+	  	shareNickname = strings.Split(redisDis, "##")[0]
+	  }*/
 	return name, url, appUrl, shareNickname
 
 }

+ 6 - 2
src/jfw/modules/distribution/src/service/config/config.go

@@ -1,12 +1,12 @@
 package config
 
 import (
-	"log"
-	m "app.yhyue.com/moapp/jybase/mongodb"
 	util "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/mail"
+	m "app.yhyue.com/moapp/jybase/mongodb"
 	"app.yhyue.com/moapp/jybase/mysql"
 	"app.yhyue.com/moapp/jybase/redis"
+	"log"
 )
 
 type config struct {
@@ -41,6 +41,10 @@ type config struct {
 	AccountMergeOnline string
 	Regurl             []string
 	SmsServiceRpc      string
+	Etcd               struct {
+		Hosts string `json:"hosts"`
+		Key   string `json:"key"`
+	} `json:"etcd"`
 }
 
 type BalanceRes struct {

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.