Ver código fonte

Merge branch 'dev/v4.8.23.2_wh' of qmx/jy into hotfix/v4.8.23.2

王浩 2 anos atrás
pai
commit
1b0a9e5463
1 arquivos alterados com 29 adições e 30 exclusões
  1. 29 30
      src/jfw/modules/publicapply/src/transfer/transfer.go

+ 29 - 30
src/jfw/modules/publicapply/src/transfer/transfer.go

@@ -111,21 +111,21 @@ func UrlHandle(urlStr string, repType string, u *httpsession.Session) string {
 	if strings.Contains(urlStr, "/pro_follow_detail") {
 		//移动端项目详情页
 		if repType == "app" {
-			newUrl = fmt.Sprintf(APPProject, strings.Join(queryMap["sid"], ""), strings.Join(queryMap["fid"], ""))
+			newUrl = fmt.Sprintf(APPProject, url.QueryEscape(strings.Join(queryMap["sid"], "")), url.QueryEscape(strings.Join(queryMap["fid"], "")))
 		} else if repType == "wx" {
-			newUrl = fmt.Sprintf(WXProject, strings.Join(queryMap["sid"], ""), strings.Join(queryMap["fid"], ""))
+			newUrl = fmt.Sprintf(WXProject, url.QueryEscape(strings.Join(queryMap["sid"], "")), url.QueryEscape(strings.Join(queryMap["fid"], "")))
 		} else {
-			newUrl = fmt.Sprintf(PCProject, strings.Join(queryMap["sid"], ""), strings.Join(queryMap["fid"], ""))
+			newUrl = fmt.Sprintf(PCProject, url.QueryEscape(strings.Join(queryMap["sid"], "")), url.QueryEscape(strings.Join(queryMap["fid"], "")))
 		}
 	}
 	if strings.Contains(urlStr, "/client_follow_detail") {
 		//商机管理项目详情页
 		if repType == "app" {
-			newUrl = fmt.Sprintf(APPEntProject, strings.Join(queryMap["sid"], ""), strings.Join(queryMap["fid"], ""))
+			newUrl = fmt.Sprintf(APPEntProject, url.QueryEscape(strings.Join(queryMap["sid"], "")), url.QueryEscape(strings.Join(queryMap["fid"], "")))
 		} else if repType == "wx" {
-			newUrl = fmt.Sprintf(WXEntProject, strings.Join(queryMap["sid"], ""), strings.Join(queryMap["fid"], ""))
+			newUrl = fmt.Sprintf(WXEntProject, url.QueryEscape(strings.Join(queryMap["sid"], "")), url.QueryEscape(strings.Join(queryMap["fid"], "")))
 		} else {
-			newUrl = fmt.Sprintf(PCProject, strings.Join(queryMap["sid"], ""), strings.Join(queryMap["fid"], ""))
+			newUrl = fmt.Sprintf(PCProject, url.QueryEscape(strings.Join(queryMap["sid"], "")), url.QueryEscape(strings.Join(queryMap["fid"], "")))
 		}
 	}
 	if strings.Contains(urlStr, "/succbi/nzj/app/nzj.app") {
@@ -135,7 +135,7 @@ func UrlHandle(urlStr string, repType string, u *httpsession.Session) string {
 		} else if repType == "wx" {
 			newUrl = WXLandingPage
 		} else {
-			newUrl = fmt.Sprintf(PCLandingPage, strings.Join(queryMap["pid"], ""))
+			newUrl = fmt.Sprintf(PCLandingPage, url.QueryEscape(strings.Join(queryMap["pid"], "")))
 		}
 	}
 	if strings.Contains(urlStr, "/swordfish/page_big_pc/svip/ent_ser_portrait") || strings.Contains(urlStr, "/swordfish/page_big_pc/ent_portrait") {
@@ -160,16 +160,16 @@ func UrlHandle(urlStr string, repType string, u *httpsession.Session) string {
 		//权限获取
 		Big := jy.GetBigVipUserBaseMsg(u, *config.Middleground)
 		if repType == "app" {
-			newUrl = fmt.Sprintf(APPEntPortrait, strings.Join(queryMap["eId"], ""))
+			newUrl = fmt.Sprintf(APPEntPortrait, url.QueryEscape(strings.Join(queryMap["eId"], "")))
 		} else if repType == "wx" {
-			newUrl = fmt.Sprintf(WXEntPortrait, strings.Join(queryMap["eId"], ""))
+			newUrl = fmt.Sprintf(WXEntPortrait, url.QueryEscape(strings.Join(queryMap["eId"], "")))
 		} else {
 			if Big.Status > 0 {
-				newUrl = fmt.Sprintf(PCEntPortrait, strings.Join(queryMap["eId"], ""))
+				newUrl = fmt.Sprintf(PCEntPortrait, url.QueryEscape((strings.Join(queryMap["eId"], ""))))
 			} else if Big.VipStatus > 0 {
-				newUrl = fmt.Sprintf(PCVipEntPortrait, strings.Join(queryMap["eId"], ""))
+				newUrl = fmt.Sprintf(PCVipEntPortrait, url.QueryEscape(strings.Join(queryMap["eId"], "")))
 			} else {
-				newUrl = fmt.Sprintf(PCEntPortrait, strings.Join(queryMap["eId"], ""))
+				newUrl = fmt.Sprintf(PCEntPortrait, url.QueryEscape(strings.Join(queryMap["eId"], "")))
 			}
 		}
 	}
@@ -177,16 +177,16 @@ func UrlHandle(urlStr string, repType string, u *httpsession.Session) string {
 		//微信端企业画像
 		Big := jy.GetBigVipUserBaseMsg(u, *config.Middleground)
 		if repType == "app" {
-			newUrl = fmt.Sprintf(APPEntPortrait, strings.Join(queryMap["eId"], ""))
+			newUrl = fmt.Sprintf(APPEntPortrait, url.QueryEscape(strings.Join(queryMap["eId"], "")))
 		} else if repType == "wx" {
-			newUrl = fmt.Sprintf(WXEntPortrait, strings.Join(queryMap["eId"], ""))
+			newUrl = fmt.Sprintf(WXEntPortrait, url.QueryEscape(strings.Join(queryMap["eId"], "")))
 		} else {
 			if Big.Status > 0 {
-				newUrl = fmt.Sprintf(PCEntPortrait, strings.Join(queryMap["eId"], ""))
+				newUrl = fmt.Sprintf(PCEntPortrait, url.QueryEscape(strings.Join(queryMap["eId"], "")))
 			} else if Big.VipStatus > 0 {
-				newUrl = fmt.Sprintf(PCVipEntPortrait, strings.Join(queryMap["eId"], ""))
+				newUrl = fmt.Sprintf(PCVipEntPortrait, url.QueryEscape(strings.Join(queryMap["eId"], "")))
 			} else {
-				newUrl = fmt.Sprintf(PCEntPortrait, strings.Join(queryMap["eId"], ""))
+				newUrl = fmt.Sprintf(PCEntPortrait, url.QueryEscape(strings.Join(queryMap["eId"], "")))
 			}
 		}
 	}
@@ -204,21 +204,21 @@ func UrlHandle(urlStr string, repType string, u *httpsession.Session) string {
 	if strings.Contains(urlStr, "/jyapp/big/page/unit_portrayal") {
 		//移动端采购单位画像
 		if repType == "app" {
-			newUrl = fmt.Sprintf(APPBuyPortrait, strings.Join(queryMap["entName"], ""))
+			newUrl = fmt.Sprintf(APPBuyPortrait, url.QueryEscape(strings.Join(queryMap["entName"], "")))
 		} else if repType == "wx" {
-			newUrl = fmt.Sprintf(WXBuyPortrait, strings.Join(queryMap["entName"], ""))
+			newUrl = fmt.Sprintf(WXBuyPortrait, url.QueryEscape(strings.Join(queryMap["entName"], "")))
 		} else {
-			newUrl = fmt.Sprintf(PCBuyPortrait, strings.Join(queryMap["entName"], ""))
+			newUrl = fmt.Sprintf(PCBuyPortrait, url.QueryEscape(strings.Join(queryMap["entName"], "")))
 		}
 	}
 	if strings.Contains(urlStr, "/big/wx/page/unit_portrayal") {
 		//微信端采购单位画像
 		if repType == "app" {
-			newUrl = fmt.Sprintf(APPBuyPortrait, strings.Join(queryMap["entName"], ""))
+			newUrl = fmt.Sprintf(APPBuyPortrait, url.QueryEscape(strings.Join(queryMap["entName"], "")))
 		} else if repType == "wx" {
-			newUrl = fmt.Sprintf(WXBuyPortrait, strings.Join(queryMap["entName"], ""))
+			newUrl = fmt.Sprintf(WXBuyPortrait, url.QueryEscape(strings.Join(queryMap["entName"], "")))
 		} else {
-			newUrl = fmt.Sprintf(PCBuyPortrait, strings.Join(queryMap["entName"], ""))
+			newUrl = fmt.Sprintf(PCBuyPortrait, url.QueryEscape(strings.Join(queryMap["entName"], "")))
 		}
 	}
 	if strings.Contains(urlStr, "/entpc/unit_portrayal") {
@@ -235,21 +235,21 @@ func UrlHandle(urlStr string, repType string, u *httpsession.Session) string {
 	if strings.Contains(urlStr, "/jyapp/big/page/client_portrayal") {
 		//商机管理移动端采购单位画像
 		if repType == "app" {
-			newUrl = fmt.Sprintf(APPEntBuyPortrait, strings.Join(queryMap["entName"], ""))
+			newUrl = fmt.Sprintf(APPEntBuyPortrait, url.QueryEscape(strings.Join(queryMap["entName"], "")))
 		} else if repType == "wx" {
-			newUrl = fmt.Sprintf(WXEntBuyPortrait, strings.Join(queryMap["entName"], ""))
+			newUrl = fmt.Sprintf(WXEntBuyPortrait, url.QueryEscape(strings.Join(queryMap["entName"], "")))
 		} else {
-			newUrl = fmt.Sprintf(PCEntBuyPortrait, strings.Join(queryMap["entName"], ""))
+			newUrl = fmt.Sprintf(PCEntBuyPortrait, url.QueryEscape(strings.Join(queryMap["entName"], "")))
 		}
 	}
 	if strings.Contains(urlStr, "/big/wx/page/client_portrayal") {
 		//商机管理微信端采购单位画像
 		if repType == "app" {
-			newUrl = fmt.Sprintf(APPEntBuyPortrait, strings.Join(queryMap["entName"], ""))
+			newUrl = fmt.Sprintf(APPEntBuyPortrait, url.QueryEscape(strings.Join(queryMap["entName"], "")))
 		} else if repType == "wx" {
-			newUrl = fmt.Sprintf(WXEntBuyPortrait, strings.Join(queryMap["entName"], ""))
+			newUrl = fmt.Sprintf(WXEntBuyPortrait, url.QueryEscape(strings.Join(queryMap["entName"], "")))
 		} else {
-			newUrl = fmt.Sprintf(PCEntBuyPortrait, strings.Join(queryMap["entName"], ""))
+			newUrl = fmt.Sprintf(PCEntBuyPortrait, url.QueryEscape(strings.Join(queryMap["entName"], "")))
 		}
 	}
 	return newUrl
@@ -265,7 +265,6 @@ func QueryHadle(urlStr string) (string, url.Values) {
 	} else {
 		pathArr = strings.Split(u.RawPath, "/")
 	}
-
 	m, _ := url.ParseQuery(u.RawQuery)
 	return pathArr[len(pathArr)-1], m
 }