| | |
| | | package com.lf.server.service.sys; |
| | | |
| | | import com.lf.server.entity.all.RedisCacheKey; |
| | | import com.lf.server.entity.all.SettingData; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.Md5Helper; |
| | | import com.lf.server.helper.RsaHelper; |
| | |
| | | import com.lf.server.mapper.sys.UserMapper; |
| | | import com.lf.server.service.all.RedisService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.cache.RedisCache; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * 用户表 |
| | |
| | | |
| | | @Autowired |
| | | RedisService redisService; |
| | | |
| | | @Autowired |
| | | LoginService loginService; |
| | | |
| | | @Autowired |
| | | TokenService tokenService; |
| | | |
| | | @Override |
| | | public Integer selectCount(String uname) { |
| | |
| | | entity.setUid(uid); |
| | | entity.setPwd(pwd); |
| | | |
| | | if (tokenService.isUidDisable(entity)) { |
| | | return "用户ID已禁用"; |
| | | } |
| | | |
| | | return null; |
| | | } catch (Exception ex) { |
| | | return "密码解密失败"; |
| | | return "解密失败"; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return null; |
| | | } catch (Exception ex) { |
| | | return "密码解密失败"; |
| | | return "解密失败"; |
| | | } |
| | | } |
| | | |
| | |
| | | return "没有找到用户"; |
| | | } |
| | | if (!Md5Helper.validatePassword(pwd, ue.getPwd())) { |
| | | // |
| | | return "旧密码输入错误"; |
| | | tokenService.setPwdErrCache(ue); |
| | | return "旧密码不正确"; |
| | | } |
| | | if (!StringHelper.checkPwdValid(salt)) { |
| | | return "密码不符合要求"; |
| | |
| | | |
| | | return null; |
| | | } catch (Exception ex) { |
| | | return "密码解密失败"; |
| | | return "解密失败"; |
| | | } |
| | | } |
| | | |
| | |
| | | try { |
| | | String pwd = RsaHelper.decrypt(adminPwd); |
| | | if (!Md5Helper.validatePassword(pwd, ue.getPwd())) { |
| | | tokenService.setPwdErrCache(ue); |
| | | return "管理员密码不正确"; |
| | | } |
| | | |
| | | return null; |
| | | } catch (Exception ex) { |
| | | return "密码解密失败"; |
| | | return "解密失败"; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | return null; |
| | | } catch (Exception ex) { |
| | | return "密码解密失败"; |
| | | return "解密失败"; |
| | | } |
| | | } |
| | | } |