|
@@ -23,14 +23,14 @@ import (
|
|
|
|
|
|
type NewIndex struct {
|
|
|
*xweb.Action
|
|
|
- newIndex xweb.Mapper `xweb:"/"` //首页改版
|
|
|
- entServerTransfer xweb.Mapper `xweb:"/front/entServerTransfer/(.*)"` //企业服务中转
|
|
|
- appDownload xweb.Mapper `xweb:"/front/appDownload"` //新app下载页面
|
|
|
+ newIndex xweb.Mapper `xweb:"/"` //首页改版
|
|
|
+ routerRelay xweb.Mapper `xweb:"/front/routerRelay/(.*)"` //企业服务中转
|
|
|
+ appDownload xweb.Mapper `xweb:"/front/appDownload"` //新app下载页面
|
|
|
}
|
|
|
|
|
|
var (
|
|
|
- entServerTransferMap map[string]map[bool]string
|
|
|
- BiddingTypeUrl = map[int]string{
|
|
|
+ routerRelayMap map[string]map[bool]string
|
|
|
+ BiddingTypeUrl = map[int]string{
|
|
|
1: "/list/stype/ZBYG.html",
|
|
|
2: "/list/stype/ZBJG.html",
|
|
|
3: "/list/stype/CGYX.html",
|
|
@@ -44,33 +44,100 @@ var (
|
|
|
|
|
|
func init() {
|
|
|
xweb.AddAction(&NewIndex{})
|
|
|
- entServerTransferMap = map[string]map[bool]string{
|
|
|
- "yxgl": map[bool]string{ //【营销管理】根据code判断是否有权限 bi_yx
|
|
|
+ routerRelayMap = map[string]map[bool]string{
|
|
|
+ "yxgl": { //【营销管理】根据code判断是否有权限 bi_yx
|
|
|
true: fmt.Sprintf("/page_workDesktop/work-bench/page?link=%s/succbi/crm_system/app/crm.app/sales_clues.spg", config.Sysconfig["webdomain"].(string)),
|
|
|
false: "/swordfish/frontPage/digitalMarketing/free/index",
|
|
|
},
|
|
|
- "yxt": map[bool]string{ //【医械通】根据code判断是否有权限 lyh_yl_yldy
|
|
|
+ "yxt": { //【医械通】根据code判断是否有权限 lyh_yl_yldy
|
|
|
true: "/page_workDesktop/work-bench/app/big/medical/Credentials",
|
|
|
false: "http://clpages.cn/yxtsjgwyxy",
|
|
|
},
|
|
|
- "khgl": map[bool]string{ //【客户管理】根据code判断是否有权限 bi_yx
|
|
|
+ "khgl": { //【客户管理】根据code判断是否有权限 bi_yx
|
|
|
true: fmt.Sprintf("/page_workDesktop/work-bench/page?link=%s/succbi/crm_system/app/crm.app/sales_clues.spg", config.Sysconfig["webdomain"].(string)),
|
|
|
false: "/swordfish/frontPage/customanage/free/index",
|
|
|
},
|
|
|
- "tbxmgl": map[bool]string{ //【投标项目管理】根据code判断是否有权限 cb_zy_code
|
|
|
- true: "/big/attend_bidding/mine",
|
|
|
+ "tbxmgl": { //【投标项目管理】根据code判断是否有权限 cb_zy_code
|
|
|
+ true: "/page_workDesktop/work-bench/app/big/attend_bidding/mine",
|
|
|
false: "/swordfish/frontPage/biddingProject/free/index",
|
|
|
},
|
|
|
- "nzbg": map[bool]string{ //【年终报告】根据code判断是否有权限
|
|
|
+ "nzbg": { //【年终报告】根据code判断是否有权限
|
|
|
true: fmt.Sprintf("/page_workDesktop/work-bench/page?link=%s/succbi/nzbg/app/nzbg.app/nzbg_entrance_pc.spg", config.Sysconfig["webdomain"].(string)),
|
|
|
false: "http://clpages.cn/nzbg",
|
|
|
},
|
|
|
- "xxfb": map[bool]string{ //【年终报告】根据code判断是否有权限
|
|
|
+ "xxfb": { //【信息发布】根据登录否判断
|
|
|
true: fmt.Sprintf("/page_workDesktop/work-bench/page?link=%s/swordfish/page_web_pc/issued/info", config.Sysconfig["webdomain"].(string)),
|
|
|
false: "/swordfish/frontPage/InformationDistribution/free/index",
|
|
|
},
|
|
|
+ "scfx": { //【市场分析报告】 根据登录否判断
|
|
|
+ true: "/page_workDesktop/work-bench/app/big/desktop/report_analysis",
|
|
|
+ false: "/big/page/sc",
|
|
|
+ },
|
|
|
+ "qdkz": { //【渠道扩展】 根据大会员权益7判断
|
|
|
+ true: "/swordfish/page_big_pc/potential_cor_list/c",
|
|
|
+ false: "/big/page/yw",
|
|
|
+ },
|
|
|
+ "tbjc": { //【投标决策分析】 根据大会员权益6判断
|
|
|
+ true: "/page_workDesktop/work-bench/app/big/analysis_result",
|
|
|
+ false: "/big/page/tb",
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
+func (nIndex *NewIndex) RouterRelay(code string) {
|
|
|
+ toUrl := func() string {
|
|
|
+ sessVal := nIndex.Session().GetMultiple()
|
|
|
+ accountId := common.Int64All(sessVal["accountId"])
|
|
|
+ if accountId <= 0 { //未登录
|
|
|
+ return routerRelayMap[code][false]
|
|
|
+ }
|
|
|
+ if code == "nzbg" || code == "xxfb" || code == "scfx" {
|
|
|
+ return routerRelayMap[code][true]
|
|
|
+ }
|
|
|
+ entAccountId := common.Int64All(sessVal["entAccountId"])
|
|
|
+ entId := common.Int64All(sessVal["entId"])
|
|
|
+ entUserId := common.Int64All(sessVal["entUserId"])
|
|
|
+ res := config.Middleground.ResourceCenter.Haspowers(accountId, entAccountId, entId, entUserId)
|
|
|
+
|
|
|
+ powerPass := false
|
|
|
+ switch code {
|
|
|
+ case "yxgl", "khgl":
|
|
|
+ for _, pCode := range res.Powers {
|
|
|
+ if pCode == "bi_yx" {
|
|
|
+ powerPass = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ case "yxt":
|
|
|
+ for _, pCode := range res.Powers {
|
|
|
+ if pCode == "lyh_yl_yldy" {
|
|
|
+ powerPass = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ case "tbxmgl":
|
|
|
+ for _, pCode := range res.Powers {
|
|
|
+ if pCode == "cb_zy_code" {
|
|
|
+ powerPass = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ case "tbjc", "qdkz": //大会员权益判断
|
|
|
+ powerRes := config.Middleground.PowerCheckCenter.Check("10000", gconv.String(sessVal["mgoUserId"]), gconv.Int64(sessVal["base_user_id"]), gconv.Int64(sessVal["accountId"]), gconv.Int64(sessVal["entId"]), gconv.Int64(sessVal["positionType"]), gconv.Int64(sessVal["positionId"]))
|
|
|
+ for _, pInt := range powerRes.Member.MemberPowerList {
|
|
|
+ if code == "tbjc" && pInt == 6 {
|
|
|
+ powerPass = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ if code == "qdkz" && pInt == 7 {
|
|
|
+ powerPass = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return routerRelayMap[code][powerPass]
|
|
|
+ }()
|
|
|
+ _ = nIndex.Redirect(toUrl)
|
|
|
+}
|
|
|
|
|
|
// NewIndex 新版首页改版
|
|
|
func (nIndex *NewIndex) NewIndex() error {
|
|
@@ -177,49 +244,6 @@ func (nIndex *NewIndex) NewIndex() error {
|
|
|
return nIndex.Render("/pc/newIndex.html", &nIndex.T)
|
|
|
}
|
|
|
|
|
|
-func (nIndex *NewIndex) EntServerTransfer(code string) {
|
|
|
- toUrl := func() string {
|
|
|
- sessVal := nIndex.Session().GetMultiple()
|
|
|
- accountId := common.Int64All(sessVal["accountId"])
|
|
|
- if accountId <= 0 { //未登录
|
|
|
- return entServerTransferMap[code][false]
|
|
|
- }
|
|
|
- if code == "nzbg" || code == "xxfb" {
|
|
|
- return entServerTransferMap[code][true]
|
|
|
- }
|
|
|
- entAccountId := common.Int64All(sessVal["entAccountId"])
|
|
|
- entId := common.Int64All(sessVal["entId"])
|
|
|
- entUserId := common.Int64All(sessVal["entUserId"])
|
|
|
- res := config.Middleground.ResourceCenter.Haspowers(accountId, entAccountId, entId, entUserId)
|
|
|
- powerPass := false
|
|
|
- switch code {
|
|
|
- case "yxgl", "khgl":
|
|
|
- for _, pCode := range res.Powers {
|
|
|
- if pCode == "bi_yx" {
|
|
|
- powerPass = true
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- case "yxt":
|
|
|
- for _, pCode := range res.Powers {
|
|
|
- if pCode == "lyh_yl_yldy" {
|
|
|
- powerPass = true
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- case "tbxmgl":
|
|
|
- for _, pCode := range res.Powers {
|
|
|
- if pCode == "cb_zy_code" {
|
|
|
- powerPass = true
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return entServerTransferMap[code][powerPass]
|
|
|
- }()
|
|
|
- _ = nIndex.Redirect(toUrl)
|
|
|
-}
|
|
|
-
|
|
|
func (nIndex *NewIndex) AppDownload() {
|
|
|
nIndex.T["includedInfo"] = GetIncludedInfo()
|
|
|
nIndex.Render("/frontRouter/pc/AppDownload/free/index.html", &nIndex.T)
|