1.在创建租户时能够选择是否允许登录爬主播和爬大哥客户端

2.可以修改租户下用户客户端登录权限
3.修改生产环境配置
This commit is contained in:
2025-06-27 21:50:36 +08:00
parent 8b23762991
commit 7d5a0118af
11 changed files with 72 additions and 75 deletions

View File

@@ -70,4 +70,7 @@ public class TenantSaveReqVO {
@Schema(description = "是否允许登录爬虫客户端", example = "0不允许1允许") @Schema(description = "是否允许登录爬虫客户端", example = "0不允许1允许")
private Byte crawl; private Byte crawl;
@Schema(description = "是否允许登录爬虫客户端", example = "0不允许1允许")
private Byte bigBrother;
} }

View File

@@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*; import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*;
import cn.iocoder.yudao.module.system.convert.user.UserConvert; import cn.iocoder.yudao.module.system.convert.user.UserConvert;
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
@@ -183,4 +184,13 @@ public class UserController {
convertList(userDOList, AdminUserDO::getDeptId)); convertList(userDOList, AdminUserDO::getDeptId));
return success(UserConvert.INSTANCE.convertSimpleList(userDOList, deptMap)); return success(UserConvert.INSTANCE.convertSimpleList(userDOList, deptMap));
} }
@TenantIgnore
@GetMapping({"/list-tenant-user"})
@Operation(summary = "获取选择租户下所有用户", description = "获取选择租户下所有用户只包含被开启的用户,主要用于前端的下拉选项")
public CommonResult<List<UserRespVO>> getTenantUserById(@RequestParam Long tenantId) {
return success(userService.getTenantUserById(tenantId));
}
} }

View File

@@ -72,4 +72,11 @@ public class UserRespVO{
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "时间戳格式") @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "时间戳格式")
private LocalDateTime createTime; private LocalDateTime createTime;
@Schema(description = "爬取主播")
private Byte crawl;
@Schema(description = "爬取大哥")
private Byte bigBrother;
} }

View File

@@ -20,6 +20,7 @@ public interface TenantConvert {
reqVO.setUsername(bean.getUsername()); reqVO.setUsername(bean.getUsername());
reqVO.setPassword(bean.getPassword()); reqVO.setPassword(bean.getPassword());
reqVO.setCrawl(bean.getCrawl()); reqVO.setCrawl(bean.getCrawl());
reqVO.setBigBrother(bean.getBigBrother());
reqVO.setNickname(bean.getContactName()).setMobile(bean.getContactMobile()); reqVO.setNickname(bean.getContactName()).setMobile(bean.getContactMobile());
return reqVO; return reqVO;
} }

View File

@@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserRespVO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@@ -53,4 +54,6 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
.eq(AdminUserDO::getStatus, status) .eq(AdminUserDO::getStatus, status)
.eq(AdminUserDO::getDeptId, deptId)); .eq(AdminUserDO::getDeptId, deptId));
} }
List<UserRespVO> selectTenantUserById(Long tenantId);
} }

View File

@@ -6,10 +6,7 @@ import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthRegisterReqVO; import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthRegisterReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserImportExcelVO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserImportRespVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import javax.validation.Valid; import javax.validation.Valid;
@@ -208,4 +205,6 @@ public interface AdminUserService {
boolean isPasswordMatch(String rawPassword, String encodedPassword); boolean isPasswordMatch(String rawPassword, String encodedPassword);
List<AdminUserDO> getUserListByStatusAndDept(Integer status, Long deptId); List<AdminUserDO> getUserListByStatusAndDept(Integer status, Long deptId);
List<UserRespVO> getTenantUserById(Long tenantId);
} }

View File

