修改商城权限,让登录用户可以看到数据
This commit is contained in:
@@ -130,6 +130,9 @@ var (
|
|||||||
ErrInvalidParams = errors.New("参数不合法")
|
ErrInvalidParams = errors.New("参数不合法")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 微信小程序商城appid
|
||||||
|
const WeCartAppID = "wx4b5930c13f8b1170"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
authers = make(map[string]IAuther)
|
authers = make(map[string]IAuther)
|
||||||
|
|
||||||
@@ -297,6 +300,9 @@ func LoginInternal(ctx *Context, authType, authID, authIDType, authSecret string
|
|||||||
authInfo.IsExistOpenID = true
|
authInfo.IsExistOpenID = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if WeCartAppID == appID {
|
||||||
|
authInfo.AuthBindInfo.AppServer = WeCartAppID
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,6 +84,10 @@ func (a *AuthInfo) GetAuthType() string {
|
|||||||
return a.AuthBindInfo.Type
|
return a.AuthBindInfo.Type
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *AuthInfo) GetIsWeCartApp() string {
|
||||||
|
return a.AuthBindInfo.AppServer
|
||||||
|
}
|
||||||
|
|
||||||
func (a *AuthInfo) GetAuthTypeID() string {
|
func (a *AuthInfo) GetAuthTypeID() string {
|
||||||
return a.AuthBindInfo.TypeID
|
return a.AuthBindInfo.TypeID
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -736,7 +736,8 @@ func getGetStoresSkusBaseSQL(db *dao.DaoDB, storeIDs, skuIDs []int, upcs []strin
|
|||||||
|
|
||||||
func GetStoresSkus(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []string, isFocus, isHighPrice bool, priceType int, keyword string, isBySku, isAct bool, params map[string]interface{}, offset, pageSize int) (skuNamesInfo *dao.StoreSkuNamesInfo, err error) {
|
func GetStoresSkus(ctx *jxcontext.Context, storeIDs, skuIDs []int, upcs []string, isFocus, isHighPrice bool, priceType int, keyword string, isBySku, isAct bool, params map[string]interface{}, offset, pageSize int) (skuNamesInfo *dao.StoreSkuNamesInfo, err error) {
|
||||||
//权限
|
//权限
|
||||||
if permission.IsRoled(ctx) { // 管理员不进入
|
|
||||||
|
if permission.IsRoled(ctx) || auth2.WeCartAppID != ctx.GetLoginInfo().GetIsWeCartApp() { // 管理员不进入,商城不进入
|
||||||
if storeIDsMap, err := permission.GetUserStoresResultMap(ctx.GetUserID()); err == nil {
|
if storeIDsMap, err := permission.GetUserStoresResultMap(ctx.GetUserID()); err == nil {
|
||||||
var storeIDs2 []int
|
var storeIDs2 []int
|
||||||
if len(storeIDs) > 0 {
|
if len(storeIDs) > 0 {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ type IAuther interface {
|
|||||||
GetAuthID() string
|
GetAuthID() string
|
||||||
GetAuthType() string
|
GetAuthType() string
|
||||||
GetUserTag() string
|
GetUserTag() string
|
||||||
|
GetIsWeCartApp() string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Context struct {
|
type Context struct {
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ type AuthBind struct {
|
|||||||
AuthSecret2 string `orm:"size(48)" json:"-"`
|
AuthSecret2 string `orm:"size(48)" json:"-"`
|
||||||
Remark string `orm:"size(255)" json:"remark"`
|
Remark string `orm:"size(255)" json:"remark"`
|
||||||
DetailData string `orm:"type(text)" json:"detailData"`
|
DetailData string `orm:"type(text)" json:"detailData"`
|
||||||
|
AppServer string `json:"appServer"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*AuthBind) TableUnique() [][]string {
|
func (*AuthBind) TableUnique() [][]string {
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ dbConnectStr = "root:WebServer@1@tcp(127.0.0.1:3306)/jxgy?charset=utf8mb4&loc=Lo
|
|||||||
|
|
||||||
jdOrgCode = "339032"
|
jdOrgCode = "339032"
|
||||||
jdLoginName = "jd_jxgy"
|
jdLoginName = "jd_jxgy"
|
||||||
jdToken = "9fd1424e-3a2c-4c2a-a794-f5b6782524e1"
|
jdToken = "b1138139-9610-4b80-9a63-a63da4773885"
|
||||||
jdAppKey = "5d5577a2506f41b8b4ec520ba83490f5"
|
jdAppKey = "5d5577a2506f41b8b4ec520ba83490f5"
|
||||||
jdSecret = "0b01b9eeb15b41dab1c3d05d95c17a26"
|
jdSecret = "0b01b9eeb15b41dab1c3d05d95c17a26"
|
||||||
jdStorePageCookie = "YDYCWYUGKSROMV3MKJQIFINJ5CLPYH6IRVFUMFJD3JI6VQKHX3YPHTWDIDBNMCBUKSY3P7SKAHHKR7PHQDSFRXZEWXA4XOUTALIQDGDYIEUCMDPWSYGDVT42DJ27CD27QKCR3UN7KF7EPIHGPR7GCRTBD5YGNZW4AIACY4HXDMCETEWCPFKOTM4HRJBSMMQJ77SR62PYMP6RCG33IRQGP6PRCKAO4M7FUA7G2ZM2SFQ6F6WUNO5GXDJSVUELLBJT"
|
jdStorePageCookie = "YDYCWYUGKSROMV3MKJQIFINJ5CLPYH6IRVFUMFJD3JI6VQKHX3YPHTWDIDBNMCBUKSY3P7SKAHHKR7PHQDSFRXZEWXA4XOUTALIQDGDYIEUCMDPWSYGDVT42DJ27CD27QKCR3UN7KF7EPIHGPR7GCRTBD5YGNZW4AIACY4HXDMCETEWCPFKOTM4HRJBSMMQJ77SR62PYMP6RCG33IRQGP6PRCKAO4M7FUA7G2ZM2SFQ6F6WUNO5GXDJSVUELLBJT"
|
||||||
|
|||||||
Reference in New Issue
Block a user