|
@@ -1,18 +1,46 @@
|
|
|
package front
|
|
|
|
|
|
import (
|
|
|
+ "app.yhyue.com/moapp/jybase/common"
|
|
|
"app.yhyue.com/moapp/jybase/go-xweb/xweb"
|
|
|
"context"
|
|
|
+ "fmt"
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
|
+ "jy/src/jfw/config"
|
|
|
)
|
|
|
|
|
|
type NewIndex struct {
|
|
|
*xweb.Action
|
|
|
- newIndex xweb.Mapper `xweb:"/"` //首页改版
|
|
|
+ newIndex xweb.Mapper `xweb:"/"` //首页改版
|
|
|
+ entServerTransfer xweb.Mapper `xweb:"/front/entServerTransfer/(.*)"` //企业服务中转
|
|
|
}
|
|
|
|
|
|
+var entServerTransferMap map[string]map[bool]string
|
|
|
+
|
|
|
func init() {
|
|
|
xweb.AddAction(&NewIndex{})
|
|
|
+ entServerTransferMap = map[string]map[bool]string{
|
|
|
+ "yxgl": map[bool]string{ //【营销管理】根据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: "",
|
|
|
+ },
|
|
|
+ "yxt": map[bool]string{ //【医械通】根据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
|
|
|
+ true: fmt.Sprintf("/page_workDesktop/work-bench/page?link=%s/succbi/crm_system/app/crm.app/sales_clues.spg", config.Sysconfig["webdomain"].(string)),
|
|
|
+ false: "",
|
|
|
+ },
|
|
|
+ "tbxmgl": map[bool]string{ //【投标项目管理】根据code判断是否有权限 cb_zy_code
|
|
|
+ true: "/big/attend_bidding/mine",
|
|
|
+ false: "",
|
|
|
+ },
|
|
|
+ "nzbg": map[bool]string{ //【年终报告】根据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: "",
|
|
|
+ },
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// NewIndex 新版首页改版
|
|
@@ -21,3 +49,46 @@ func (nIndex *NewIndex) NewIndex() error {
|
|
|
nIndex.T["topMenu"] = g.Cfg("index").MustGet(context.Background(), "topMenu").Maps()
|
|
|
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" {
|
|
|
+ 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)
|
|
|
+}
|