#update
This commit is contained in:
@@ -12,7 +12,7 @@ import org.springframework.context.ConfigurableApplicationContext;
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@SpringBootApplication()
|
||||
@SpringBootApplication
|
||||
@ForestScan(basePackages = "com.maibu")
|
||||
public class MiddlePlatformApplication
|
||||
{
|
||||
|
||||
@@ -12,10 +12,8 @@ import com.maibu.enums.BusinessType;
|
||||
import com.maibu.enums.ConnectorStatus;
|
||||
import com.maibu.enums.SourceType;
|
||||
import com.maibu.manager.DeviceSessionManager;
|
||||
import com.maibu.mapper.SysLoginConfigMapper;
|
||||
import com.maibu.service.IAppPreferencesService;
|
||||
import com.maibu.service.ISysMenuService;
|
||||
import com.maibu.service.ISysUserClientService;
|
||||
import com.maibu.service.ISysUserService;
|
||||
import com.maibu.utils.SecurityUtils;
|
||||
import com.maibu.web.domain.dto.LoginResultDto;
|
||||
@@ -60,75 +58,12 @@ public class SysLoginController {
|
||||
@Resource
|
||||
private IAppPreferencesService appPreferencesService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserClientService sysUserClientService;
|
||||
|
||||
@Autowired
|
||||
private SysLoginConfigMapper sysLoginConfigMapper;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private DeviceSessionManager sessionManager;
|
||||
|
||||
|
||||
// /**
|
||||
// * 登录方法
|
||||
// *
|
||||
// * @param loginBody 登录信息
|
||||
// * @return 结果
|
||||
// */
|
||||
// @ApiOperation("用户登录")
|
||||
// @PostMapping("login")
|
||||
// @Log(title = "用户登录", businessType = BusinessType.OTHER)
|
||||
// public AjaxResult login(HttpServletRequest request, @RequestBody LoginBody loginBody) {
|
||||
// System.out.println("用户登录");
|
||||
// Integer sourceType = loginBody.getSourceType();
|
||||
// if (sourceType == null) {
|
||||
// return AjaxResult.error("登录来源为空!");
|
||||
// }
|
||||
//
|
||||
// String username;
|
||||
// String password;
|
||||
// if (sourceType == 5) {
|
||||
// LoginResultDto dto = loginService.threePlatformOpenIdVerify(loginBody);
|
||||
// if (!dto.isSuccess() || dto.isSkipLogin()) {
|
||||
// return new AjaxResult(dto.getResultCode(), dto.getMsg());
|
||||
// }
|
||||
// username = dto.getUserName();
|
||||
// password = dto.getPassword();
|
||||
// } else {
|
||||
// if (StringUtils.isEmpty(loginBody.getUsername()) || StringUtils.isEmpty(loginBody.getPassword())) {
|
||||
// return AjaxResult.error("参数错误!");
|
||||
// }
|
||||
// // 使用Redis保存当前登录用户信息
|
||||
// String code = SourceType.switchCode(sourceType);
|
||||
// username = loginBody.getUsername();
|
||||
// password = loginBody.getPassword();
|
||||
// String loginUserKey = username + ":" + code; // 使用用户ID作为缓存键的一部分
|
||||
// NettyDevice nettyDevice = sessionManager.getDevice(loginUserKey);
|
||||
// if (nettyDevice != null && ConnectorStatus.ACTIVE.equals(nettyDevice.getConnectorStatus())) {
|
||||
// return AjaxResult.error("已达登录上限!");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// AjaxResult ajax = AjaxResult.success();
|
||||
// // 生成令牌
|
||||
// String token = loginService.login(username, password, loginBody.getCode(),
|
||||
// loginBody.getUuid(), loginBody.getSourceType(), request.getHeader(LANGUAGE));
|
||||
// String[] split = token.split("====");
|
||||
// ajax.put(Constants.TOKEN, split[1]);
|
||||
// ajax.put("userId", split[0]);
|
||||
// ajax.put("username", username);
|
||||
//
|
||||
// SysUser sysUser = userService.selectUserByUserName(username);
|
||||
// sysUser.setSessionId(split[1]);
|
||||
// userService.updateUserProfile(sysUser);
|
||||
// return ajax;
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 登录方法
|
||||
*
|
||||
@@ -230,6 +165,7 @@ public class SysLoginController {
|
||||
ajax.put("aiChatNum", aiChatNum);
|
||||
ajax.put("nickName", nickName);
|
||||
if (sysUser != null) {
|
||||
ajax.put("roleId",sysUser.getRoleId());
|
||||
aiChatNum = sysUser.getAiChatNum();
|
||||
sysUser.setSessionId(split[1]);
|
||||
sysUser.setDisplayPassword(password);
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.maibu.web.controller.system;
|
||||
|
||||
import com.maibu.core.controller.BaseController;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.core.domain.entity.SysOrg;
|
||||
import com.maibu.core.page.TableDataInfo;
|
||||
import com.maibu.domain.Device;
|
||||
import com.maibu.service.SysOrgService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
/**
|
||||
* 组织管理
|
||||
*/
|
||||
@RequestMapping("/system/org")
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class SysOrgController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private SysOrgService sysOrgService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询组织列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysOrg org) {
|
||||
try {
|
||||
startPage();
|
||||
return getDataTable(sysOrgService.list(org));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或者修改组织
|
||||
*/
|
||||
|
||||
@PostMapping("/save")
|
||||
public AjaxResult save(@RequestBody SysOrg org) {
|
||||
try {
|
||||
return AjaxResult.success(sysOrgService.save(org));
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("保存组织出错", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除组织
|
||||
*/
|
||||
|
||||
@GetMapping("/delete")
|
||||
public AjaxResult delete(@RequestParam Long id) {
|
||||
try {
|
||||
return AjaxResult.success(sysOrgService.delete(id));
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("保存组织出错", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询组织详情
|
||||
*/
|
||||
|
||||
@GetMapping("/selectById")
|
||||
public AjaxResult selectById(@RequestParam Long id) {
|
||||
try {
|
||||
return AjaxResult.success(sysOrgService.selectById(id));
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("保存组织出错", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.maibu.web.controller.system;
|
||||
|
||||
import com.maibu.annotation.Log;
|
||||
import com.maibu.constant.Constants;
|
||||
import com.maibu.core.controller.BaseController;
|
||||
import com.maibu.core.domain.AjaxResult;
|
||||
import com.maibu.core.domain.entity.SysMenu;
|
||||
import com.maibu.core.domain.entity.SysOrg;
|
||||
import com.maibu.core.domain.entity.SysSite;
|
||||
import com.maibu.core.domain.entity.SysUser;
|
||||
import com.maibu.core.domain.model.LoginBody;
|
||||
import com.maibu.core.page.TableDataInfo;
|
||||
import com.maibu.domain.AppPreferences;
|
||||
import com.maibu.dto.NettyDevice;
|
||||
import com.maibu.enums.BusinessType;
|
||||
import com.maibu.enums.ConnectorStatus;
|
||||
import com.maibu.enums.SourceType;
|
||||
import com.maibu.manager.DeviceSessionManager;
|
||||
import com.maibu.service.*;
|
||||
import com.maibu.utils.SecurityUtils;
|
||||
import com.maibu.web.domain.dto.LoginResultDto;
|
||||
import com.maibu.web.service.SysLoginService;
|
||||
import com.maibu.web.service.SysPermissionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static com.maibu.constant.Constants.LANGUAGE;
|
||||
|
||||
|
||||
/**
|
||||
* 区域/场站
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
public class SysSiteController extends BaseController {
|
||||
@Autowired
|
||||
private SysSiteService sysSiteService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询组织列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysSite org) {
|
||||
try {
|
||||
startPage();
|
||||
return getDataTable(sysSiteService.list(org));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或者修改组织
|
||||
*/
|
||||
|
||||
@PostMapping("/save")
|
||||
public AjaxResult save(@RequestBody SysSite org) {
|
||||
try {
|
||||
return AjaxResult.success(sysSiteService.save(org));
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("保存组织出错", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除组织
|
||||
*/
|
||||
|
||||
@GetMapping("/delete")
|
||||
public AjaxResult delete(@RequestParam Long id) {
|
||||
try {
|
||||
return AjaxResult.success(sysSiteService.delete(id));
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("保存组织出错", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询组织详情
|
||||
*/
|
||||
|
||||
@GetMapping("/selectById")
|
||||
public AjaxResult selectById(@RequestParam Long id) {
|
||||
try {
|
||||
return AjaxResult.success(sysSiteService.selectById(id));
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error("保存组织出错", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://1.95.137.212:3306/fastbee?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://localhost:3306/maibu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: fastbee
|
||||
password: maibu520
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ maibu:
|
||||
|
||||
# 开发环境配置
|
||||
server:
|
||||
port: 8081 # 服务器的HTTP端口,默认为8080
|
||||
port: 8082 # 服务器的HTTP端口,默认为8080
|
||||
servlet:
|
||||
context-path: / # 应用的访问路径
|
||||
tomcat:
|
||||
|
||||
Reference in New Issue
Block a user