| | |
| | | public WebResponseContent ModifyPwd(string oldPwd, string newPwd) |
| | | { |
| | | WebResponseContent content = WebResponseContent.Instance; |
| | | oldPwd = oldPwd?.Trim(); |
| | | newPwd = newPwd?.Trim(); |
| | | string message = ""; |
| | | try |
| | | { |
| | | if (string.IsNullOrEmpty(oldPwd)) return WebResponseContent.Instance.Error("æ§å¯ç ä¸è½ä¸ºç©º"); |
| | | if (string.IsNullOrEmpty(newPwd)) return WebResponseContent.Instance.Error("æ°å¯ç ä¸è½ä¸ºç©º"); |
| | | if (newPwd.Length < 6) return WebResponseContent.Instance.Error("å¯ç ä¸è½å°äº6ä½"); |
| | | |
| | | int userId = App.User.UserId; |
| | | string userCurrentPwd = BaseDal.QueryFirst(x => x.User_Id == userId, s => s.UserPwd); |
| | | |
| | | string _oldPwd = oldPwd.EncryptDES(AppSecret.User); |
| | | if (_oldPwd != userCurrentPwd) return WebResponseContent.Instance.Error("æ§å¯ç 䏿£ç¡®"); |
| | | int userId =int.Parse(oldPwd); |
| | | |
| | | string _newPwd = newPwd.EncryptDES(AppSecret.User); |
| | | if (userCurrentPwd == _newPwd) return WebResponseContent.Instance.Error("æ°å¯ç ä¸è½ä¸æ§å¯ç ç¸å"); |
| | | |
| | | |
| | | BaseDal.UpdateData(new Sys_User |