luwenna 4 anni fa
parent
commit
0ba9401ff9

+ 0 - 1
src/config.json

@@ -279,7 +279,6 @@
     "PCS_time":24,
     "detail_element":["table","div"],
 	"termValidity":3600,
-    "entnichePcUser": [442,1686,1685,1711],
     "uploadPath": "./web/staticres/upload/res/",
     "redisSessionLockSize":20,
     "accountMergeOnline":"2010-03-30 00:00:00",

+ 4 - 0
src/entnichePc.json

@@ -0,0 +1,4 @@
+{
+	"entnichePcUser": [442,1686,1685,1711],
+	"hideEntnicheMenu": [1711,442]
+}

+ 10 - 0
src/jfw/config/config.go

@@ -17,6 +17,13 @@ var Wxoauth, Wxoauthinfo string
 
 var GmailAuth []*mail.GmailAuth
 
+type entnichePcConf struct {
+	EntnichePcUser   []int `json:"entnichePcUser"`
+	HideEntnicheMenu []int `json:"hideEntnicheMenu"`
+}
+
+var EntnichePcConf *entnichePcConf
+
 func init() {
 	util.ReadConfig(&Sysconfig)
 	WeixinConfig, _ = Sysconfig["wxJianyu"].(map[string]interface{})
@@ -35,4 +42,7 @@ func init() {
 		}
 		GmailAuth = append(GmailAuth, mail)
 	}
+
+	//PC端商机管理配置
+	util.ReadConfig("./entnichePc.json", &EntnichePcConf)
 }

+ 23 - 12
src/jfw/front/dataExport.go

@@ -918,16 +918,24 @@ func (this *DataExport) GetPcEntAuth() {
 	myEntMenu := false
 	entnicheMenu := false
 	pcUsers := map[int]bool{}
-	for _, v := range config.Sysconfig["entnichePcUser"].([]interface{}) {
-		pcUsers[util.IntAll(v)] = true
+	hideUsers := map[int]bool{}
+	for _, v := range config.EntnichePcConf.EntnichePcUser {
+		pcUsers[v] = true
+	}
+	for _, v := range config.EntnichePcConf.HideEntnicheMenu {
+		hideUsers[v] = true
 	}
 	if phone != "" {
 		ent := public.Mysql.SelectBySql("select id,phone from entniche_info where phone=? and status=1", phone)
-		if len(*ent) != 0 {
+		if ent != nil && len(*ent) != 0 {
 			for _, val := range *ent {
-				if pcUsers[util.IntAll((val)["id"])] {
-					entnicheMenu = true
+				if pcUsers[util.IntAll(val["id"])] {
 					myEntMenu = true
+					if hideUsers[util.IntAll(val["id"])] {
+						entnicheMenu = false
+					} else {
+						entnicheMenu = true
+					}
 					break
 				}
 			}
@@ -937,19 +945,22 @@ func (this *DataExport) GetPcEntAuth() {
 			if user != nil && len(*user) > 0 {
 				for _, v := range *user {
 					if pcUsers[util.IntAll(v["ent_id"])] {
-						ents := public.Mysql.SelectBySql("select status from entniche_info where id=?", util.IntAll(v["ent_id"]))
-						if len(*ents) != 0 {
+						ents := public.Mysql.SelectBySql("select status,id from entniche_info where id=?", util.IntAll(v["ent_id"]))
+						if ents != nil && len(*ents) != 0 {
 							for _, vv := range *ents {
 								if util.IntAll(vv["status"]) == 1 {
 									myEntMenu = true
-									break
+								}
+								if util.IntAll(v["power"]) == 1 {
+									if hideUsers[util.IntAll(vv["id"])] {
+										entnicheMenu = false
+									} else {
+										entnicheMenu = true
+									}
 								}
 							}
 						}
-						if util.IntAll(v["power"]) == 1 {
-							entnicheMenu = true
-							break
-						}
+						break
 					}
 				}
 			}

+ 1 - 1
src/web/templates/frontRouter/pc/entpc/sess/index.html

@@ -34,7 +34,7 @@
     <script type="systemjs-importmap" crossorigin="anonymous">
       {
         "imports": {
-          "entpc": "/page_entpc/js/app.js",
+          "entpc": "/page_entpc/js/app.js?v={{Msg "seo" "version"}}",
           "single-spa": "https://cdn.jsdelivr.net/npm/single-spa@4.3.7/lib/system/single-spa.min.js",
           "vue": "https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js",
           "vue-router": "https://cdn.jsdelivr.net/npm/vue-router@3.0.7/dist/vue-router.min.js"