1
dengjunjie
2025-06-26 72390e0230b64cd43fedf0ba8e17aba097568a4a
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_SystemService/Sys_UserService.cs
@@ -20,13 +20,15 @@
    {
        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)
@@ -52,6 +54,16 @@
                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,
@@ -79,6 +91,8 @@
        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>
@@ -134,7 +148,7 @@
        /// </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();
@@ -147,6 +161,7 @@
                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);