public SinoUser GetCurrentUser() { string ticket = ServiceInterpector.GetCurrentTicket(); SinoSZTicketInfo _info = TicketLib.GetTicketInfo(ticket); if (_info == null) { return(null); } string _yhid = _info.YHID; SinoUser _su = LogonUserLib.GetUserInfo(_yhid); string postid = ServiceInterpector.GetCurrentPost(); if (postid != _su.CurrentPost.PostID) { var _ps = from _c in _su.Posts where _c.PostID == postid select _c; if (_ps.Count() > 0) { _su.CurrentPost = _ps.First(); } } return(_su); }
public static bool AddUserInfo(string _yhid, SinoUser _su) { if (_users.ContainsKey(_yhid)) { //如果用户已经登录 _users[_yhid] = _su; } else { _users.Add(_yhid, _su); } return(true); }
public HgjsPrincipal() { UserInfo = null; }
/// <summary> /// 设置当前用户上下文的当前用户ID。 /// </summary> /// <param name="userInfo">当前用户信息</param> public static void SetCurUser(SinoUser userInfo) { //将用户身份存放在CallContext中 new HgjsPrincipal(userInfo).SaveToCallCtx(); }
public SinoUser UserInfo; //当前用户ID /// <summary> /// 构造方法。设置当前用户信息 /// </summary> public HgjsPrincipal(SinoUser _userInfo) { UserInfo = _userInfo; }