1234567891011121314151617181920212223242526272829303132333435 |
- package public
- import (
- "app.yhyue.com/moapp/jybase/common"
- "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
- )
- // SessUserInfo 从session获取用户基本信息
- type SessUserInfo struct {
- BaseUserId int64
- AccountId int64
- EntId int64
- PositionType int64
- PositionId int64
- EntUserId int64
- Phone string
- MgoUserId string
- UserId string
- }
- // GetUserBaseInfo 获取用户基本信息从session
- func GetUserBaseInfo(sess *httpsession.Session) SessUserInfo {
- getSession := sess.GetMultiple()
- return SessUserInfo{
- MgoUserId: common.ObjToString(getSession["mgoUserId"]),
- BaseUserId: common.Int64All(getSession["base_user_id"]),
- AccountId: common.Int64All(getSession["accountId"]),
- EntId: common.Int64All(getSession["entId"]),
- PositionType: common.Int64All(getSession["positionType"]),
- PositionId: common.Int64All(getSession["positionId"]),
- Phone: common.ObjToString(getSession["phone"]),
- UserId: common.ObjToString(getSession["userId"]),
- EntUserId: common.Int64All(getSession["entUserId"]),
- }
- }
|