| | |
| | | ToMessage mes = new ToMessage(); |
| | | RedisHelper redis = new RedisHelper(); |
| | | |
| | | #region[用户登录] |
| | | /// <summary> |
| | | /// 用户登录 |
| | | /// </summary> |
| | |
| | | { |
| | | List<User> mss = new List<User>(); |
| | | User ms = new User(); |
| | | //ms.guid=Guid.NewGuid().ToString(); |
| | | ms.guid = username + password + Guid.NewGuid().ToString(); |
| | | ms.userid = Convert.ToInt32(dt.Rows[0]["ID"].ToString()); |
| | | ms.usercode = dt.Rows[0]["USERCODE"].ToString(); |
| | | ms.username = dt.Rows[0]["USERNAME"].ToString(); |
| | |
| | | |
| | | return mes.ResponseMess(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[强制下线接口] |
| | | /// <summary> |
| | |
| | | { |
| | | try |
| | | { |
| | | redis.Remove("LoginUserID"+usertype+ userid, 0); //删除redis |
| | | redis.Remove("LoginUserID" + usertype + userid, 0); //删除redis |
| | | mes.code = "200"; |
| | | mes.count = 0; |
| | | mes.Message = "强制下线成功!"; |
| | |
| | | return mes.ResponseMess(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[查询登录菜单] |
| | | /// <summary> |
| | |
| | | /// <returns></returns> |
| | | [Route(template: "LoginOut")] |
| | | [HttpPost] |
| | | [ChannelActionFilter] |
| | | public HttpResponseMessage LoginOut(int userid, string usercode, string username, string usertype) |
| | | { |
| | | mes = LoginBLL.LoginOut(userid, usercode, username, usertype); |