| | |
| | | { |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly ICacheService _cacheService; |
| | | private readonly ISys_MenuService _menuService; |
| | | |
| | | public ISys_UserRepository Repository => BaseDal; |
| | | |
| | | public Sys_UserService(ISys_UserRepository repository, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService) : base(repository) |
| | | public Sys_UserService(ISys_UserRepository repository, IUnitOfWorkManage unitOfWorkManage, ICacheService cacheService, ISys_MenuService menuService) : base(repository) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _cacheService = cacheService; |
| | | _menuService = menuService; |
| | | } |
| | | |
| | | public WebResponseContent Login(LoginInfo loginInfo) |
| | |
| | | UserInfo user = BaseDal.GetUserInfo(loginInfo.UserName, loginInfo.Password); |
| | | if (user != null) |
| | | { |
| | | object obj = _menuService.GetMenuActionList(user.RoleId); |
| | | if (obj is not IEnumerable<object> list) |
| | | { |
| | | return WebResponseContent.Instance.Error("æ ç»å½æé"); |
| | | } |
| | | if (!list.Any()) |
| | | { |
| | | return WebResponseContent.Instance.Error("æ ç»å½æé"); |
| | | } |
| | | |
| | | string token = JwtHelper.IssueJwt(new TokenModelJwt() |
| | | { |
| | | UserId = user.UserId, |
| | |
| | | |
| | | public override WebResponseContent UpdateData(SaveModel saveModel) |
| | | { |
| | | var role_Id = saveModel.MainData["role_Id"].ObjToInt(); |
| | | if (role_Id < App.User.RoleId) return WebResponseContent.Instance.Error("æ ä¿®æ¹æé"); |
| | | UpdateIgnoreColOnExecute = x => |
| | | { |
| | | return new List<string> |
| | |
| | | /// </summary> |
| | | /// <param name="parameters"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent ModifyPwd(string oldPwd, string newPwd) |
| | | public WebResponseContent ModifyPwd(string oldPwd, string newPwd, int user_Id) |
| | | { |
| | | WebResponseContent content = WebResponseContent.Instance; |
| | | oldPwd = oldPwd?.Trim(); |
| | |
| | | if (newPwd.Length < 6) return WebResponseContent.Instance.Error("å¯ç ä¸è½å°äº6ä½"); |
| | | |
| | | int userId = App.User.UserId; |
| | | if (user_Id != userId && user_Id != 0) return WebResponseContent.Instance.Error("ä¸å¯ä¿®æ¹å
¶ä»ç¨æ·å¯ç "); |
| | | string userCurrentPwd = BaseDal.QueryFirst(x => x.User_Id == userId, s => s.UserPwd); |
| | | |
| | | string _oldPwd = oldPwd.EncryptDES(AppSecret.User); |