| | |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | public WebResponseContent ModifyUserPwd(string password, string userName) |
| | | { |
| | | WebResponseContent webResponse = new WebResponseContent(); |
| | | if (string.IsNullOrEmpty(password) || string.IsNullOrEmpty(userName)) |
| | | { |
| | | return webResponse.Error("参数不完整"); |
| | | } |
| | | if (password.Length < 6) return webResponse.Error("密码长度不能少于6位"); |
| | | |
| | | |
| | | Sys_User user = BaseDal.QueryFirst(x => x.UserName == userName); |
| | | if (user == null) |
| | | { |
| | | return webResponse.Error("用户不存在"); |
| | | } |
| | | user.UserPwd = password.EncryptDES(AppSecret.User); |
| | | BaseDal.UpdateData(user); |
| | | //如果用户在线,强制下线 |
| | | //UserContext.Current.LogOut(user.User_Id); |
| | | return webResponse.OK("密码修改成功"); |
| | | } |
| | | } |
| | | } |