| | |
| | | package com.xcong.farmer.cms.modules.system.service.Impl; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.codec.Rot; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | if(StrUtil.isNotEmpty(adminAddUserDto.getEmail())){ |
| | | userEntity.setEmail(adminAddUserDto.getEmail()); |
| | | } |
| | | ; |
| | | userEntity.setPassword(Rot.encode13(UserEntity.PASSWORD_DEFAULT)); |
| | | |
| | | userEntity.setPassword(SecureUtil.md5(UserEntity.PASSWORD_DEFAULT)); |
| | | userEntity.setStatus(UserEntity.STATUS_ENABLE); |
| | | int insert = this.baseMapper.insert(userEntity); |
| | | if(insert > 0){ |
| | |
| | | if(ObjectUtil.isEmpty(userEntity)){ |
| | | return Result.fail("用户不存在"); |
| | | } |
| | | userEntity.setPassword(Rot.encode13(UserEntity.PASSWORD_DEFAULT)); |
| | | userEntity.setPassword(SecureUtil.md5(UserEntity.PASSWORD_DEFAULT)); |
| | | this.baseMapper.updateById(userEntity); |
| | | return Result.ok("重置成功"); |
| | | } |