|
@@ -1,10 +1,13 @@
|
|
|
package transfer
|
|
|
|
|
|
import (
|
|
|
+ "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
|
|
|
"app.yhyue.com/moapp/jybase/go-xweb/xweb"
|
|
|
+ "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
|
|
|
"app.yhyue.com/moapp/jypkg/public"
|
|
|
"encoding/hex"
|
|
|
"fmt"
|
|
|
+ "jy/src/jfw/modules/publicapply/src/config"
|
|
|
"log"
|
|
|
"net/url"
|
|
|
"regexp"
|
|
@@ -41,7 +44,7 @@ func (this *Transfer) Transfer() error {
|
|
|
repType = "app"
|
|
|
}
|
|
|
}
|
|
|
- return UrlHandle(urlStr, repType)
|
|
|
+ return UrlHandle(urlStr, repType, this.Session())
|
|
|
}()
|
|
|
if newUrl != "" {
|
|
|
log.Println("最近地址", newUrl)
|
|
@@ -75,11 +78,11 @@ var APPEntBuyPortrait = "/jyapp/big/page/client_portrayal?type=replace&entName=%
|
|
|
var WXEntBuyPortrait = "/big/wx/page/client_portrayal?entName=%s"
|
|
|
|
|
|
// 企业画像
|
|
|
-var PCEntPortrait = "/swordfish/page_big_pc/svip/ent_ser_portrait/%s"
|
|
|
+var PCEntPortrait = "/swordfish/page_big_pc%s/ent_ser_portrait/%s"
|
|
|
var APPEntPortrait = "/jyapp/big/page/ent_portrait?eId=%s"
|
|
|
var WXEntPortrait = "/weixin/frontPage/collection/sess/ent_portrait?eId=%s"
|
|
|
|
|
|
-func UrlHandle(urlStr string, repType string) string {
|
|
|
+func UrlHandle(urlStr string, repType string, u *httpsession.Session) string {
|
|
|
newUrl := ""
|
|
|
lastPath, queryMap := QueryHadle(urlStr)
|
|
|
if strings.Contains(urlStr, "/jyapp/article/content") {
|
|
@@ -134,34 +137,49 @@ func UrlHandle(urlStr string, repType string) string {
|
|
|
newUrl = fmt.Sprintf(PCLandingPage, strings.Join(queryMap["pid"], ""))
|
|
|
}
|
|
|
}
|
|
|
- if strings.Contains(urlStr, "/swordfish/page_big_pc/svip/ent_ser_portrait") {
|
|
|
+ if strings.Contains(urlStr, "/swordfish/page_big_pc/svip/ent_ser_portrait") || strings.Contains(urlStr, "/swordfish/page_big_pc/ent_ser_portrait") {
|
|
|
//pc企业画像
|
|
|
if repType == "app" {
|
|
|
newUrl = fmt.Sprintf(APPEntPortrait, lastPath)
|
|
|
} else if repType == "wx" {
|
|
|
newUrl = fmt.Sprintf(WXEntPortrait, lastPath)
|
|
|
} else {
|
|
|
- newUrl = fmt.Sprintf(PCEntPortrait, lastPath)
|
|
|
+ newUrl = fmt.Sprintf(PCEntPortrait, "", lastPath)
|
|
|
}
|
|
|
}
|
|
|
if strings.Contains(urlStr, "/jyapp/big/page/ent_portrait") {
|
|
|
//移动端企业画像
|
|
|
+ //权限获取
|
|
|
+ Big := jy.GetBigVipUserBaseMsg(u, *config.Middleground)
|
|
|
if repType == "app" {
|
|
|
newUrl = fmt.Sprintf(APPEntPortrait, strings.Join(queryMap["eId"], ""))
|
|
|
} else if repType == "wx" {
|
|
|
newUrl = fmt.Sprintf(WXEntPortrait, strings.Join(queryMap["eId"], ""))
|
|
|
} else {
|
|
|
- newUrl = fmt.Sprintf(PCEntPortrait, strings.Join(queryMap["eId"], ""))
|
|
|
+ if Big.Status > 0 {
|
|
|
+ newUrl = fmt.Sprintf(PCEntPortrait, "", strings.Join(queryMap["eId"], ""))
|
|
|
+ } else if Big.VipStatus > 0 {
|
|
|
+ newUrl = fmt.Sprintf(PCEntPortrait, "/svip", strings.Join(queryMap["eId"], ""))
|
|
|
+ } else {
|
|
|
+ newUrl = fmt.Sprintf(PCEntPortrait, "", strings.Join(queryMap["eId"], ""))
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if strings.Contains(urlStr, "/weixin/frontPage/collection/sess/ent_portrait") {
|
|
|
//微信端企业画像
|
|
|
+ Big := jy.GetBigVipUserBaseMsg(u, *config.Middleground)
|
|
|
if repType == "app" {
|
|
|
newUrl = fmt.Sprintf(APPEntPortrait, strings.Join(queryMap["eId"], ""))
|
|
|
} else if repType == "wx" {
|
|
|
newUrl = fmt.Sprintf(WXEntPortrait, strings.Join(queryMap["eId"], ""))
|
|
|
} else {
|
|
|
- newUrl = fmt.Sprintf(PCEntPortrait, strings.Join(queryMap["eId"], ""))
|
|
|
+ if Big.Status > 0 {
|
|
|
+ newUrl = fmt.Sprintf(PCEntPortrait, "", strings.Join(queryMap["eId"], ""))
|
|
|
+ } else if Big.VipStatus > 0 {
|
|
|
+ newUrl = fmt.Sprintf(PCEntPortrait, "/svip", strings.Join(queryMap["eId"], ""))
|
|
|
+ } else {
|
|
|
+ newUrl = fmt.Sprintf(PCEntPortrait, "", strings.Join(queryMap["eId"], ""))
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if strings.Contains(urlStr, "/swordfish/page_big_pc/unit_portrayal") {
|