Compare commits
3 Commits
1438178f70
...
401d6752cf
Author | SHA1 | Date | |
---|---|---|---|
401d6752cf | |||
3e0394eaea | |||
d91012ee1b |
@ -63,7 +63,7 @@ public class MPController {
|
|||||||
List<AuthorityDto> authorityDtos = new ArrayList<>();
|
List<AuthorityDto> authorityDtos = new ArrayList<>();
|
||||||
authorityDtos.add(authorityDto);
|
authorityDtos.add(authorityDto);
|
||||||
user.setPhone(authUser.getPhoneNumber());
|
user.setPhone(authUser.getPhoneNumber());
|
||||||
JwtUserDto jwtUser = new JwtUserDto(user, null, authorityDtos);
|
JwtUserDto jwtUser = new JwtUserDto(null, user, null, authorityDtos);
|
||||||
|
|
||||||
Authentication authentication = new UsernamePasswordAuthenticationToken(jwtUser, null, authorityDtos);
|
Authentication authentication = new UsernamePasswordAuthenticationToken(jwtUser, null, authorityDtos);
|
||||||
SecurityContextHolder.getContext().setAuthentication(authentication);
|
SecurityContextHolder.getContext().setAuthentication(authentication);
|
||||||
|
@ -164,14 +164,12 @@ public class AuthController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 3. 验证密码
|
// 3. 验证密码
|
||||||
// String enPassword = passwordEncoder.encode(authUser.getPassword());
|
if (!appUser.getPassword().equals(authUser.getPassword())) {
|
||||||
String enPassword = MD5.create().digestHex(authUser.getPassword());
|
|
||||||
if (!appUser.getPassword().equals(enPassword)) {
|
|
||||||
throw new BadRequestException("登录密码错误");
|
throw new BadRequestException("登录密码错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. 加载用户详情
|
// 4. 加载用户详情
|
||||||
JwtUserDto jwtUser = userDetailsService.loadAppUserByUsername(appUser.getUsername());
|
JwtUserDto jwtUser = userDetailsService.loadUserByAppUsername(appUser.getUsername());
|
||||||
|
|
||||||
// 5. 创建认证信息
|
// 5. 创建认证信息
|
||||||
Authentication authentication = new UsernamePasswordAuthenticationToken(jwtUser, null, jwtUser.getAuthorities());
|
Authentication authentication = new UsernamePasswordAuthenticationToken(jwtUser, null, jwtUser.getAuthorities());
|
||||||
|
@ -17,18 +17,17 @@ package com.fuyuanshen.modules.security.service;
|
|||||||
|
|
||||||
import cn.hutool.jwt.JWT;
|
import cn.hutool.jwt.JWT;
|
||||||
import cn.hutool.jwt.JWTUtil;
|
import cn.hutool.jwt.JWTUtil;
|
||||||
import com.fuyuanshen.modules.security.service.dto.app.AppJwtUserDto;
|
|
||||||
import com.fuyuanshen.modules.system.domain.app.APPUser;
|
|
||||||
import com.fuyuanshen.utils.SecurityUtils;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import com.fuyuanshen.exception.BadRequestException;
|
import com.fuyuanshen.exception.BadRequestException;
|
||||||
import com.fuyuanshen.modules.security.service.dto.AuthorityDto;
|
import com.fuyuanshen.modules.security.service.dto.AuthorityDto;
|
||||||
import com.fuyuanshen.modules.security.service.dto.JwtUserDto;
|
import com.fuyuanshen.modules.security.service.dto.JwtUserDto;
|
||||||
import com.fuyuanshen.modules.system.domain.User;
|
import com.fuyuanshen.modules.system.domain.User;
|
||||||
|
import com.fuyuanshen.modules.system.domain.app.APPUser;
|
||||||
import com.fuyuanshen.modules.system.service.DataService;
|
import com.fuyuanshen.modules.system.service.DataService;
|
||||||
import com.fuyuanshen.modules.system.service.RoleService;
|
import com.fuyuanshen.modules.system.service.RoleService;
|
||||||
import com.fuyuanshen.modules.system.service.UserService;
|
import com.fuyuanshen.modules.system.service.UserService;
|
||||||
|
import com.fuyuanshen.utils.SecurityUtils;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -48,58 +47,59 @@ public class UserDetailsServiceImpl implements UserDetailsService {
|
|||||||
private final DataService dataService;
|
private final DataService dataService;
|
||||||
private final UserCacheManager userCacheManager;
|
private final UserCacheManager userCacheManager;
|
||||||
|
|
||||||
|
private final static String APP_USER_TYPE = "1"; // app用户类型
|
||||||
|
|
||||||
|
private final static String SYSTEM_USER_TYPE = "0"; // 系统用户类型
|
||||||
@Override
|
@Override
|
||||||
public JwtUserDto loadUserByUsername(String username) {
|
public JwtUserDto loadUserByUsername(String username) {
|
||||||
JWT jwt = JWTUtil.parseToken(SecurityUtils.getToken());
|
if(SecurityUtils.getToken() != null){
|
||||||
String userType = jwt.getPayload("userType").toString();
|
JWT jwt = JWTUtil.parseToken(SecurityUtils.getToken());
|
||||||
|
String userType = jwt.getPayload("userType").toString();
|
||||||
if("1".equals(userType)){
|
if(APP_USER_TYPE.equals(userType)){
|
||||||
JwtUserDto jwtUserDto = userCacheManager.getAppUserCache(username);
|
return loadUserByAppUsername(username);
|
||||||
if (jwtUserDto == null) {
|
}else{
|
||||||
APPUser user = userService.appGetLoginData(username);
|
return loadSystemUserByUsername(username);
|
||||||
if (user == null) {
|
|
||||||
throw new BadRequestException("用户不存在");
|
|
||||||
} else {
|
|
||||||
if (!user.getEnabled()) {
|
|
||||||
throw new BadRequestException("账号未激活!");
|
|
||||||
}
|
|
||||||
// 获取用户的权限
|
|
||||||
List<AuthorityDto> authorities = roleService.appBuildPermissions(user);
|
|
||||||
// 初始化JwtUserDto
|
|
||||||
jwtUserDto = new JwtUserDto(user,null, dataService.getDeptIds(user), authorities);
|
|
||||||
// 添加缓存数据
|
|
||||||
userCacheManager.addAppUserCache(username, jwtUserDto);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return jwtUserDto;
|
|
||||||
}else{
|
}else{
|
||||||
JwtUserDto jwtUserDto = userCacheManager.getUserCache(username);
|
return loadSystemUserByUsername(username);
|
||||||
if (jwtUserDto == null) {
|
|
||||||
User user = userService.getLoginData(username);
|
|
||||||
if (user == null) {
|
|
||||||
throw new BadRequestException("用户不存在");
|
|
||||||
} else {
|
|
||||||
if (!user.getEnabled()) {
|
|
||||||
throw new BadRequestException("账号未激活!");
|
|
||||||
}
|
|
||||||
// 获取用户的权限
|
|
||||||
List<AuthorityDto> authorities = roleService.buildPermissions(user);
|
|
||||||
// 初始化JwtUserDto
|
|
||||||
jwtUserDto = new JwtUserDto(null,user, dataService.getDeptIds(user), authorities);
|
|
||||||
// 添加缓存数据
|
|
||||||
userCacheManager.addUserCache(username, jwtUserDto);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return jwtUserDto;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public JwtUserDto loadAppUserByUsername(String username) {
|
/**
|
||||||
|
* 加载系统用户详情信息
|
||||||
|
* @param username
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private JwtUserDto loadSystemUserByUsername(String username) {
|
||||||
JwtUserDto jwtUserDto = userCacheManager.getUserCache(username);
|
JwtUserDto jwtUserDto = userCacheManager.getUserCache(username);
|
||||||
if (jwtUserDto == null) {
|
if (jwtUserDto == null) {
|
||||||
username = username.replace("APP_", "");
|
User user = userService.getLoginData(username);
|
||||||
|
if (user == null) {
|
||||||
|
throw new BadRequestException("用户不存在");
|
||||||
|
} else {
|
||||||
|
if (!user.getEnabled()) {
|
||||||
|
throw new BadRequestException("账号未激活!");
|
||||||
|
}
|
||||||
|
// 获取用户的权限
|
||||||
|
List<AuthorityDto> authorities = roleService.buildPermissions(user);
|
||||||
|
// 初始化JwtUserDto
|
||||||
|
jwtUserDto = new JwtUserDto(null,user, dataService.getDeptIds(user), authorities);
|
||||||
|
// 添加缓存数据
|
||||||
|
userCacheManager.addUserCache(username, jwtUserDto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return jwtUserDto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加载app用户详情信息
|
||||||
|
* @param username
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public JwtUserDto loadUserByAppUsername(String username) {
|
||||||
|
|
||||||
|
JwtUserDto jwtUserDto = userCacheManager.getAppUserCache(username);
|
||||||
|
if (jwtUserDto == null) {
|
||||||
APPUser user = userService.appGetLoginData(username);
|
APPUser user = userService.appGetLoginData(username);
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
throw new BadRequestException("用户不存在");
|
throw new BadRequestException("用户不存在");
|
||||||
@ -118,9 +118,5 @@ public class UserDetailsServiceImpl implements UserDetailsService {
|
|||||||
return jwtUserDto;
|
return jwtUserDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isAppUser(String username) {
|
|
||||||
// 实现你的判断逻辑,比如前缀、数据库查询等
|
|
||||||
return username.startsWith("APP_");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,6 @@ public class APPDevice extends BaseEntity implements Serializable {
|
|||||||
@ApiModelProperty(value = "ID")
|
@ApiModelProperty(value = "ID")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "设备类型")
|
@ApiModelProperty(value = "设备类型")
|
||||||
private Long deviceType;
|
private Long deviceType;
|
||||||
|
|
||||||
@ -90,6 +89,14 @@ public class APPDevice extends BaseEntity implements Serializable {
|
|||||||
@ApiModelProperty(value = "绑定状态")
|
@ApiModelProperty(value = "绑定状态")
|
||||||
private Integer bindingStatus;
|
private Integer bindingStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定类型
|
||||||
|
* 0 APP
|
||||||
|
* 1 小程序
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "绑定类型")
|
||||||
|
private Integer bindingType;
|
||||||
|
|
||||||
|
|
||||||
public void copy(Device source) {
|
public void copy(Device source) {
|
||||||
BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
|
BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
|
||||||
|
@ -67,8 +67,16 @@ public class APPDeviceController {
|
|||||||
private final APPDeviceService appDeviceService;
|
private final APPDeviceService appDeviceService;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(value = "/bind")
|
||||||
|
@ApiOperation("APP用户设备绑定")
|
||||||
|
public ResponseVO<String> appBindDevice(@ApiParam("设备MAC地址") String mac) {
|
||||||
|
appDeviceService.appBindDevice(mac);
|
||||||
|
return ResponseVO.success("绑定成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@ApiOperation("查看APP用户设备绑定")
|
@ApiOperation("WEB端查看APP用户设备绑定")
|
||||||
public ResponseVO<PageResult<APPDevice>> queryAPPDevice(DeviceQueryCriteria criteria) {
|
public ResponseVO<PageResult<APPDevice>> queryAPPDevice(DeviceQueryCriteria criteria) {
|
||||||
Page<APPDevice> page = new Page<>(criteria.getPage(), criteria.getSize());
|
Page<APPDevice> page = new Page<>(criteria.getPage(), criteria.getSize());
|
||||||
PageResult<APPDevice> devices = null;
|
PageResult<APPDevice> devices = null;
|
||||||
@ -83,7 +91,7 @@ public class APPDeviceController {
|
|||||||
|
|
||||||
|
|
||||||
@PostMapping(value = "/unbind")
|
@PostMapping(value = "/unbind")
|
||||||
@ApiOperation("APP用户设备解绑")
|
@ApiOperation("WEB端APP用户设备解绑")
|
||||||
public ResponseVO<String> unbindAPPDevice(@Validated @ModelAttribute APPUnbindDTO deviceForm) {
|
public ResponseVO<String> unbindAPPDevice(@Validated @ModelAttribute APPUnbindDTO deviceForm) {
|
||||||
appDeviceService.unbindAPPDevice(deviceForm);
|
appDeviceService.unbindAPPDevice(deviceForm);
|
||||||
return ResponseVO.success("解绑成功!!!");
|
return ResponseVO.success("解绑成功!!!");
|
||||||
|
@ -87,9 +87,19 @@ public class APPUserController {
|
|||||||
return ResponseVO.success(appUserService.queryAPPUser(criteria, page));
|
return ResponseVO.success(appUserService.queryAPPUser(criteria, page));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log("app")
|
|
||||||
|
@ApiOperation("用户中心")
|
||||||
|
@GetMapping(value = "/get")
|
||||||
|
@PreAuthorize("@el.check('appUser:get')")
|
||||||
|
public ResponseVO<APPUser> getAPPUser(UserQueryCriteria criteria) {
|
||||||
|
String userName = SecurityUtils.getCurrentUsername();
|
||||||
|
return null;
|
||||||
|
// return ResponseVO.success(appUserService.getAPPUser(criteria));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log("app用户注册")
|
||||||
@ApiOperation("app用户注册")
|
@ApiOperation("app用户注册")
|
||||||
@AnonymousPostMapping(value = "/app/register")
|
@AnonymousPostMapping(value = "/register")
|
||||||
public ResponseVO<String> APPRegister(@Validated @RequestBody APPUserDTO user) throws Exception {
|
public ResponseVO<String> APPRegister(@Validated @RequestBody APPUserDTO user) throws Exception {
|
||||||
|
|
||||||
//暫定0000
|
//暫定0000
|
||||||
|
@ -22,6 +22,14 @@ import java.util.List;
|
|||||||
**/
|
**/
|
||||||
public interface APPDeviceService extends IService<APPDevice> {
|
public interface APPDeviceService extends IService<APPDevice> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APP/小程序用户设备绑定
|
||||||
|
*
|
||||||
|
* @param mac
|
||||||
|
*/
|
||||||
|
void appBindDevice(String mac);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询APP/小程序设备绑定
|
* 分页查询APP/小程序设备绑定
|
||||||
*
|
*
|
||||||
@ -38,4 +46,5 @@ public interface APPDeviceService extends IService<APPDevice> {
|
|||||||
*/
|
*/
|
||||||
void unbindAPPDevice(APPUnbindDTO deviceForm);
|
void unbindAPPDevice(APPUnbindDTO deviceForm);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,49 +2,30 @@ package com.fuyuanshen.modules.system.service.app;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.fuyuanshen.constants.DeviceConstants;
|
|
||||||
import com.fuyuanshen.constants.ExceptionMessages;
|
|
||||||
import com.fuyuanshen.exception.BadRequestException;
|
import com.fuyuanshen.exception.BadRequestException;
|
||||||
import com.fuyuanshen.modules.security.service.UserCacheManager;
|
|
||||||
import com.fuyuanshen.modules.system.constant.UserConstants;
|
|
||||||
import com.fuyuanshen.modules.system.domain.Device;
|
import com.fuyuanshen.modules.system.domain.Device;
|
||||||
import com.fuyuanshen.modules.system.domain.DeviceType;
|
import com.fuyuanshen.modules.system.domain.DeviceType;
|
||||||
import com.fuyuanshen.modules.system.domain.User;
|
|
||||||
import com.fuyuanshen.modules.system.domain.app.APPDevice;
|
import com.fuyuanshen.modules.system.domain.app.APPDevice;
|
||||||
import com.fuyuanshen.modules.system.domain.dto.CustomerVo;
|
import com.fuyuanshen.modules.system.domain.app.APPDeviceType;
|
||||||
import com.fuyuanshen.modules.system.domain.dto.DeviceForm;
|
|
||||||
import com.fuyuanshen.modules.system.domain.dto.DeviceQueryCriteria;
|
import com.fuyuanshen.modules.system.domain.dto.DeviceQueryCriteria;
|
||||||
import com.fuyuanshen.modules.system.domain.dto.app.APPUnbindDTO;
|
import com.fuyuanshen.modules.system.domain.dto.app.APPUnbindDTO;
|
||||||
import com.fuyuanshen.modules.system.enums.BindingStatusEnum;
|
import com.fuyuanshen.modules.system.enums.BindingStatusEnum;
|
||||||
|
import com.fuyuanshen.modules.system.enums.UserType;
|
||||||
import com.fuyuanshen.modules.system.mapper.DeviceMapper;
|
import com.fuyuanshen.modules.system.mapper.DeviceMapper;
|
||||||
import com.fuyuanshen.modules.system.mapper.DeviceTypeMapper;
|
import com.fuyuanshen.modules.system.mapper.DeviceTypeMapper;
|
||||||
import com.fuyuanshen.modules.system.mapper.UserMapper;
|
|
||||||
import com.fuyuanshen.modules.system.mapper.app.APPDeviceMapper;
|
import com.fuyuanshen.modules.system.mapper.app.APPDeviceMapper;
|
||||||
import com.fuyuanshen.modules.system.service.DeviceService;
|
import com.fuyuanshen.utils.PageResult;
|
||||||
import com.fuyuanshen.modules.system.service.UserService;
|
import com.fuyuanshen.utils.SecurityUtils;
|
||||||
import com.fuyuanshen.modules.system.service.impl.DeviceTypeServiceImpl;
|
|
||||||
import com.fuyuanshen.modules.utils.NanoId;
|
|
||||||
import com.fuyuanshen.utils.*;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.security.core.Authentication;
|
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import java.util.List;
|
||||||
import java.io.*;
|
|
||||||
import java.sql.Timestamp;
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description:
|
* @Description:
|
||||||
@ -58,6 +39,42 @@ public class APPDeviceServiceImpl extends ServiceImpl<APPDeviceMapper, APPDevice
|
|||||||
|
|
||||||
private final APPDeviceMapper appDeviceMapper;
|
private final APPDeviceMapper appDeviceMapper;
|
||||||
private final DeviceMapper deviceMapper;
|
private final DeviceMapper deviceMapper;
|
||||||
|
private final DeviceTypeMapper deviceTypeMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APP/小程序用户设备绑定
|
||||||
|
*
|
||||||
|
* @param mac
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void appBindDevice(String mac) {
|
||||||
|
List<Device> devices = deviceMapper.selectList(new QueryWrapper<Device>().eq("device_mac", mac));
|
||||||
|
if (CollectionUtil.isEmpty(devices)) {
|
||||||
|
throw new BadRequestException("请先将设备入库!!!");
|
||||||
|
}
|
||||||
|
List<APPDevice> appDevices = appDeviceMapper.selectList(new QueryWrapper<APPDevice>()
|
||||||
|
.eq("device_mac", mac).eq("binding_type", UserType.APP.getValue()));
|
||||||
|
if (CollectionUtil.isNotEmpty(appDevices)) {
|
||||||
|
throw new BadRequestException("该设备已绑定!!!");
|
||||||
|
}
|
||||||
|
|
||||||
|
Device device = devices.get(0);
|
||||||
|
APPDevice appDevice = new APPDevice();
|
||||||
|
BeanUtil.copyProperties(appDevice, device);
|
||||||
|
appDevice.setBindingType(UserType.APP.getValue());
|
||||||
|
appDevice.setBindingStatus(BindingStatusEnum.BOUND.getCode());
|
||||||
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
appDevice.setCustomerId(currentUserId);
|
||||||
|
appDeviceMapper.insert(appDevice);
|
||||||
|
|
||||||
|
DeviceType deviceType = deviceTypeMapper.selectById(device.getDeviceType());
|
||||||
|
APPDeviceType appDeviceType = new APPDeviceType();
|
||||||
|
BeanUtil.copyProperties(appDeviceType, deviceType);
|
||||||
|
deviceTypeMapper.insert(appDeviceType);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -90,4 +107,5 @@ public class APPDeviceServiceImpl extends ServiceImpl<APPDeviceMapper, APPDevice
|
|||||||
deviceMapper.updateById(device);
|
deviceMapper.updateById(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -76,9 +76,7 @@ public class APPUserServiceImpl extends ServiceImpl<APPUserMapper, APPUser> impl
|
|||||||
APPUser appUser = new APPUser();
|
APPUser appUser = new APPUser();
|
||||||
appUser.setUsername(user.getPhoneNumber());
|
appUser.setUsername(user.getPhoneNumber());
|
||||||
|
|
||||||
// String enPassword = passwordEncoder.encode(user.getPassword());
|
appUser.setPassword(user.getPassword());
|
||||||
String enPassword = MD5.create().digestHex(user.getPassword());
|
|
||||||
appUser.setPassword(enPassword);
|
|
||||||
appUser.setNickName(user.getPhoneNumber());
|
appUser.setNickName(user.getPhoneNumber());
|
||||||
appUser.setUserLevel((byte) 1);
|
appUser.setUserLevel((byte) 1);
|
||||||
appUser.setPhone(Long.valueOf(user.getPhoneNumber()));
|
appUser.setPhone(Long.valueOf(user.getPhoneNumber()));
|
||||||
|
Reference in New Issue
Block a user