Commit ca9d4983 by 韦华德

更新

parent be96a3e0
......@@ -21,7 +21,7 @@ import java.util.Date;
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "t_blind_user_info")
@TableName(value = "t_bind_user_info")
public class BindUserInfo {
/**
......
......@@ -21,8 +21,8 @@ public class SystemController {
@ApiOperation("获取系统列表")
@PostMapping(value = "/getSysInfoList")
public ResultVo getSysInfoList(@RequestBody SysInfoFindVo vo) {
return ResultVo.success(systemService.getSysInfoList(vo));
public ResultVo getSysInfoList() {
return ResultVo.success(systemService.getSysInfoList());
}
}
......@@ -103,6 +103,11 @@ public class SingleService {
}
public void bindSystem(SingleLoginVo vo) {
OnlineUserDto adminContext = ContextUtils.getAdminContext();
List<BindUserInfo> bindUserInfos = blindUserInfoDao.selectList(Wrappers.lambdaQuery(BindUserInfo.builder().userId(adminContext.getUserId())
.sysId(vo.getSystemId()).build()));
AssertUtils.isTrue(bindUserInfos.size()==0,"用户已绑定该系统");
SysInfo sysInfo = sysInfoDao.selectById(vo.getSystemId());
AssertUtils.notNull(sysInfo, "系统不存在");
......@@ -142,10 +147,10 @@ public class SingleService {
String serviceUrl = request.getParameter("service");
AssertUtils.hasText(serviceUrl, "跳转地址为空");
// String passwd = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, vo.getPasswd());
String passwd = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, vo.getPasswd());
UsernamePasswordAuthenticationToken authenticationToken =
new UsernamePasswordAuthenticationToken(vo.getUsername(), vo.getPasswd());
new UsernamePasswordAuthenticationToken(vo.getUsername(), passwd);
Authentication authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken);
SecurityContextHolder.getContext().setAuthentication(authentication);
// 生成令牌
......
......@@ -4,8 +4,10 @@ import com.zq.common.vo.PageVo;
import com.zq.system.modules.system.domain.vo.SysInfoFindVo;
import com.zq.system.modules.system.entity.SysInfo;
import java.util.List;
public interface SystemService {
PageVo<SysInfo> getSysInfoList(SysInfoFindVo vo);
List<SysInfo> getSysInfoList();
}
package com.zq.system.modules.system.service.impl;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.zq.common.utils.PagingUtils;
import com.zq.common.vo.PageVo;
import com.zq.system.modules.system.dao.SysInfoDao;
......@@ -9,6 +11,8 @@ import com.zq.system.modules.system.service.SystemService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@RequiredArgsConstructor
public class SystemServiceImpl implements SystemService {
......@@ -16,7 +20,8 @@ public class SystemServiceImpl implements SystemService {
private final SysInfoDao sysInfoDao;
@Override
public PageVo<SysInfo> getSysInfoList(SysInfoFindVo vo) {
return PagingUtils.paging(vo, sysInfoDao, SysInfo.class);
public List<SysInfo> getSysInfoList() {
return sysInfoDao.selectList(Wrappers.lambdaQuery());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment