Browse Source

提交大会员pc端权限控制;加密处理

wangkaiyue 4 years ago
parent
commit
8f6bb27dcf

+ 15 - 3
src/jfw/front/frontRouter.go

@@ -5,7 +5,9 @@ import (
 	"github.com/go-xweb/xweb"
 	"jfw/config"
 	"jfw/public"
+	"log"
 	"qfw/util/jy"
+	"strings"
 )
 
 //前端通用路由
@@ -138,12 +140,12 @@ func (this *CommonRouter) doEntpcPage() error {
 
 //大会员
 func (this *CommonRouter) BigpcIndex() error {
-	return this.doPcBigPage()
+	return this.doPcBigPage("")
 }
 func (this *CommonRouter) BigpcPage(htmlPage string) error {
-	return this.doPcBigPage()
+	return this.doPcBigPage(htmlPage)
 }
-func (this *CommonRouter) doPcBigPage() error {
+func (this *CommonRouter) doPcBigPage(pageSign string) error {
 	userid, _ := this.GetSession("userId").(string)
 	//没有登录跳转登录页面
 	if userid == "" {
@@ -154,6 +156,16 @@ func (this *CommonRouter) doPcBigPage() error {
 	if bigBaseMsg.Status <= 0 {
 		return this.Redirect("/big/page/index")
 	}
+	//大会员页面权限判断
+	if pageSign != "" {
+		if array := strings.Split(pageSign, "/"); len(array) > 0 {
+			pageSign = array[0]
+		}
+		log.Println("pageSign", pageSign)
+		if !bigBaseMsg.CheckBigVipFrontPower(pageSign) {
+			return this.Redirect("/big/page/index")
+		}
+	}
 	return this.Render(fmt.Sprintf("/frontRouter/pc/page_big_pc/sess/index.html"))
 }
 

+ 3 - 0
src/jfw/modules/bigmember/src/util/util.go

@@ -8,6 +8,9 @@ import (
 var ClearHtml = regexp.MustCompile("<[^>]*>")
 
 func EncodeId(sid string) string {
+	if sid == "" {
+		return ""
+	}
 	return qutil.EncodeArticleId2ByCheck(sid)
 }
 

+ 2 - 2
src/web/templates/pc/biddetail_rec.html

@@ -475,7 +475,7 @@ function isWechat() {
 							<td class="tab-type">采购单位</td>
 								<td class="tab-cont">
 									{{if .T.isMember}}
-										<div class="cont-cont portrait_img" href-data="/swordfish/page_big_pc/unitportrayal/{{.T.obj.buyer}}" tip-data="查看采购单位画像">{{.T.obj.buyer}} </div>
+										<div class="cont-cont portrait_img" href-data="/swordfish/page_big_pc/unit_portrayal/{{.T.obj.buyer}}" tip-data="查看采购单位画像">{{.T.obj.buyer}} </div>
 									{{else}}
 										<div class="cont-cont">{{.T.obj.buyer}}</div>
 									{{end}}
@@ -526,7 +526,7 @@ function isWechat() {
 							<td class="tab-type">中标单位</td>
 							<td class="tab-cont">
 								{{if .T.isMember}}
-									<div class="cont-cont portrait_img" {{if .T.obj.entId}} href-data="/swordfish/page_big_pc/entportrayal/{{.T.obj.entId}}"  tip-data="查看企业画像"{{end}}>{{.T.obj.winner}}</div>
+									<div class="cont-cont portrait_img" {{if .T.obj.entId}} href-data="/swordfish/page_big_pc/ent_portrait/{{.T.obj.entId}}"  tip-data="查看企业画像"{{end}}>{{.T.obj.winner}}</div>
 								{{else}}
 									<div class="cont-cont">{{.T.obj.winner}}</div>
 								{{end}}