|
@@ -76,13 +76,12 @@ func (i *IdentityInfo) Switch(sess *httpsession.Session, mgo *MongodbSim) bool {
|
|
|
|
|
|
// 切换到最优身份
|
|
|
func SwitchToBest(userId int64, sess *httpsession.Session, mgd *Middleground, mgo *MongodbSim, isSelectLast bool) (int64, bool) {
|
|
|
- mgoUserId, _ := sess.Get("mgoUserId").(string)
|
|
|
- list := mgd.UserCenter.IdentityList(userId, mgoUserId, "10000")
|
|
|
+ list := mgd.UserCenter.IdentityList(userId)
|
|
|
if list == nil || len(list) == 0 {
|
|
|
return -1, false
|
|
|
}
|
|
|
if isSelectLast {
|
|
|
- if mgoUserId != "" {
|
|
|
+ if mgoUserId, _ := sess.Get("mgoUserId").(string); mgoUserId != "" {
|
|
|
user, ok := mgo.FindById("user", mgoUserId, `{"login_positionid":1}`)
|
|
|
if ok && user != nil && len(*user) > 0 {
|
|
|
if login_positionid := Int64All((*user)["login_positionid"]); login_positionid > 0 {
|