| | |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.text.CharSequenceUtil; |
| | | import cn.lili.base.Result; |
| | | import cn.lili.cache.Cache; |
| | | import cn.lili.cache.CachePrefix; |
| | | import cn.lili.common.aop.annotation.DemoSite; |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.rocketmq.spring.core.RocketMQTemplate; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.ApplicationEventPublisher; |
| | |
| | | this.updateById(member); |
| | | return member; |
| | | } |
| | | @Override |
| | | public Result resetPassword(String id){ |
| | | String password = "123456"; |
| | | Member member = this.getById(id); |
| | | member.setPassword(new BCryptPasswordEncoder().encode(password)); |
| | | this.updateById(member); |
| | | return Result.ok("重置成功"); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Member updateMemberPartProperties(String id,String password,String mobile) { |
| | | //查询会员信息 |
| | | Member member = this.getById(id); |
| | | //如果密码不为空则加密密码 |
| | | if (CharSequenceUtil.isNotBlank(password)) { |
| | | member.setPassword(new BCryptPasswordEncoder().encode(password)); |
| | | } |
| | | member.setMobile(mobile); |
| | | member.setUsername(mobile); |
| | | this.updateById(member); |