wangchuanjin 2 år sedan
förälder
incheckning
2883f58af3

+ 3 - 4
src/go.mod

@@ -4,22 +4,20 @@ go 1.18
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230110071808-0c8ff7f798c6
-	app.yhyue.com/moapp/jypkg v0.0.0-20230110072459-b8e28d30c98d
-	bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230109023014-2cd2a0b9b979
+	app.yhyue.com/moapp/jypkg v0.0.0-20230117032631-52c9c8a3a91d
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/dchest/captcha v1.0.0
 	github.com/fsnotify/fsnotify v1.6.0
 	github.com/gogf/gf/v2 v2.2.6
 	github.com/robfig/cron v1.2.0
-	github.com/zeromicro/go-zero v1.4.3
 	go.mongodb.org/mongo-driver v1.11.1
 )
 
-
 require (
 	app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d // indirect
 	app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae // indirect
 	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230106052936-bd3ab7edf7a4 // indirect
+	bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230116052827-9b32b243b46f // indirect
 	github.com/BurntSushi/toml v1.1.0 // indirect
 	github.com/beorn7/perks v1.0.1 // indirect
 	github.com/cenkalti/backoff/v4 v4.1.3 // indirect
@@ -80,6 +78,7 @@ require (
 	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.3 // indirect
 	github.com/ziutek/blas v0.0.0-20190227122918-da4ca23e90bb // indirect
 	go.etcd.io/etcd/api/v3 v3.5.5 // indirect
 	go.etcd.io/etcd/client/pkg/v3 v3.5.5 // indirect

+ 4 - 4
src/go.sum

@@ -13,8 +13,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20220802080941-07f401baab8b/go.mod h1:HelrO6tc
 app.yhyue.com/moapp/jybase v0.0.0-20230109015757-aa3d5e19b196/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
 app.yhyue.com/moapp/jybase v0.0.0-20230110071808-0c8ff7f798c6 h1:Szt9G37MxAN5xJXGGS87EtMdIKoucilK5inP3zRLUIE=
 app.yhyue.com/moapp/jybase v0.0.0-20230110071808-0c8ff7f798c6/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
-app.yhyue.com/moapp/jypkg v0.0.0-20230110072459-b8e28d30c98d h1:N/71mg7rkJnKNtxVGji0xID2PdRt4BnAj7uKpjA3ZO0=
-app.yhyue.com/moapp/jypkg v0.0.0-20230110072459-b8e28d30c98d/go.mod h1:Arq5I8RsXJvV6i8K7f0ZG6MBt26MLhzuQswoU3SSqjc=
+app.yhyue.com/moapp/jypkg v0.0.0-20230117032631-52c9c8a3a91d h1:0T42jkxFtG3gt+C4qVBAnWbthaquaEIbPf0TJlDOa4w=
+app.yhyue.com/moapp/jypkg v0.0.0-20230117032631-52c9c8a3a91d/go.mod h1:dhbFYsUe0tyM+lnh5X4b3WcWowQsWgxOO50/dyHdEqs=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=
@@ -31,8 +31,8 @@ bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.4/go.mod h1:rRiGzKG4F/fmkN
 bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20220418072311-2062bed1e700/go.mod h1:KjcrxTzM96tBc6G4B8tlLBn1lrVy5UJYF8+eTdP4xAE=
 bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20220421015128-4a36f3eac5c5/go.mod h1:GT0QC4aaKDuXxAvaU4G02XjCc31TU1ctqBGqxQYOfC4=
 bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20220905055615-8540037e1b06/go.mod h1:LS21iwbgP8i3ZHJ1n4yNpLXQ/nzEudUOk0klC6VM2dQ=
-bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230109023014-2cd2a0b9b979 h1:hC97JNmBonTAsnDH4XMWLXVqWdo85tCo0ge04cy0e4E=
-bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230109023014-2cd2a0b9b979/go.mod h1:m7/aZ1r1FapNT2h3gqmCFVb0EV+CaJaNKNPHMzLHx8Y=
+bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230116052827-9b32b243b46f h1:sy6yPSBiLzKAxPZ6Oaw8NpYD82vFuz17F2YcI7gvx/8=
+bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230116052827-9b32b243b46f/go.mod h1:m7/aZ1r1FapNT2h3gqmCFVb0EV+CaJaNKNPHMzLHx8Y=
 cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=

+ 17 - 13
src/jfw/config/config.go

@@ -3,34 +3,36 @@ package config
 import (
 	util "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/mail"
+	"app.yhyue.com/moapp/jypkg/middleground"
 	"github.com/gogf/gf/v2/frame/g"
 	"github.com/gogf/gf/v2/os/gcfg"
+	"github.com/gogf/gf/v2/os/gctx"
 )
 
-//seo.josn 配置文件中的版本号,可以动态更新
-var Seoconfig_Version string
-
-var Sysconfig map[string]interface{}
-var Seoconfig map[string]interface{}
-var WeixinConfig map[string]interface{}
-var PhoneFilterConfig map[string]interface{}
-var Wxoauth, Wxoauthinfo string
-var ResourceApi ResourceApiConfig
+var (
+	//seo.josn 配置文件中的版本号,可以动态更新
+	Seoconfig_Version    string
+	Sysconfig            map[string]interface{}
+	Seoconfig            map[string]interface{}
+	WeixinConfig         map[string]interface{}
+	PhoneFilterConfig    map[string]interface{}
+	Wxoauth, Wxoauthinfo string
+	ResourceApi          ResourceApiConfig
+	GmailAuth            []*mail.GmailAuth
+	EntnichePcConf       *entnichePcConf
+	Middleground         *middleground.Middleground
+)
 
 type ResourceApiConfig struct {
 	HasPowers string // 获取我的所有权限api
 }
 
-var GmailAuth []*mail.GmailAuth
-
 type entnichePcConf struct {
 	EntnichePcUser   []int  `json:"entnichePcUser"`
 	HideEntnicheMenu []int  `json:"hideEntnicheMenu"`
 	PrivateDataPhone string `json:"privateDataPhone"`
 }
 
-var EntnichePcConf *entnichePcConf
-
 func init() {
 	g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("config.yaml")
 	util.ReadConfig(&Sysconfig)
@@ -63,4 +65,6 @@ func init() {
 		panic("未获取到资源中心配置")
 	}
 	ResourceApi.HasPowers = resourceCenter + util.ObjToString(resourceCenterUrl["haspowers"])
+	var ctx = gctx.New()
+	Middleground = middleground.NewMiddleground(g.Cfg().MustGet(ctx, "etcd.hosts").Strings(), g.Cfg().MustGet(ctx, "userCenterKey").String())
 }

+ 10 - 14
src/jfw/filter/filter.go

@@ -1,13 +1,12 @@
 package filter
 
 import (
+	. "jy/src/jfw/config"
 	"jy/src/jfw/jyutil"
 	"net/http"
 	"regexp"
 	"time"
 
-	. "jy/src/jfw/grpc"
-
 	util "app.yhyue.com/moapp/jybase/common"
 	fs "app.yhyue.com/moapp/jybase/fsnotify"
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
@@ -43,18 +42,15 @@ func (f *Filter) Do(w http.ResponseWriter, r *http.Request) bool {
 		session.Set("mgoUserId", getSession["userId"])
 	}
 	if getSession["base_user_id"] != nil && getSession["positionId"] == nil {
-		list := UserCenter.IdentityList(util.Int64All(getSession["base_user_id"]))
-		for i := len(list) - 1; i >= 0; i-- {
-			if list[i].PositionType == 0 {
-				session.SetMultiple(map[string]interface{}{
-					"personId":     list[i].PersonId,
-					"userName":     list[i].UserName,
-					"accountId":    list[i].AccountId,
-					"positionId":   list[i].PositionId,
-					"positionType": list[i].PositionType,
-				})
-				break
-			}
+		identity := Middleground.UserCenter.IdentityByUserId(util.Int64All(getSession["base_user_id"]))
+		if identity != nil {
+			session.SetMultiple(map[string]interface{}{
+				"personId":     identity.PersonId,
+				"userName":     identity.UserName,
+				"accountId":    identity.AccountId,
+				"positionId":   identity.PositionId,
+				"positionType": identity.PositionType,
+			})
 		}
 	}
 	if !(&logFilter{w, r, session, getSession, make(map[string]interface{})}).Do() {

+ 6 - 7
src/jfw/front/tags.go

@@ -3,25 +3,24 @@ package front
 import (
 	"fmt"
 	"jy/src/jfw/config"
+	"jy/src/jfw/jyutil"
 	"jy/src/jfw/paging"
 	"log"
 	"math"
 	"math/rand"
 	"net/http"
-	elastic "app.yhyue.com/moapp/jybase/esv1"
 	"strconv"
 	"strings"
 	"time"
-	"jy/src/jfw/jyutil"
-	"app.yhyue.com/moapp/jybase/encrypt"
-	"app.yhyue.com/moapp/jypkg/public"
+
 	qu "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
 	elastic "app.yhyue.com/moapp/jybase/esv1"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/bidsearch"
-	"app.yhyue.com/moapp/jybase/redis"
-	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/bidsearch"
+	"app.yhyue.com/moapp/jypkg/public"
 )
 
 //剑鱼标签页

+ 0 - 40
src/jfw/grpc/usercenter.go

@@ -1,40 +0,0 @@
-package grpc
-
-import (
-	"context"
-	"log"
-
-	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
-	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/usercenter"
-	"github.com/gogf/gf/v2/frame/g"
-	"github.com/gogf/gf/v2/os/gctx"
-	"github.com/zeromicro/go-zero/core/discov"
-	"github.com/zeromicro/go-zero/zrpc"
-)
-
-var UserCenter = &userCenter{}
-
-type userCenter struct{}
-
-func (u *userCenter) IdentityList(userId int64) []*pb.Identity {
-	var ctx = gctx.New()
-	client, err := zrpc.NewClient(zrpc.RpcClientConf{
-		Etcd: discov.EtcdConf{
-			Hosts: g.Cfg().MustGet(ctx, "etcd.hosts").Strings(),
-			Key:   g.Cfg().MustGet(ctx, "userCenterKey").String(),
-		},
-	})
-	if err != nil {
-		log.Println(err)
-		return nil
-	}
-	defer client.Conn().Close()
-	resp, err := usercenter.NewUserCenter(client).IdentityList(context.Background(), &pb.IdentityReq{
-		UserId: userId,
-	})
-	if err != nil {
-		log.Println(err)
-		return nil
-	}
-	return resp.Identitys
-}

+ 6 - 63
src/jfw/jyutil/jyutil.go

@@ -10,19 +10,14 @@ import (
 	"reflect"
 	"regexp"
 	"sort"
-
-	. "app.yhyue.com/moapp/jybase/mongodb"
+	"strings"
+	"time"
 
 	util "app.yhyue.com/moapp/jybase/common"
-
-	"app.yhyue.com/moapp/jybase/redis"
-
 	"app.yhyue.com/moapp/jybase/encrypt"
-	"app.yhyue.com/moapp/jybase/usercenter"
+	. "app.yhyue.com/moapp/jybase/mongodb"
+	"app.yhyue.com/moapp/jybase/redis"
 	"app.yhyue.com/moapp/jypkg/public"
-
-	"strings"
-	"time"
 )
 
 var mongodb = public.MQFW
@@ -95,6 +90,7 @@ func GetSessionVal(q map[string]interface{}) (*map[string]interface{}, map[strin
 		sessionVal["shareknow"] = (*person)["i_shareknow"]
 	}
 	sessionVal["userId"] = BsonIdToSId((*person)["_id"])
+	sessionVal["mgoUserId"] = sessionVal["userId"]
 	nickName, _ := (*person)["s_nickname"].(string)
 	phone := util.ObjToString((*person)["s_phone"])
 	if nickName == "" {
@@ -117,62 +113,9 @@ func GetSessionVal(q map[string]interface{}) (*map[string]interface{}, map[strin
 	if phone == "" {
 		phone = util.ObjToString((*person)["s_m_phone"])
 	}
-	if phone != "" {
-		//企业信息存session
-		sql := `SELECT a.id,a.name,a.startdate,a.enddate,a.quota,c.id as dept_id,b.id as user_id,b.name as user_name from entniche_info a 
-			INNER JOIN entniche_user b on (b.phone=? and a.id=b.ent_id) 
-			INNER JOIN entniche_department c on (c.pid=0 and a.id=c.ent_id) 
-			LEFT JOIN entniche_user_role d on (d.role_id=? and b.id=d.user_id)  
-			order by a.status DESC,b.power desc,a.auth_status DESC,d.role_id desc,a.createtime desc`
-		list := public.Mysql.SelectBySql(sql, phone, 1)
-		if list != nil {
-			for _, v := range *list {
-				if util.IntAll(v["id"]) == 0 {
-					break
-				}
-				sessionVal["entId"] = util.IntAll(v["id"])
-				sessionVal["entName"] = util.ObjToString(v["name"])
-				sessionVal["entUserId"] = util.IntAll(v["user_id"])
-				sessionVal["entUserName"] = util.ObjToString(v["user_name"])
-				sessionVal["frameworkEntId"] = util.IntAll(v["id"])
-				sessionVal["frameworkEntName"] = util.ObjToString(v["name"])
-				break
-			}
-		}
-	}
 	sessionVal["phone"] = phone
 	sessionVal["i_unlimited"] = util.IntAll((*person)["i_unlimited"])
-	base_uid := util.IntAllDef((*person)["base_user_id"], 0)
-	if base_uid != 0 {
-		sessionVal["base_user_id"] = base_uid //用户中台的uid
-		//
-		entId := util.Int64All(sessionVal["entId"])
-		uid := util.ObjToString(sessionVal["userId"])
-		identity := usercenter.GetUserIdentity(util.ObjToString(config.Sysconfig["userCenterApi"]), uid, int64(base_uid), entId, &http.Cookie{})
-		if identity != nil {
-			if identity.PersonId > 0 {
-				sessionVal["personId"] = identity.PersonId
-			}
-			if identity.UserName != "" {
-				sessionVal["userName"] = identity.UserName
-			}
-			if identity.UserAccountId > 0 {
-				sessionVal["userAccountId"] = identity.UserAccountId
-			}
-			if identity.EntAccountId > 0 {
-				sessionVal["entAccountId"] = identity.EntAccountId
-			}
-			if identity.EntUserAccountId > 0 {
-				sessionVal["entUserAccountId"] = identity.EntUserAccountId
-			}
-			if identity.UserPositionId > 0 {
-				sessionVal["userPositionId"] = identity.UserPositionId
-			}
-			if identity.EntUserPositionId > 0 {
-				sessionVal["entUserPositionId"] = identity.EntUserPositionId
-			}
-		}
-	}
+	sessionVal["base_user_id"] = util.IntAll((*person)["base_user_id"]) //用户中台的uid
 	return person, sessionVal
 }
 

+ 10 - 15
src/jfw/modules/app/src/app/filter/filter.go

@@ -1,15 +1,13 @@
 package filter
 
 import (
-	. "jy/src/jfw/modules/app/src/grpc"
+	. "jy/src/jfw/modules/app/src/jfw/config"
 	"net/http"
 	"regexp"
 	"time"
 
 	util "app.yhyue.com/moapp/jybase/common"
-
 	fs "app.yhyue.com/moapp/jybase/fsnotify"
-
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 )
 
@@ -43,18 +41,15 @@ func (f *Filter) Do(w http.ResponseWriter, r *http.Request) bool {
 		session.Set("mgoUserId", getSession["userId"])
 	}
 	if getSession["base_user_id"] != nil && getSession["positionId"] == nil {
-		list := UserCenter.IdentityList(util.Int64All(getSession["base_user_id"]))
-		for i := len(list) - 1; i >= 0; i-- {
-			if list[i].PositionType == 0 {
-				session.SetMultiple(map[string]interface{}{
-					"personId":     list[i].PersonId,
-					"userName":     list[i].UserName,
-					"accountId":    list[i].AccountId,
-					"positionId":   list[i].PositionId,
-					"positionType": list[i].PositionType,
-				})
-				break
-			}
+		identity := Middleground.UserCenter.IdentityByUserId(util.Int64All(getSession["base_user_id"]))
+		if identity != nil {
+			session.SetMultiple(map[string]interface{}{
+				"personId":     identity.PersonId,
+				"userName":     identity.UserName,
+				"accountId":    identity.AccountId,
+				"positionId":   identity.PositionId,
+				"positionType": identity.PositionType,
+			})
 		}
 	}
 	if !(&logFilter{w, r, getSession}).Do() {

+ 17 - 44
src/jfw/modules/app/src/app/front/login.go

@@ -985,7 +985,6 @@ func createSession(s *httpsession.Session, person map[string]interface{}, loginI
 		query := map[string]interface{}{
 			"i_appid": 2,
 		}
-		log.Println("~~~~~~~``", loginType, loginId)
 		switch loginType {
 		case 0: //_id登录
 			query["_id"], _ = primitive.ObjectIDFromHex(loginId)
@@ -1019,61 +1018,35 @@ func createSession(s *httpsession.Session, person map[string]interface{}, loginI
 		}
 		person = *data
 	}
-	s.Set("userId", BsonIdToSId(person["_id"]))
-	s.Set("s_jpushid", person["s_jpushid"])
-	s.Set("s_m_openid", person["s_m_openid"])
-	s.Set("s_opushid", person["s_opushid"])
-	s.Set("s_appponetype", person["s_appponetype"])
-	s.Set("s_appversion", person["s_appversion"])
-	s.Set("s_headimageurl", strings.Replace(qutil.ObjToString(person["s_headimageurl"]), "http://", "https://", 1))
-	s.Set("i_unlimited", qutil.IntAll(person["i_unlimited"]))
-	if base_userid := qutil.IntAllDef(person["base_user_id"], 0); base_userid != 0 {
-		s.Set("base_user_id", base_userid)
-		//
-		//
-		uid := BsonIdToSId(person["_id"])
-		identity := usercenter.GetUserIdentity(qutil.ObjToString(config.Sysconfig["userCenterApi"]), uid, int64(base_userid), 0, &http.Cookie{})
-		if identity != nil {
-			if identity.PersonId > 0 {
-				s.Set("personId", identity.PersonId)
-			}
-			if identity.UserName != "" {
-				s.Set("personId", identity.PersonId)
-			}
-			if identity.UserAccountId > 0 {
-				s.Set("userAccountId", identity.UserAccountId)
-			}
-			if identity.EntAccountId > 0 {
-				s.Set("entAccountId", identity.EntAccountId)
-			}
-			if identity.EntUserAccountId > 0 {
-				s.Set("entUserAccountId", identity.EntUserAccountId)
-			}
-			if identity.UserPositionId > 0 {
-				s.Set("userPositionId", identity.UserPositionId)
-			}
-			if identity.EntUserPositionId > 0 {
-				s.Set("entUserPositionId", identity.EntUserPositionId)
-			}
-		}
-	}
+	sessVal := map[string]interface{}{}
+	sessVal["userId"] = BsonIdToSId(person["_id"])
+	sessVal["mgoUserId"] = sessVal["userId"]
+	sessVal["s_jpushid"] = person["s_jpushid"]
+	sessVal["s_m_openid"] = person["s_m_openid"]
+	sessVal["s_opushid"] = person["s_opushid"]
+	sessVal["s_appponetype"] = person["s_appponetype"]
+	sessVal["s_appversion"] = person["s_appversion"]
+	sessVal["s_headimageurl"] = strings.Replace(qutil.ObjToString(person["s_headimageurl"]), "http://", "https://", 1)
+	sessVal["i_unlimited"] = qutil.IntAll(person["i_unlimited"])
+	sessVal["base_user_id"] = qutil.IntAll(person["base_user_id"])
 	if qutil.ObjToString(person["s_phone"]) != "" {
 		phone := person["s_phone"].(string)
-		s.Set("s_phone", phone)
+		sessVal["s_phone"] = phone
 		phone = string(phone[0:3]) + "****" + string(phone[len(phone)-4:])
-		s.Set("s_nickname", phone)
+		sessVal["s_nickname"] = phone
 	}
 	if qutil.ObjToString(person["s_m_phone"]) != "" {
 		s_m_phone := person["s_m_phone"].(string)
-		s.Set("s_m_phone", s_m_phone)
+		sessVal["s_m_phone"] = s_m_phone
 	}
 	if qutil.ObjToString(person["s_nickname"]) != "" {
-		s.Set("app_name", person["s_nickname"])
+		sessVal["app_name"] = person["s_nickname"]
 	}
 	// 剑鱼昵称
 	if qutil.ObjToString(person["s_jyname"]) != "" {
-		s.Set("s_jyname", person["s_jyname"])
+		sessVal["s_jyname"] = person["s_jyname"]
 	}
+	s.SetMultiple(sessVal)
 	//cookie
 	maxAge := int(time.Hour * 72 / time.Second) //3天,单位秒
 	expires := time.Now().Add(72 * time.Hour)

+ 12 - 12
src/jfw/modules/app/src/go.mod

@@ -4,13 +4,11 @@ go 1.18
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230110071808-0c8ff7f798c6
-	app.yhyue.com/moapp/jypkg v0.0.0-20230110072459-b8e28d30c98d
-	bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230109023014-2cd2a0b9b979
+	app.yhyue.com/moapp/jypkg v0.0.0-20230117032631-52c9c8a3a91d
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/dchest/captcha v1.0.0
 	github.com/gogf/gf/v2 v2.0.6
 	github.com/pkg/errors v0.9.1
-	github.com/zeromicro/go-zero v1.4.3
 	go.mongodb.org/mongo-driver v1.11.1
 )
 
@@ -18,6 +16,7 @@ require (
 	app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d // indirect
 	app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae // indirect
 	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230106052936-bd3ab7edf7a4 // indirect
+	bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230116052827-9b32b243b46f // indirect
 	github.com/BurntSushi/toml v0.4.1 // indirect
 	github.com/beorn7/perks v1.0.1 // indirect
 	github.com/cenkalti/backoff/v4 v4.1.3 // indirect
@@ -79,18 +78,19 @@ require (
 	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.3 // indirect
 	github.com/ziutek/blas v0.0.0-20190227122918-da4ca23e90bb // 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.opentelemetry.io/otel v1.10.0 // indirect
-	go.opentelemetry.io/otel/exporters/jaeger v1.10.0 // indirect
-	go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 // indirect
-	go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 // indirect
-	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 // indirect
-	go.opentelemetry.io/otel/exporters/zipkin v1.10.0 // indirect
-	go.opentelemetry.io/otel/sdk v1.10.0 // indirect
-	go.opentelemetry.io/otel/trace v1.10.0 // 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/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
@@ -100,7 +100,7 @@ require (
 	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-20220728004956-3c1f35247d10 // 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

+ 22 - 13
src/jfw/modules/app/src/go.sum

@@ -13,8 +13,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20220802080941-07f401baab8b/go.mod h1:HelrO6tc
 app.yhyue.com/moapp/jybase v0.0.0-20230109015757-aa3d5e19b196/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
 app.yhyue.com/moapp/jybase v0.0.0-20230110071808-0c8ff7f798c6 h1:Szt9G37MxAN5xJXGGS87EtMdIKoucilK5inP3zRLUIE=
 app.yhyue.com/moapp/jybase v0.0.0-20230110071808-0c8ff7f798c6/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
-app.yhyue.com/moapp/jypkg v0.0.0-20230110072459-b8e28d30c98d h1:N/71mg7rkJnKNtxVGji0xID2PdRt4BnAj7uKpjA3ZO0=
-app.yhyue.com/moapp/jypkg v0.0.0-20230110072459-b8e28d30c98d/go.mod h1:Arq5I8RsXJvV6i8K7f0ZG6MBt26MLhzuQswoU3SSqjc=
+app.yhyue.com/moapp/jypkg v0.0.0-20230117032631-52c9c8a3a91d h1:0T42jkxFtG3gt+C4qVBAnWbthaquaEIbPf0TJlDOa4w=
+app.yhyue.com/moapp/jypkg v0.0.0-20230117032631-52c9c8a3a91d/go.mod h1:dhbFYsUe0tyM+lnh5X4b3WcWowQsWgxOO50/dyHdEqs=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=
@@ -31,8 +31,8 @@ bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.4/go.mod h1:rRiGzKG4F/fmkN
 bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20220418072311-2062bed1e700/go.mod h1:KjcrxTzM96tBc6G4B8tlLBn1lrVy5UJYF8+eTdP4xAE=
 bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20220421015128-4a36f3eac5c5/go.mod h1:GT0QC4aaKDuXxAvaU4G02XjCc31TU1ctqBGqxQYOfC4=
 bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20220905055615-8540037e1b06/go.mod h1:LS21iwbgP8i3ZHJ1n4yNpLXQ/nzEudUOk0klC6VM2dQ=
-bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230109023014-2cd2a0b9b979 h1:hC97JNmBonTAsnDH4XMWLXVqWdo85tCo0ge04cy0e4E=
-bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230109023014-2cd2a0b9b979/go.mod h1:m7/aZ1r1FapNT2h3gqmCFVb0EV+CaJaNKNPHMzLHx8Y=
+bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230116052827-9b32b243b46f h1:sy6yPSBiLzKAxPZ6Oaw8NpYD82vFuz17F2YcI7gvx/8=
+bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230116052827-9b32b243b46f/go.mod h1:m7/aZ1r1FapNT2h3gqmCFVb0EV+CaJaNKNPHMzLHx8Y=
 cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=
@@ -1148,37 +1148,45 @@ go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVj
 go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk=
 go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM=
 go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo=
-go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4=
 go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ=
+go.opentelemetry.io/otel v1.11.0 h1:kfToEGMDq6TrVrJ9Vht84Y8y9enykSZzDDZglV0kIEk=
+go.opentelemetry.io/otel v1.11.0/go.mod h1:H2KtuEphyMvlhZ+F7tg9GRhAOe60moNx61Ex+WmiKkk=
 go.opentelemetry.io/otel/exporters/jaeger v1.3.0/go.mod h1:KoYHi1BtkUPncGSRtCe/eh1ijsnePhSkxwzz07vU0Fc=
 go.opentelemetry.io/otel/exporters/jaeger v1.8.0/go.mod h1:GbWg+ng88rDtx+id26C34QLqw2erqJeAjsCx9AFeHfE=
 go.opentelemetry.io/otel/exporters/jaeger v1.9.0/go.mod h1:hquezOLVAybNW6vanIxkdLXTXvzlj2Vn3wevSP15RYs=
-go.opentelemetry.io/otel/exporters/jaeger v1.10.0 h1:7W3aVVjEYayu/GOqOVF4mbTvnCuxF1wWu3eRxFGQXvw=
 go.opentelemetry.io/otel/exporters/jaeger v1.10.0/go.mod h1:n9IGyx0fgyXXZ/i0foLHNxtET9CzXHzZeKCucvRBFgA=
-go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 h1:TaB+1rQhddO1sF71MpZOZAuSPW1klK2M8XxfrBMfK7Y=
+go.opentelemetry.io/otel/exporters/jaeger v1.11.0 h1:Sv2valcFfMlfu6g8USSS+ZUN5vwbuGj1aY/CFtMG33w=
+go.opentelemetry.io/otel/exporters/jaeger v1.11.0/go.mod h1:nRgyJbgJ0hmaUdHwyDpTTfBYz61cTTeeGhVzfQc+FsI=
 go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0/go.mod h1:78XhIg8Ht9vR4tbLNUhXsiOnE2HOuSeKAiAcoVQEpOY=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 h1:pDDYmo0QadUPal5fwXoY1pmMpFcdyhXOmL5drCrI3vU=
+go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.0 h1:0dly5et1i/6Th3WHn0M6kYiJfFNzhhxanrJ0bOfnjEo=
+go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.0/go.mod h1:+Lq4/WkdCkjbGcBMVHHg2apTbv8oMBf29QCnyCCJjNQ=
 go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0/go.mod h1:Krqnjl22jUJ0HgMzw5eveuCvFDXY4nSYb4F8t5gdrag=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 h1:KtiUEhQmj/Pa874bVYKGNVdq8NPKiacPbaRRtgXi+t4=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.0 h1:eyJ6njZmH16h9dOKCi7lMswAnGsSOwgTqWzfxqcuNr8=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.0/go.mod h1:FnDp7XemjN3oZ3xGunnfOUTVwd2XcvLbtRAuOSU3oc8=
 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0/go.mod h1:OfUCyyIiDvNXHWpcWgbF+MWvqPZiNa3YDEnivcnYsV0=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.0 h1:j2RFV0Qdt38XQ2Jvi4WIsQ56w8T7eSirYbMw19VXRDg=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.0/go.mod h1:pILgiTEtrqvZpoiuGdblDgS5dbIaTgDrkIuKfEFkt+A=
 go.opentelemetry.io/otel/exporters/zipkin v1.3.0/go.mod h1:LxGGfHIYbvsFnrJtBcazb0yG24xHdDGrT/H6RB9r3+8=
 go.opentelemetry.io/otel/exporters/zipkin v1.8.0/go.mod h1:0uYAyCuGT67MFV9Z/Mmx93wGuugHw0FbxMc74fs3LNo=
 go.opentelemetry.io/otel/exporters/zipkin v1.9.0/go.mod h1:HyIvYIu37wV4Wx5azd7e05x9k/dOz9KB4x0plw2QNvs=
-go.opentelemetry.io/otel/exporters/zipkin v1.10.0 h1:HcPAFsFpEBKF+G5NIOA+gBsxifd3Ej+wb+KsdBLa15E=
 go.opentelemetry.io/otel/exporters/zipkin v1.10.0/go.mod h1:HdfvgwcOoCB0+zzrTHycW6btjK0zNpkz2oTGO815SCI=
+go.opentelemetry.io/otel/exporters/zipkin v1.11.0 h1:v/Abo5REOWrCj4zcEIUHFZtXpsCVjrwZj28iyX2rHXE=
+go.opentelemetry.io/otel/exporters/zipkin v1.11.0/go.mod h1:unWnsLCMYfINP8ue0aXVrB/GYHoXNn/lbTnupvLekGQ=
 go.opentelemetry.io/otel/sdk v1.0.0/go.mod h1:PCrDHlSy5x1kjezSdL37PhbFUMjrsLRshJ2zCzeXwbM=
 go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs=
 go.opentelemetry.io/otel/sdk v1.8.0/go.mod h1:uPSfc+yfDH2StDM/Rm35WE8gXSNdvCg023J6HeGNO0c=
 go.opentelemetry.io/otel/sdk v1.9.0/go.mod h1:AEZc8nt5bd2F7BC24J5R0mrjYnpEgYHyTcM/vrSple4=
-go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY=
 go.opentelemetry.io/otel/sdk v1.10.0/go.mod h1:vO06iKzD5baltJz1zarxMCNHFpUlUiOy4s65ECtn6kE=
+go.opentelemetry.io/otel/sdk v1.11.0 h1:ZnKIL9V9Ztaq+ME43IUi/eo22mNsb6a7tGfzaOWB5fo=
+go.opentelemetry.io/otel/sdk v1.11.0/go.mod h1:REusa8RsyKaq0OlyangWXaw97t2VogoO4SSEeKkSTAk=
 go.opentelemetry.io/otel/trace v1.0.0/go.mod h1:PXTWqayeFUlJV1YDNhsJYB184+IvAH814St6o6ajzIs=
 go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk=
 go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU=
 go.opentelemetry.io/otel/trace v1.8.0/go.mod h1:0Bt3PXY8w+3pheS3hQUt+wow8b1ojPaTBoTCh2zIFI4=
 go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo=
-go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E=
 go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM=
+go.opentelemetry.io/otel/trace v1.11.0 h1:20U/Vj42SX+mASlXLmSGBg6jpI1jQtv682lZtTAOVFI=
+go.opentelemetry.io/otel/trace v1.11.0/go.mod h1:nyYjis9jy0gytE9LXGU+/m1sHTKbRY0fX0hulNNDP1U=
 go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
 go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw=
 go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
@@ -1462,8 +1470,9 @@ golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg=
 golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc=
+golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=

+ 0 - 40
src/jfw/modules/app/src/grpc/usercenter.go

@@ -1,40 +0,0 @@
-package grpc
-
-import (
-	"context"
-	"log"
-
-	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
-	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/usercenter"
-	"github.com/gogf/gf/v2/frame/g"
-	"github.com/gogf/gf/v2/os/gctx"
-	"github.com/zeromicro/go-zero/core/discov"
-	"github.com/zeromicro/go-zero/zrpc"
-)
-
-var UserCenter = &userCenter{}
-
-type userCenter struct{}
-
-func (u *userCenter) IdentityList(userId int64) []*pb.Identity {
-	var ctx = gctx.New()
-	client, err := zrpc.NewClient(zrpc.RpcClientConf{
-		Etcd: discov.EtcdConf{
-			Hosts: g.Cfg().MustGet(ctx, "etcd.hosts").Strings(),
-			Key:   g.Cfg().MustGet(ctx, "userCenterKey").String(),
-		},
-	})
-	if err != nil {
-		log.Println(err)
-		return nil
-	}
-	defer client.Conn().Close()
-	resp, err := usercenter.NewUserCenter(client).IdentityList(context.Background(), &pb.IdentityReq{
-		UserId: userId,
-	})
-	if err != nil {
-		log.Println(err)
-		return nil
-	}
-	return resp.Identitys
-}

+ 19 - 12
src/jfw/modules/app/src/jfw/config/config.go

@@ -3,22 +3,27 @@ package config
 import (
 	util "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/mail"
+	"app.yhyue.com/moapp/jypkg/middleground"
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gcfg"
+	"github.com/gogf/gf/v2/os/gctx"
 )
 
-// Seoconfig_Version seo.josn 配置文件中的版本号,可以动态更新
-var Seoconfig_Version string
-
-// Seoconfig_Mod_Version Seoconfig_Version 作为固定版本号 除非大版本更新需要改动,其他都更改Seoconfig_Mod_Version  王山  2020/06/11
-var Seoconfig_Mod_Version string
-
-var Seoconfig_Cdns map[string]interface{}
-var Sysconfig map[string]interface{}
-var PhoneFilterConfig map[string]interface{}
-var Seoconfig map[string]interface{}
-
-var GmailAuth []*mail.GmailAuth
+var (
+	// Seoconfig_Version seo.josn 配置文件中的版本号,可以动态更新
+	Seoconfig_Version string
+	// Seoconfig_Mod_Version Seoconfig_Version 作为固定版本号 除非大版本更新需要改动,其他都更改Seoconfig_Mod_Version  王山  2020/06/11
+	Seoconfig_Mod_Version string
+	Seoconfig_Cdns        map[string]interface{}
+	Sysconfig             map[string]interface{}
+	PhoneFilterConfig     map[string]interface{}
+	Seoconfig             map[string]interface{}
+	GmailAuth             []*mail.GmailAuth
+	Middleground          *middleground.Middleground
+)
 
 func init() {
+	g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("config.yaml")
 	util.ReadConfig(&Sysconfig)
 	mails, _ := Sysconfig["mail"].([]interface{})
 	mailConfigArrMap := util.ObjArrToMapArr(mails)
@@ -33,4 +38,6 @@ func init() {
 		}
 		GmailAuth = append(GmailAuth, mailConf)
 	}
+	var ctx = gctx.New()
+	Middleground = middleground.NewMiddleground(g.Cfg().MustGet(ctx, "etcd.hosts").Strings(), g.Cfg().MustGet(ctx, "userCenterKey").String())
 }

+ 0 - 341
src/jfw/modules/common/src/qfw/util/jy/bigVipPower.go

@@ -1,341 +0,0 @@
-package jy
-
-import (
-	"encoding/json"
-	"fmt"
-	"log"
-	"math/rand"
-	. "mongodb"
-	qutil "qfw/util"
-	"qfw/util/mysql"
-	"qfw/util/redis"
-	"strings"
-	"time"
-)
-
-// 大会员状态redis缓存
-type BigVipBaseMsg struct {
-	Status          int                    `json:"status"`          //大会员状态
-	Used            bool                   `json:"used"`            //是否首次使用大会员
-	PowerMap        map[int]bool           `json:"p_map"`           //权限列表
-	ProNum          int                    `json:"p_num"`           //可关注项目数量
-	EntNum          int                    `json:"e_num"`           //可关注企业数量(取企业情报监控和企业中标动态中最大的值)
-	DailyNum        int                    `json:"d_num"`           //数据包导出数量
-	Pid             string                 `json:"pid"`             //若为子账号此处为父节点userid
-	Uid             string                 `json:"uid"`             //用户id
-	HasTrial        bool                   `json:"has_trial"`       //是否试用过
-	Customers       int                    `json:"customers"`       //可关注客户数量
-	VipStatus       int                    `json:"vip_status"`      //超级订阅状态
-	Vip_BuySet      BuySet                 `json:"vip_buyset"`      //超级订阅套餐内容
-	EntnicheStatus  int                    `json:"entniche_status"` //商机管理状态
-	IsUpgrade       bool                   `json:"isUpgrade"`       //是否是免费用户订阅升级用户 默认true
-	Registedate     int64                  `json:"registedate"`     //用户注册时间
-	EntName         string                 `json:"entname"`         //企业名称
-	EntIsNew        bool                   `json:"entIsNew"`        //是否是新版商机管理用户
-	IsEntService    bool                   `json:"isEntService"`    //是否有商机管理服务
-	PrivateGD       bool                   `json:"PrivateGD"`       //广东移动DICT 用户
-	Email           string                 `json:"email"`
-	EntInfo         map[int]*EntInfoStruct `json:"entInfo"`         //企业信息
-	MemberPowerType int64                  `json:"memberPowerType"` //大会员权益类型 0无 1个人 2企业
-	VipPowerType    int64                  `json:"vipPowerType"`    //超级订阅权益类型 0无 1个人 2企业
-	BaseUserId      int                    `json:"base_user_id"`    //用户base_user_id
-}
-
-type EntInfoStruct struct {
-	IsNew     bool   `json:"isNew"`     //是否是新版商机管理
-	IsPower   bool   `json:"isPower"`   //是否分配了商机管理权限
-	Status    int    `json:"status"`    //是否购买
-	Name      string `json:"name"`      //企业名称
-	IsService bool   `json:"isService"` //企业商机管理服务
-	RoleId    int    `json:"roleId"`    //角色默认0:员工; 1:系统(企业)管理员;2:部门管理员
-}
-
-// 超级订阅购买内容
-type BuySet struct {
-	Upgrade         int `json:"upgrade"`         //是否是升级版;1是 其他不是
-	AreaCount       int `json:"areacount"`       //省份数量
-	BuyerclassCount int `json:"buyerclasscount"` //行业数
-}
-
-var FrontService, BackService map[string][]int
-
-const (
-	IsNewFreeTimeCell       = 1637830020
-	BigmemberServiceTable   = "bigmember_service"
-	BigmemberUserPowerTable = "bigmember_service_user"
-
-	PowerCacheDb              = "other"
-	PowerCacheKey             = "bigmember_power_3_%s"
-	OneDay                    = 60 * 60 * 24
-	UserUpdateAreaKey         = "free_area_num_%s_%s"
-	BaseAreaNum               = 1
-	VipFileUploadNumKey       = "vip_file_num_%s_%s"  //超级订阅附件本月一下载次数 %s:userid ; %s:当前月份-fmt.Sprint(time.Now().Month())
-	FilePackNumKey            = "file_pack_num_%s_%s" //附件下载包本月  剩余次数  %s:userid   %s 当前月份-fmt.Sprint(time.Now().Month())
-	BaseInfoCacheDb           = "newother"
-	IsGetUserBaseInfoRedisKey = "baseinfo_%s"
-	RedisMenuKeyPC            = "jy_workdesktopmenu_10000_PC_%s"  //剑鱼appid:10000
-	RedisMenuKeyWX            = "jy_workdesktopmenu_10000_WX_%s"  //剑鱼appid:10000
-	RedisMenuKeyAPP           = "jy_workdesktopmenu_10000_APP_%s" //剑鱼appid:10000
-	UserPowerRedisKey         = "jy_userpowerredis_10000_%d_%s"   //工作桌面 用户功能缓存(类似bigmember_power_3_%s)
-)
-
-// 初始化大会员权益
-func InitBigVipService(mysql *mysql.Mysql) {
-	serviceList := mysql.Find(BigmemberServiceTable, nil, "id,s_url_front,s_url_back", "id", -1, -1)
-	if serviceList == nil || len(*serviceList) == 0 {
-		panic(fmt.Sprintf("大会员初始权限失败,请检查mysql链接是否正常、查看%s表是否正常", BigmemberServiceTable))
-	}
-	FrontService, BackService = make(map[string][]int), make(map[string][]int)
-	for _, one := range *serviceList {
-		power := qutil.ObjToMap(one)
-		if power == nil {
-			continue
-		}
-		serviceId := qutil.IntAll((*power)["id"])
-		if urlFronts := qutil.ObjToString((*power)["s_url_front"]); urlFronts != "" {
-			for _, urlFront := range strings.Split(urlFronts, "&") {
-				FrontService[urlFront] = append(FrontService[urlFront], serviceId)
-			}
-		}
-
-		if urlBacks := qutil.ObjToString((*power)["s_url_back"]); urlBacks != "" {
-			for _, urlBack := range strings.Split(urlBacks, "&") {
-				BackService[urlBack] = append(BackService[urlBack], serviceId)
-			}
-		}
-	}
-	log.Printf("init BigVipService status \nFrontService:%+v\nBackService:%+v\n", FrontService, BackService)
-}
-
-// 当大会员状态改变时清除此状态
-func ClearBigVipUserPower(userId string) bool {
-	cacheKey := fmt.Sprintf(PowerCacheKey, userId)
-	baseInfoCacheKey := fmt.Sprintf(IsGetUserBaseInfoRedisKey, userId)
-	redisMenuKeyPC := fmt.Sprintf(RedisMenuKeyPC, userId)
-	redisMenuKeyWX := fmt.Sprintf(RedisMenuKeyWX, userId)
-	redisMenuKeyAPP := fmt.Sprintf(RedisMenuKeyAPP, userId)
-	userPowerRedisKey := fmt.Sprintf(UserPowerRedisKey, time.Now().Day(), userId)
-	return redis.Del(BaseInfoCacheDb, cacheKey) && redis.Del(BaseInfoCacheDb, baseInfoCacheKey) && redis.Del(BaseInfoCacheDb, redisMenuKeyPC) && redis.Del(BaseInfoCacheDb, redisMenuKeyWX) && redis.Del(BaseInfoCacheDb, redisMenuKeyAPP) && redis.Del(BaseInfoCacheDb, userPowerRedisKey)
-}
-
-// 获取商机管理个人基本信息
-func GetEntnicheState(userId string, mysql *mysql.Mysql, mg MongodbSim) *BigVipBaseMsg {
-	userPower := BigVipBaseMsg{}
-	userPower.EntnicheStatus = 0
-	//手机号
-	data, ok := mg.FindById("user", userId, `{"s_phone":1,"s_m_phone":1,i_member_status":1,"i_member_give":1,"s_member_mainid":1,"i_member_sub_status":1,"i_member_trial":1,"i_vip_status":1,"o_vipjy":1,"o_jy":1,"l_registedate":1}`)
-	if ok && *data != nil && len(*data) > 0 {
-		//查询是否是商机管理付费用户
-		phone, _ := qutil.If((*data)["s_phone"] != nil, (*data)["s_phone"], (*data)["s_m_phone"]).(string)
-		if phone != "" {
-			if count := mysql.CountBySql(`SELECT count(1) FROM entniche_user u LEFT JOIN entniche_info i ON u.ent_id=i.id WHERE u.phone=? and u.power=1 and i.status=1`, phone); count > 0 {
-				userPower.EntnicheStatus = 1
-			}
-		}
-	}
-	return &userPower
-}
-
-// 获取大会员个人基本信息
-func GetBigVipUserBaseMsg(userId string, mysql *mysql.Mysql, mg MongodbSim) *BigVipBaseMsg {
-	userPower := BigVipBaseMsg{}
-	userPower.PowerMap = make(map[int]bool)
-	if userId == "" {
-		return &userPower
-	}
-	userPower.IsUpgrade = false
-	userPower.Uid = userId
-	cacheKey := fmt.Sprintf(PowerCacheKey, userId)
-
-	if bytes, err := redis.GetBytes(BaseInfoCacheDb, cacheKey); err == nil && bytes != nil {
-		if err := json.Unmarshal(*bytes, &userPower); err == nil {
-			return &userPower
-		}
-	}
-	//大会员状态
-	data, ok := mg.FindById("user", userId, `{"s_phone":1,"s_m_phone":1,i_member_status":1,"i_member_give":1,"s_member_mainid":1,"i_member_sub_status":1,"i_member_trial":1,"i_vip_status":1,"o_vipjy":1,"o_jy":1,"l_registedate":1,"s_myemail":1,"base_user_id":1}`)
-	if ok && *data != nil && len(*data) > 0 {
-		userPower.Email = qutil.ObjToString((*data)["s_myemail"])
-		userPower.BaseUserId = qutil.IntAll((*data)["base_user_id"])
-		userPower.Registedate = qutil.Int64All((*data)["l_registedate"])
-		userPower.Status = qutil.IntAllDef((*data)["i_member_status"], 0)
-		//子账号被启用
-		i_member_sub_status := qutil.IntAllDef((*data)["i_member_sub_status"], 0)
-		if (*data)["s_member_mainid"] != nil && qutil.ObjToString((*data)["s_member_mainid"]) != "" && i_member_sub_status > 0 {
-			userPower.Pid = qutil.ObjToString((*data)["s_member_mainid"])
-		}
-		if (userPower.Pid != "" && qutil.IntAllDef((*data)["i_member_sub_status"], 0) == 1) || mg.Count("member", map[string]interface{}{"userid": userId}) > 0 {
-			userPower.Used = true
-		}
-		if (*data)["i_member_trial"] != nil {
-			userPower.HasTrial = true
-		}
-		if vipStatus := qutil.IntAll((*data)["i_vip_status"]); vipStatus > 0 {
-			userPower.VipStatus = vipStatus
-			if o_vipjy := qutil.ObjToMap((*data)["o_vipjy"]); o_vipjy != nil {
-				if o_buyset := qutil.ObjToMap((*o_vipjy)["o_buyset"]); o_buyset != nil {
-					userPower.Vip_BuySet = BuySet{
-						Upgrade:         qutil.IntAll((*o_buyset)["upgrade"]),
-						AreaCount:       qutil.IntAll((*o_buyset)["areacount"]),
-						BuyerclassCount: qutil.IntAll((*o_buyset)["buyerclasscount"]),
-					}
-				}
-			}
-			userPower.VipPowerType = 1
-		}
-		if userPower.Status > 0 {
-			userPower.MemberPowerType = 1
-		}
-		//免费用户画像和附件下载权限
-		//if userPower.Status <= 0 && userPower.VipStatus <= 0 {
-		o_jy := qutil.ObjToMap((*data)["o_jy"])
-		//"i_newfree":    1, //新免费用户=>新订阅设置页面 20211122
-		//IsNewFreeTimeCell dev3.6.4版本之前发了个紧急版本处理老用户订阅问题,i_newfree字段必须用户选择地区才能生成,不能作为判断是否是新用户得唯一标识,在此版本添加了常量:IsNewFreeTimeCell作为判断标准;--ws
-		if qutil.IntAll((*o_jy)["i_newfree"]) > 0 || IsNewFreeTimeCell < userPower.Registedate {
-			userPower.IsUpgrade = true
-		}
-		//}
-		//查询是否是商机管理付费用户
-		//userPower.EntnicheStatus = 0
-		phone, _ := qutil.If((*data)["s_phone"] != nil, (*data)["s_phone"], (*data)["s_m_phone"]).(string)
-		if phone != "" {
-			res := mysql.SelectBySql(`SELECT i. STATUS AS status, i.isNew, i.power_source, r.role_id, u.power, i.name,i.id FROM (entniche_user u LEFT JOIN entniche_user_role r ON r.user_id = u.id ) LEFT JOIN entniche_info i ON u.ent_id = i.id WHERE u.phone = ? ORDER BY i. STATUS DESC, i.auth_status DESC`, phone)
-			if res != nil && len(*res) > 0 {
-				userPower.EntInfo = map[int]*EntInfoStruct{}
-				//商机管理
-				userPower.EntName = qutil.ObjToString((*res)[0]["name"])
-				//已购买企业未过期-商机管理用户
-				for _, v := range *res {
-					if qutil.IntAll(v["id"]) == 0 {
-						continue
-					}
-					entId := qutil.IntAll(v["id"])
-					userPower.EntInfo[entId] = &EntInfoStruct{
-						IsNew:     qutil.IntAll(v["isNew"]) > 0,
-						IsPower:   qutil.IntAll(v["power"]) > 0,
-						Status:    qutil.IntAll(v["status"]),
-						Name:      qutil.ObjToString(v["name"]),
-						IsService: qutil.IntAll(v["power_source"]) > 0,
-						RoleId:    qutil.IntAll(v["role_id"]),
-					}
-					// 判断是否是新商机管理
-					if qutil.IntAll(v["status"]) == 1 && qutil.IntAll(v["power"]) == 1 {
-						userPower.EntnicheStatus = 1
-						if qutil.IntAll(v["isNew"]) == 1 {
-							userPower.EntIsNew = true
-							// if userPower.EntIsNew && userPower.IsEntService {
-							// 	break
-							// }
-						}
-					}
-					// 判断是否是商机管理服务 (在超级订阅或者大会员、医械通(暂无)的基础上才会有的)
-					// if qutil.IntAll(v["power_source"]) == 1 {
-					// 	userPower.IsEntService = true
-					// 	break
-					// }
-
-				}
-			}
-			// 如果是商机管理服务用户,则不能是旧版商机管理及新版商机管理
-			// if userPower.IsEntService {
-			// 	userPower.EntnicheStatus = 0 // 商机管理状态
-			// 	userPower.EntIsNew = false   // 新版商机管理
-			// }
-			//if count := mysql.CountBySql(`SELECT count(1) FROM entniche_user u LEFT JOIN entniche_info i ON u.ent_id=i.id WHERE u.phone=? and u.power=1 and i.status=1`, phone); count > 0 {
-			//	userPower.EntnicheStatus = 1
-			//}
-			//广东移动DICT 用户
-			userPower.PrivateGD = mysql.CountBySql(`select count(1) from privatedata where phone = ?`, phone) > 0
-
-			//用于判断是否含有企业主体的超级订阅、大会员服务
-			epowerData := mysql.SelectBySql(`SELECT c.product_type FROM entniche_user a INNER JOIN entniche_power b
-		 									INNER JOIN entniche_wait_empower c
-		 									ON a.id =b.ent_user_id  AND c.id = b.wait_empower_id WHERE a.phone =? AND c.end_time >?`, phone, time.Now().Format(qutil.Date_Full_Layout))
-			if epowerData != nil && len(*epowerData) > 0 {
-				for _, v := range *epowerData {
-					product_type := qutil.ObjToString(v["product_type"])
-					if strings.Contains(product_type, "VIP订阅") {
-						userPower.VipPowerType = 2
-					} else if strings.Contains(product_type, "大会员") {
-						userPower.MemberPowerType = 2
-					}
-				}
-			}
-		}
-	}
-
-	//子账号查询父节点权限
-	queryId := qutil.If(userPower.Pid == "", userId, userPower.Pid).(string)
-	//用户购买的服务
-	serviceList := mysql.Find(BigmemberUserPowerTable, map[string]interface{}{"s_userid": queryId, "i_status": 0}, "DISTINCT(s_serviceid),i_frequency", "", -1, -1)
-	if serviceList != nil && len(*serviceList) != 0 {
-		pCount, eCount, dailyNum, customers := 0, 0, 0, 10
-		for _, item := range *serviceList {
-			serviceid := qutil.IntAll(item["s_serviceid"])
-			userPower.PowerMap[serviceid] = true
-			if serviceid == 14 { //项目数量
-				pCount = qutil.IntAll(item["i_frequency"])
-			} else if serviceid == 4 || serviceid == 12 || serviceid == 13 { //企业情报监控 企业中标动态
-				tEcount := qutil.IntAll(item["i_frequency"])
-				if tEcount > eCount {
-					eCount = tEcount
-				}
-			} else if serviceid == 17 || serviceid == 18 { //每日数据包
-				dailyNum = qutil.IntAll(item["i_frequency"])
-			} else if serviceid == 7 { //潜在客户 关注客户
-				customers = qutil.IntAll(item["i_frequency"])
-			}
-		}
-		userPower.EntNum = eCount
-		userPower.ProNum = pCount
-		userPower.DailyNum = dailyNum
-		userPower.Customers = customers
-	}
-
-	//存储缓存
-	go func() {
-		if bytes, err := json.Marshal(userPower); err == nil && bytes != nil {
-			oneDayMore := OneDay + rand.Intn(60*60)
-			_ = redis.PutBytes(BaseInfoCacheDb, cacheKey, &bytes, oneDayMore)
-		}
-	}()
-	return &userPower
-}
-
-// 权限判断
-func (this *BigVipBaseMsg) CheckBigVipFrontPower(reqFlag string) (pass bool) {
-	if reqFlag == "ent_portrait" || reqFlag == "unit_portrayal" { //画像页面无权限控制
-		return true
-	}
-	if this.Vip_BuySet.Upgrade == 1 {
-		if reqFlag == "ent_portrait" || reqFlag == "svip" {
-			return true
-		}
-	}
-	return this.checkPower(reqFlag, FrontService)
-}
-
-func (this *BigVipBaseMsg) CheckBigVipBackPower(reqFlag string) (pass bool) {
-	return this.checkPower(reqFlag, BackService)
-}
-
-func (this *BigVipBaseMsg) checkPower(reqFlag string, servicesPower map[string][]int) bool {
-	powers, ok := servicesPower[reqFlag]
-	if !ok {
-		return false
-	}
-	for _, p := range powers {
-		if this.PowerMap[p] {
-			return true
-		}
-	}
-
-	return false
-}
-
-func (this *BigVipBaseMsg) GetUseId() string {
-	if this.Pid != "" {
-		return this.Pid
-	}
-	return this.Uid
-}

+ 12 - 6
src/jfw/modules/publicapply/src/config/config.go

@@ -2,8 +2,10 @@ package config
 
 import (
 	qutil "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jypkg/middleground"
 	"github.com/gogf/gf/v2/frame/g"
 	"github.com/gogf/gf/v2/os/gcfg"
+	"github.com/gogf/gf/v2/os/gctx"
 )
 
 type config struct {
@@ -14,8 +16,7 @@ type config struct {
 		Pwd  string
 		User string
 	}
-	Industry string
-
+	Industry              string
 	Frequency             string
 	HotWords              []string
 	DefaultEntList        []string //企业查询默认展示企业
@@ -62,10 +63,13 @@ type ShareF struct {
 	MayActive  string //活动标识
 }
 
-var Config *config
-var BidCollConfig *BidColl
-var AdLeaguefig *AdLeague
-var ShareConfig *ShareF
+var (
+	Config        *config
+	BidCollConfig *BidColl
+	AdLeaguefig   *AdLeague
+	ShareConfig   *ShareF
+	Middleground  *middleground.Middleground
+)
 
 func init() {
 	g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("config.yaml")
@@ -74,4 +78,6 @@ func init() {
 	qutil.ReadConfig("./bidcollection.json", &BidCollConfig)
 	qutil.ReadConfig("./adLeague.json", &AdLeaguefig)
 	qutil.ReadConfig("./shareFission.json", &ShareConfig)
+	var ctx = gctx.New()
+	Middleground = middleground.NewMiddleground(g.Cfg().MustGet(ctx, "etcd.hosts").Strings(), g.Cfg().MustGet(ctx, "userCenterKey").String())
 }

+ 10 - 13
src/jfw/modules/publicapply/src/filter/sessionfilter.go

@@ -1,7 +1,7 @@
 package filter
 
 import (
-	. "jy/src/jfw/modules/publicapply/src/grpc"
+	. "jy/src/jfw/modules/publicapply/src/config"
 	"net/http"
 	"regexp"
 
@@ -26,18 +26,15 @@ func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
 		session.Set("mgoUserId", getSession["userId"])
 	}
 	if getSession["base_user_id"] != nil && getSession["positionId"] == nil {
-		list := UserCenter.IdentityList(util.Int64All(getSession["base_user_id"]))
-		for i := len(list) - 1; i >= 0; i-- {
-			if list[i].PositionType == 0 {
-				session.SetMultiple(map[string]interface{}{
-					"personId":     list[i].PersonId,
-					"userName":     list[i].UserName,
-					"accountId":    list[i].AccountId,
-					"positionId":   list[i].PositionId,
-					"positionType": list[i].PositionType,
-				})
-				break
-			}
+		identity := Middleground.UserCenter.IdentityByUserId(util.Int64All(getSession["base_user_id"]))
+		if identity != nil {
+			session.SetMultiple(map[string]interface{}{
+				"personId":     identity.PersonId,
+				"userName":     identity.UserName,
+				"accountId":    identity.AccountId,
+				"positionId":   identity.PositionId,
+				"positionType": identity.PositionType,
+			})
 		}
 	}
 	if reg.MatchString(req.URL.Path) || reg.MatchString(req.URL.Path) || reg_share.MatchString(req.URL.Path) || reg_nps.MatchString(req.URL.Path) {

+ 3 - 3
src/jfw/modules/publicapply/src/go.mod

@@ -4,11 +4,9 @@ go 1.18
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230110071808-0c8ff7f798c6
-	app.yhyue.com/moapp/jypkg v0.0.0-20230110072459-b8e28d30c98d
-	bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230109023014-2cd2a0b9b979
+	app.yhyue.com/moapp/jypkg v0.0.0-20230117032631-52c9c8a3a91d
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/gogf/gf/v2 v2.2.6
-	github.com/zeromicro/go-zero v1.4.3
 	go.mongodb.org/mongo-driver v1.11.1
 )
 
@@ -16,6 +14,7 @@ require (
 	app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d // indirect
 	app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae // indirect
 	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230106052936-bd3ab7edf7a4 // indirect
+	bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230116052827-9b32b243b46f // indirect
 	github.com/BurntSushi/toml v1.1.0 // indirect
 	github.com/beorn7/perks v1.0.1 // indirect
 	github.com/cenkalti/backoff/v4 v4.1.3 // indirect
@@ -78,6 +77,7 @@ require (
 	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.3 // 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

+ 4 - 4
src/jfw/modules/publicapply/src/go.sum

@@ -13,8 +13,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20220802080941-07f401baab8b/go.mod h1:HelrO6tc
 app.yhyue.com/moapp/jybase v0.0.0-20230109015757-aa3d5e19b196/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
 app.yhyue.com/moapp/jybase v0.0.0-20230110071808-0c8ff7f798c6 h1:Szt9G37MxAN5xJXGGS87EtMdIKoucilK5inP3zRLUIE=
 app.yhyue.com/moapp/jybase v0.0.0-20230110071808-0c8ff7f798c6/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
-app.yhyue.com/moapp/jypkg v0.0.0-20230110072459-b8e28d30c98d h1:N/71mg7rkJnKNtxVGji0xID2PdRt4BnAj7uKpjA3ZO0=
-app.yhyue.com/moapp/jypkg v0.0.0-20230110072459-b8e28d30c98d/go.mod h1:Arq5I8RsXJvV6i8K7f0ZG6MBt26MLhzuQswoU3SSqjc=
+app.yhyue.com/moapp/jypkg v0.0.0-20230117032631-52c9c8a3a91d h1:0T42jkxFtG3gt+C4qVBAnWbthaquaEIbPf0TJlDOa4w=
+app.yhyue.com/moapp/jypkg v0.0.0-20230117032631-52c9c8a3a91d/go.mod h1:dhbFYsUe0tyM+lnh5X4b3WcWowQsWgxOO50/dyHdEqs=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=
@@ -31,8 +31,8 @@ bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.4/go.mod h1:rRiGzKG4F/fmkN
 bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20220418072311-2062bed1e700/go.mod h1:KjcrxTzM96tBc6G4B8tlLBn1lrVy5UJYF8+eTdP4xAE=
 bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20220421015128-4a36f3eac5c5/go.mod h1:GT0QC4aaKDuXxAvaU4G02XjCc31TU1ctqBGqxQYOfC4=
 bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20220905055615-8540037e1b06/go.mod h1:LS21iwbgP8i3ZHJ1n4yNpLXQ/nzEudUOk0klC6VM2dQ=
-bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230109023014-2cd2a0b9b979 h1:hC97JNmBonTAsnDH4XMWLXVqWdo85tCo0ge04cy0e4E=
-bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230109023014-2cd2a0b9b979/go.mod h1:m7/aZ1r1FapNT2h3gqmCFVb0EV+CaJaNKNPHMzLHx8Y=
+bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230116052827-9b32b243b46f h1:sy6yPSBiLzKAxPZ6Oaw8NpYD82vFuz17F2YcI7gvx/8=
+bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230116052827-9b32b243b46f/go.mod h1:m7/aZ1r1FapNT2h3gqmCFVb0EV+CaJaNKNPHMzLHx8Y=
 cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=

+ 0 - 40
src/jfw/modules/publicapply/src/grpc/usercenter.go

@@ -1,40 +0,0 @@
-package grpc
-
-import (
-	"context"
-	"log"
-
-	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/pb"
-	"bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/usercenter"
-	"github.com/gogf/gf/v2/frame/g"
-	"github.com/gogf/gf/v2/os/gctx"
-	"github.com/zeromicro/go-zero/core/discov"
-	"github.com/zeromicro/go-zero/zrpc"
-)
-
-var UserCenter = &userCenter{}
-
-type userCenter struct{}
-
-func (u *userCenter) IdentityList(userId int64) []*pb.Identity {
-	var ctx = gctx.New()
-	client, err := zrpc.NewClient(zrpc.RpcClientConf{
-		Etcd: discov.EtcdConf{
-			Hosts: g.Cfg().MustGet(ctx, "etcd.hosts").Strings(),
-			Key:   g.Cfg().MustGet(ctx, "userCenterKey").String(),
-		},
-	})
-	if err != nil {
-		log.Println(err)
-		return nil
-	}
-	defer client.Conn().Close()
-	resp, err := usercenter.NewUserCenter(client).IdentityList(context.Background(), &pb.IdentityReq{
-		UserId: userId,
-	})
-	if err != nil {
-		log.Println(err)
-		return nil
-	}
-	return resp.Identitys
-}

+ 2 - 2
src/jfw/modules/publicapply/src/identity/service/service.go

@@ -3,7 +3,7 @@ package service
 import (
 	"encoding/json"
 	"fmt"
-	. "jy/src/jfw/modules/publicapply/src/grpc"
+	. "jy/src/jfw/modules/publicapply/src/config"
 	"log"
 	"strconv"
 
@@ -46,7 +46,7 @@ func decode(v string) *IdentityInfo {
 func (f *Identity) List() {
 	identitys := []map[string]interface{}{}
 	if base_user_id := util.Int64All(f.GetSession("base_user_id")); base_user_id > 0 {
-		for _, v := range UserCenter.IdentityList(base_user_id) {
+		for _, v := range Middleground.UserCenter.IdentityList(base_user_id) {
 			checked := 0
 			if (util.Int64All(f.GetSession("positionType")) == 0 && v.PositionType == 0) || util.Int64All(f.GetSession("positionId")) == v.PositionId {
 				checked = 1