| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.map.MapUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.qcloud.cos.utils.Md5Utils; |
| | | import com.sandu.common.enums.RoleLevelStatus; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | |
| | | import com.sandu.ximon.dao.enums.OrderByEnums; |
| | | import com.sandu.ximon.dao.mapper.AdminMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | throw new BusinessException("用户不存在,请重新确认!"); |
| | | } |
| | | |
| | | /** |
| | | * key操作日志 |
| | | */ |
| | | String content = "操作用户key:" + SecurityUtils.getUsername() + " 被操作用户id:" + userId; |
| | | |
| | | |
| | | //获取 |
| | | if (type == 1) { |
| | | content += "操作类型:获取key"; |
| | | StoreOperationRecordsUtils.storeOperationData(null, null, "操作用户key", content); |
| | | return "用户的便捷登录key为:" + client.getUserKey(); |
| | | } else { |
| | | //更新 |
| | |
| | | client.setUserKey(md5); |
| | | boolean flag = clientService.updateById(client); |
| | | if (flag) { |
| | | content += "操作类型:生成key,新的key为:" + md5; |
| | | StoreOperationRecordsUtils.storeOperationData(null, null, "操作用户key", content); |
| | | return "生成便捷登录key成功,该用户key为:" + md5 + ",请妥善保管!"; |
| | | } else { |
| | | throw new BusinessException("生成便捷登录key失败!"); |