Skip to content

Commit

Permalink
!124 发布 2.1.1 大量代码优化与bug修复 建议升级
Browse files Browse the repository at this point in the history
Merge pull request !124 from 疯狂的狮子Li/dev
  • Loading branch information
JavaLionLi authored and gitee-org committed Nov 14, 2023
2 parents 4981eb8 + 34c1440 commit 8b6a61a
Show file tree
Hide file tree
Showing 71 changed files with 462 additions and 331 deletions.
2 changes: 1 addition & 1 deletion .run/ruoyi-auth.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="ruoyi-auth" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="ruoyi/ruoyi-auth:2.1.0" />
<option name="imageTag" value="ruoyi/ruoyi-auth:2.1.1" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="ruoyi-auth/Dockerfile" />
</settings>
Expand Down
2 changes: 1 addition & 1 deletion .run/ruoyi-gateway.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="ruoyi-gateway" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="ruoyi/ruoyi-gateway:2.1.0" />
<option name="imageTag" value="ruoyi/ruoyi-gateway:2.1.1" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="ruoyi-gateway/Dockerfile" />
</settings>
Expand Down
2 changes: 1 addition & 1 deletion .run/ruoyi-gen.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="ruoyi-gen" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="ruoyi/ruoyi-gen:2.1.0" />
<option name="imageTag" value="ruoyi/ruoyi-gen:2.1.1" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="ruoyi-modules/ruoyi-gen/Dockerfile" />
</settings>
Expand Down
2 changes: 1 addition & 1 deletion .run/ruoyi-job.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="ruoyi-job" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="ruoyi/ruoyi-job:2.1.0" />
<option name="imageTag" value="ruoyi/ruoyi-job:2.1.1" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="ruoyi-modules/ruoyi-job/Dockerfile" />
</settings>
Expand Down
2 changes: 1 addition & 1 deletion .run/ruoyi-monitor.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="ruoyi-monitor" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="ruoyi/ruoyi-monitor:2.1.0" />
<option name="imageTag" value="ruoyi/ruoyi-monitor:2.1.1" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="ruoyi-visual/ruoyi-monitor/Dockerfile" />
</settings>
Expand Down
2 changes: 1 addition & 1 deletion .run/ruoyi-nacos.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="ruoyi-nacos" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="ruoyi/ruoyi-nacos:2.1.0" />
<option name="imageTag" value="ruoyi/ruoyi-nacos:2.1.1" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="ruoyi-visual/ruoyi-nacos/Dockerfile" />
</settings>
Expand Down
4 changes: 2 additions & 2 deletions .run/ruoyi-powerjob-server.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<configuration default="false" name="ruoyi-powerjob-server" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="ruoyi/ruoyi-powerjob-server:2.1.0" />
<option name="imageTag" value="ruoyi/ruoyi-powerjob-server:2.1.1" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="ruoyi-visual/ruoyi-powerjob-server/Dockerfile" />
</settings>
</deployment>
<method v="2" />
</configuration>
</component>
</component>
2 changes: 1 addition & 1 deletion .run/ruoyi-resource.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="ruoyi-resource" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="ruoyi/ruoyi-resource:2.1.0" />
<option name="imageTag" value="ruoyi/ruoyi-resource:2.1.1" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="ruoyi-modules/ruoyi-resource/Dockerfile" />
</settings>
Expand Down
2 changes: 1 addition & 1 deletion .run/ruoyi-seata-server.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="ruoyi-seata-server" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="ruoyi/ruoyi-seata-server:2.1.0" />
<option name="imageTag" value="ruoyi/ruoyi-seata-server:2.1.1" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="ruoyi-visual/ruoyi-seata-server/Dockerfile" />
</settings>
Expand Down
2 changes: 1 addition & 1 deletion .run/ruoyi-sentinel-dashboard.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="ruoyi-sentinel-dashboard" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="ruoyi/ruoyi-sentinel-dashboard:2.1.0" />
<option name="imageTag" value="ruoyi/ruoyi-sentinel-dashboard:2.1.1" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="ruoyi-visual/ruoyi-sentinel-dashboard/Dockerfile" />
</settings>
Expand Down
2 changes: 1 addition & 1 deletion .run/ruoyi-system.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="ruoyi-system" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="imageTag" value="ruoyi/ruoyi-system:2.1.0" />
<option name="imageTag" value="ruoyi/ruoyi-system:2.1.1" />
<option name="buildOnly" value="true" />
<option name="sourceFilePath" value="ruoyi-modules/ruoyi-system/Dockerfile" />
</settings>
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://gitee.com/dromara/RuoYi-Cloud-Plus/blob/master/LICENSE)
[![使用IntelliJ IDEA开发维护](https://img.shields.io/badge/IntelliJ%20IDEA-提供支持-blue.svg)](https://www.jetbrains.com/?from=RuoYi-Cloud-Plus)
<br>
[![RuoYi-Cloud-Plus](https://img.shields.io/badge/RuoYi_Cloud_Plus-2.0.0-success.svg)](https://gitee.com/dromara/RuoYi-Cloud-Plus)
[![Spring Boot](https://img.shields.io/badge/Spring%20Boot-3.0-blue.svg)]()
[![RuoYi-Cloud-Plus](https://img.shields.io/badge/RuoYi_Cloud_Plus-2.1.1-success.svg)](https://gitee.com/dromara/RuoYi-Cloud-Plus)
[![Spring Boot](https://img.shields.io/badge/Spring%20Boot-3.1-blue.svg)]()
[![JDK-17](https://img.shields.io/badge/JDK-17-green.svg)]()
[![JDK-19](https://img.shields.io/badge/JDK-19-green.svg)]()
[![JDK-19](https://img.shields.io/badge/JDK-21-green.svg)]()

> RuoYi-Cloud-Plus `微服务通用权限管理系统` 重写 RuoYi-Cloud 全方位升级(不兼容原框架)
Expand Down
5 changes: 0 additions & 5 deletions config/nacos/application-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,6 @@ logging:
sa-token:
# token名称 (同时也是cookie名称)
token-name: Authorization
# token固定超时 设为七天 (必定过期) 单位: 秒
timeout: 604800
# 多端不同 token 有效期 可查看 LoginHelper.loginByDevice 方法自定义
# token最低活跃时间 (指定时间无操作就过期) 单位: 秒
active-timeout: 1800
# 开启内网服务调用鉴权(不允许越过gateway访问内网服务 保障服务安全)
check-same-token: true
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
Expand Down
1 change: 1 addition & 0 deletions config/nacos/ruoyi-resource.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ spring:
# password: ${datasource.system-postgres.password}

websocket:
# 如果关闭 需要和前端开关一起关闭
enabled: true
# 路径
path: /websocket
Expand Down
22 changes: 11 additions & 11 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ services:
network_mode: "host"

nacos:
image: ruoyi/ruoyi-nacos:2.1.0
image: ruoyi/ruoyi-nacos:2.1.1
container_name: nacos
ports:
- "8848:8848"
Expand Down Expand Up @@ -96,7 +96,7 @@ services:
network_mode: "host"

seata-server:
image: ruoyi/ruoyi-seata-server:2.1.0
image: ruoyi/ruoyi-seata-server:2.1.1
container_name: seata-server
ports:
- "7091:7091"
Expand Down Expand Up @@ -135,7 +135,7 @@ services:
network_mode: "host"

sentinel:
image: ruoyi/ruoyi-sentinel-dashboard:2.1.0
image: ruoyi/ruoyi-sentinel-dashboard:2.1.1
container_name: sentinel
environment:
TZ: Asia/Shanghai
Expand All @@ -150,7 +150,7 @@ services:
network_mode: "host"

ruoyi-monitor:
image: ruoyi/ruoyi-monitor:2.1.0
image: ruoyi/ruoyi-monitor:2.1.1
container_name: ruoyi-monitor
environment:
# 时区上海
Expand All @@ -166,7 +166,7 @@ services:
network_mode: "host"

ruoyi-powerjob-server:
image: ruoyi/ruoyi-powerjob-server:2.1.0
image: ruoyi/ruoyi-powerjob-server:2.1.1
container_name: ruoyi-powerjob-server
environment:
# 时区上海
Expand All @@ -181,7 +181,7 @@ services:
network_mode: "host"

ruoyi-gateway:
image: ruoyi/ruoyi-gateway:2.1.0
image: ruoyi/ruoyi-gateway:2.1.1
container_name: ruoyi-gateway
environment:
# 时区上海
Expand All @@ -197,7 +197,7 @@ services:
network_mode: "host"

ruoyi-auth:
image: ruoyi/ruoyi-auth:2.1.0
image: ruoyi/ruoyi-auth:2.1.1
container_name: ruoyi-auth
environment:
# 时区上海
Expand All @@ -213,7 +213,7 @@ services:
network_mode: "host"

ruoyi-system:
image: ruoyi/ruoyi-system:2.1.0
image: ruoyi/ruoyi-system:2.1.1
container_name: ruoyi-system
environment:
# 时区上海
Expand All @@ -229,7 +229,7 @@ services:
network_mode: "host"

ruoyi-gen:
image: ruoyi/ruoyi-gen:2.1.0
image: ruoyi/ruoyi-gen:2.1.1
container_name: ruoyi-gen
environment:
# 时区上海
Expand All @@ -245,7 +245,7 @@ services:
network_mode: "host"

ruoyi-job:
image: ruoyi/ruoyi-job:2.1.0
image: ruoyi/ruoyi-job:2.1.1
container_name: ruoyi-job
environment:
# 时区上海
Expand All @@ -261,7 +261,7 @@ services:
network_mode: "host"

ruoyi-resource:
image: ruoyi/ruoyi-resource:2.1.0
image: ruoyi/ruoyi-resource:2.1.1
container_name: ruoyi-resource
environment:
# 时区上海
Expand Down
4 changes: 4 additions & 0 deletions docker/nginx/conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ http {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# websocket参数
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://server/;
}

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<description>RuoYi-Cloud-Plus微服务系统</description>

<properties>
<revision>2.1.0</revision>
<revision>2.1.1</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
Expand Down
2 changes: 1 addition & 1 deletion ruoyi-api/ruoyi-api-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</description>

<properties>
<revision>2.1.0</revision>
<revision>2.1.1</revision>
</properties>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.dromara.resource.api;

/**
* 消息服务
*
* @author Lion Li
*/
public interface RemoteMessageService {

/**
* 发送消息
*
* @param sessionKey session主键 一般为用户id
* @param message 消息文本
*/
void sendMessage(Long sessionKey, String message);

void publishAll(String message);
}
4 changes: 4 additions & 0 deletions ruoyi-auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>ruoyi-api-resource</artifactId>
</dependency>

<!-- 自定义负载均衡(多团队开发使用) -->
<!-- <dependency>-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@
import org.dromara.auth.domain.vo.LoginVo;
import org.dromara.auth.domain.vo.TenantListVo;
import org.dromara.auth.form.RegisterBody;
import org.dromara.auth.form.SocialLoginBody;
import org.dromara.auth.service.IAuthStrategy;
import org.dromara.auth.service.SysLoginService;
import org.dromara.common.core.constant.UserConstants;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.domain.model.LoginBody;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.MessageUtils;
import org.dromara.common.core.utils.StreamUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.core.utils.*;
import org.dromara.common.json.utils.JsonUtils;
import org.dromara.common.satoken.utils.LoginHelper;
import org.dromara.common.social.config.properties.SocialLoginConfigProperties;
import org.dromara.common.social.config.properties.SocialProperties;
import org.dromara.common.social.utils.SocialUtils;
import org.dromara.common.tenant.helper.TenantHelper;
import org.dromara.resource.api.RemoteMessageService;
import org.dromara.system.api.RemoteClientService;
import org.dromara.system.api.RemoteConfigService;
import org.dromara.system.api.RemoteSocialService;
Expand All @@ -38,6 +39,8 @@

import java.net.URL;
import java.util.List;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
* token 控制
Expand All @@ -52,6 +55,7 @@ public class TokenController {

private final SocialProperties socialProperties;
private final SysLoginService sysLoginService;
private final ScheduledExecutorService scheduledExecutorService;

@DubboReference
private final RemoteConfigService remoteConfigService;
Expand All @@ -61,12 +65,19 @@ public class TokenController {
private final RemoteClientService remoteClientService;
@DubboReference
private final RemoteSocialService remoteSocialService;
@DubboReference
private final RemoteMessageService remoteMessageService;

/**
* 登录方法
*
* @param body 登录信息
* @return 结果
*/
@PostMapping("login")
public R<LoginVo> login(@Validated @RequestBody LoginBody loginBody) {
@PostMapping("/login")
public R<LoginVo> login(@Validated @RequestBody String body) {
LoginBody loginBody = JsonUtils.parseObject(body, LoginBody.class);
ValidatorUtils.validate(loginBody);
// 授权类型和客户端id
String clientId = loginBody.getClientId();
String grantType = loginBody.getGrantType();
Expand All @@ -82,7 +93,13 @@ public R<LoginVo> login(@Validated @RequestBody LoginBody loginBody) {
// 校验租户
sysLoginService.checkTenant(loginBody.getTenantId());
// 登录
return R.ok(IAuthStrategy.login(loginBody, clientVo));
LoginVo loginVo = IAuthStrategy.login(body, clientVo, grantType);

Long userId = LoginHelper.getUserId();
scheduledExecutorService.schedule(() -> {
remoteMessageService.sendMessage(userId, "欢迎登录RuoYi-Cloud-Plus微服务管理系统");
}, 3, TimeUnit.SECONDS);
return R.ok(loginVo);
}

/**
Expand All @@ -109,9 +126,11 @@ public R<String> authBinding(@PathVariable("source") String source) {
* @return 结果
*/
@PostMapping("/social/callback")
public R<Void> socialCallback(@RequestBody LoginBody loginBody) {
public R<Void> socialCallback(@RequestBody SocialLoginBody loginBody) {
// 获取第三方登录信息
AuthResponse<AuthUser> response = SocialUtils.loginAuth(loginBody, socialProperties);
AuthResponse<AuthUser> response = SocialUtils.loginAuth(
loginBody.getSource(), loginBody.getSocialCode(),
loginBody.getSocialState(), socialProperties);
AuthUser authUserData = response.getData();
// 判断授权响应是否成功
if (!response.ok()) {
Expand Down
Loading

0 comments on commit 8b6a61a

Please sign in to comment.