@@ -17,10 +17,7 @@ import cn.iocoder.yudao.module.infra.api.config.ConfigApi;
import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthRegisterReqVO; import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthRegisterReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserImportExcelVO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.*;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserImportRespVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
import cn.iocoder.yudao.module.system.dal.dataobject.dept.UserPostDO; import cn.iocoder.yudao.module.system.dal.dataobject.dept.UserPostDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
@@ -520,6 +517,11 @@ public class AdminUserServiceImpl implements AdminUserService {
return userMapper.getUserListByStatusAndDept(status,deptId); return userMapper.getUserListByStatusAndDept(status,deptId);
} }
@Override
public List<UserRespVO> getTenantUserById(Long tenantId) {
return userMapper.selectTenantUserById(tenantId);
}
/** /**
* 对密码进行加密 * 对密码进行加密
* *

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="selectTenantUserById"
resultType="cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserRespVO">
select * from system_users where tenant_id=#{tenantId,jdbcType=BIGINT}
</select>
</mapper>

View File

@@ -5,8 +5,7 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
import cn.iocoder.yudao.module.system.api.sms.SmsCodeApi; import cn.iocoder.yudao.module.system.api.sms.SmsCodeApi;
import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO;
import cn.iocoder.yudao.module.system.api.social.dto.SocialUserRespDTO;
import cn.iocoder.yudao.module.system.controller.admin.auth.vo.*; import cn.iocoder.yudao.module.system.controller.admin.auth.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO; import cn.iocoder.yudao.module.system.dal.dataobject.oauth2.OAuth2AccessTokenDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
@@ -17,7 +16,7 @@ import cn.iocoder.yudao.module.system.enums.social.SocialTypeEnum;
import cn.iocoder.yudao.module.system.service.logger.LoginLogService; import cn.iocoder.yudao.module.system.service.logger.LoginLogService;
import cn.iocoder.yudao.module.system.service.member.MemberService; import cn.iocoder.yudao.module.system.service.member.MemberService;
import cn.iocoder.yudao.module.system.service.oauth2.OAuth2TokenService; import cn.iocoder.yudao.module.system.service.oauth2.OAuth2TokenService;
import cn.iocoder.yudao.module.system.service.social.SocialUserService;
import cn.iocoder.yudao.module.system.service.user.AdminUserService; import cn.iocoder.yudao.module.system.service.user.AdminUserService;
import com.anji.captcha.model.common.ResponseModel; import com.anji.captcha.model.common.ResponseModel;
import com.anji.captcha.service.CaptchaService; import com.anji.captcha.service.CaptchaService;
@@ -53,8 +52,6 @@ public class AdminAuthServiceImplTest extends BaseDbUnitTest {
@MockBean @MockBean
private LoginLogService loginLogService; private LoginLogService loginLogService;
@MockBean @MockBean
private SocialUserService socialUserService;
@MockBean
private SmsCodeApi smsCodeApi; private SmsCodeApi smsCodeApi;
@MockBean @MockBean
private OAuth2TokenService oauth2TokenService; private OAuth2TokenService oauth2TokenService;

View File

@@ -44,21 +44,21 @@ spring:
primary: master primary: master
datasource: datasource:
master: master:
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 url: jdbc:mysql://47.79.98.113:3326/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
username: root username: root
password: 123456 password: wfn53400
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改 # slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
lazy: true # 开启懒加载,保证启动速度 # lazy: true # 开启懒加载,保证启动速度
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
username: root # username: root
password: 123456 # password: 123456
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
redis: redis:
host: 400-infra.server.iocoder.cn # 地址 host: 47.79.98.113 # 地址
port: 6379 # 端口 port: 16379 # 端口
database: 1 # 数据库索引 database: 1 # 数据库索引
# password: 123456 # 密码,建议生产环境开启 password: ezyPM2UQkPO8O6i8s9 # 密码,建议生产环境开启
--- #################### 定时任务相关配置 #################### --- #################### 定时任务相关配置 ####################
@@ -100,10 +100,10 @@ rocketmq:
spring: spring:
# RabbitMQ 配置项,对应 RabbitProperties 配置类 # RabbitMQ 配置项,对应 RabbitProperties 配置类
rabbitmq: rabbitmq:
host: 127.0.0.1 # RabbitMQ 服务的地址 host: 47.79.98.113 # RabbitMQ 服务的地址
port: 5672 # RabbitMQ 服务的端口 port: 5672 # RabbitMQ 服务的端口
username: root # RabbitMQ 服务的账号 username: tkdata # RabbitMQ 服务的账号
password: 123asd # RabbitMQ 服务的密码 password: 6rARaRj8Z7UG3ahLzh # RabbitMQ 服务的密码
# Kafka 配置项,对应 KafkaProperties 配置类 # Kafka 配置项,对应 KafkaProperties 配置类
kafka: kafka:
bootstrap-servers: 127.0.0.1:9092 # 指定 Kafka Broker 地址,可以设置多个,以逗号分隔 bootstrap-servers: 127.0.0.1:9092 # 指定 Kafka Broker 地址,可以设置多个,以逗号分隔
@@ -142,54 +142,10 @@ logging:
file: file:
name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
--- #################### 微信公众号相关配置 ####################
wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
mp:
# 公众号配置(必填)
app-id: wx041349c6f39b268b
secret: 5abee519483bc9f8cb37ce280e814bd0
# 存储配置,解决 AccessToken 的跨节点的共享
config-storage:
type: RedisTemplate # 采用 RedisTemplate 操作 Redis会自动从 Spring 中获取
key-prefix: wx # Redis Key 的前缀
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档
appid: wx63c280fe3248a3e7
secret: 6f270509224a7ae1296bbf1c8cb97aed
config-storage:
type: RedisTemplate # 采用 RedisTemplate 操作 Redis会自动从 Spring 中获取
key-prefix: wa # Redis Key 的前缀
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
--- #################### 芋道相关配置 #################### --- #################### 芋道相关配置 ####################
yudao:
captcha:
justauth: enable: false # 本地环境,暂时关闭图片验证码,方便登录等接口的测试;
enabled: true
type:
DINGTALK: # 钉钉
client-id: dingvrnreaje3yqvzhxg
client-secret: i8E6iZyDvZj51JIb0tYsYfVQYOks9Cq1lgryEjFRqC79P3iJcrxEwT6Qk2QvLrLI
ignore-check-redirect-uri: true
WECHAT_ENTERPRISE: # 企业微信
client-id: wwd411c69a39ad2e54
client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw
agent-id: 1000004
ignore-check-redirect-uri: true
# noinspection SpringBootApplicationYaml
WECHAT_MINI_PROGRAM: # 微信小程序
client-id: ${wx.miniapp.appid}
client-secret: ${wx.miniapp.secret}
ignore-check-redirect-uri: true
ignore-check-state: true # 微信小程序,不会使用到 state所以不进行校验
WECHAT_MP: # 微信公众号
client-id: ${wx.mp.app-id}
client-secret: ${wx.mp.secret}
ignore-check-redirect-uri: true
cache:
type: REDIS
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟

View File

@@ -168,8 +168,8 @@ yudao:
topic: ${spring.application.name}-websocket # 消息发送的 Kafka Topic topic: ${spring.application.name}-websocket # 消息发送的 Kafka Topic
consumer-group: ${spring.application.name}-websocket-consumer # 消息发送的 Kafka Consumer Group consumer-group: ${spring.application.name}-websocket-consumer # 消息发送的 Kafka Consumer Group
swagger: swagger:
title: 芋道快速开发平 title: Tk-Data管理后
description: 提供管理后台、用户 App 的所有功能 description: 提供管理后台、用户,数据的所有功能
version: ${yudao.info.version} version: ${yudao.info.version}
url: ${yudao.web.admin-ui.url} url: ${yudao.web.admin-ui.url}
email: xingyu4j@vip.qq.com email: xingyu4j@vip.qq.com