From 495093fa6206fe1d518c2fb1bf08100c5746d3aa Mon Sep 17 00:00:00 2001 From: smallchill Date: Tue, 19 Nov 2019 12:46:14 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E6=B3=A8=E9=87=8Aseata=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=EF=BC=8Coauth=E4=BE=9D=E8=B5=96=E9=99=8D=E7=BA=A7?= =?UTF-8?q?=EF=BC=8C=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=89=E5=9D=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blade-auth/pom.xml | 2 +- .../auth/service/BladeUserDetailsServiceImpl.java | 6 +++--- blade-service/blade-desk/pom.xml | 4 ++-- .../src/main/java/org/springblade/desk/DeskApplication.java | 5 +++-- .../org/springblade/desk/service/impl/LeaveServiceImpl.java | 3 +-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/blade-auth/pom.xml b/blade-auth/pom.xml index ed039dda..b15df10b 100644 --- a/blade-auth/pom.xml +++ b/blade-auth/pom.xml @@ -57,7 +57,7 @@ org.springframework.security.oauth spring-security-oauth2 - 2.3.7.RELEASE + 2.3.5.RELEASE org.springframework.boot diff --git a/blade-auth/src/main/java/org/springblade/auth/service/BladeUserDetailsServiceImpl.java b/blade-auth/src/main/java/org/springblade/auth/service/BladeUserDetailsServiceImpl.java index 50a67185..755d278b 100644 --- a/blade-auth/src/main/java/org/springblade/auth/service/BladeUserDetailsServiceImpl.java +++ b/blade-auth/src/main/java/org/springblade/auth/service/BladeUserDetailsServiceImpl.java @@ -74,13 +74,13 @@ public class BladeUserDetailsServiceImpl implements UserDetailsService { // 判断返回信息 if (result.isSuccess()) { UserInfo userInfo = result.getData(); - if (Func.isEmpty(userInfo.getRoles())) { - throw new UserDeniedAuthorizationException(TokenUtil.USER_HAS_NO_ROLE); - } User user = userInfo.getUser(); if (user == null || user.getId() == null) { throw new UsernameNotFoundException(TokenUtil.USER_NOT_FOUND); } + if (Func.isEmpty(userInfo.getRoles())) { + throw new UserDeniedAuthorizationException(TokenUtil.USER_HAS_NO_ROLE); + } return new BladeUserDetails(user.getId(), user.getTenantId(), user.getName(), user.getRealName(), user.getDeptId(), user.getRoleId(), Func.join(result.getData().getRoles()), Func.toStr(user.getAvatar(), TokenUtil.DEFAULT_AVATAR), username, AuthConstant.ENCRYPT + user.getPassword(), true, true, true, true, diff --git a/blade-service/blade-desk/pom.xml b/blade-service/blade-desk/pom.xml index 817f1401..f1eb59e3 100644 --- a/blade-service/blade-desk/pom.xml +++ b/blade-service/blade-desk/pom.xml @@ -48,10 +48,10 @@ org.springblade blade-starter-qiniu - + diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/DeskApplication.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/DeskApplication.java index ef078981..56d9b46a 100644 --- a/blade-service/blade-desk/src/main/java/org/springblade/desk/DeskApplication.java +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/DeskApplication.java @@ -19,7 +19,7 @@ package org.springblade.desk; import org.springblade.core.cloud.feign.EnableBladeFeign; import org.springblade.core.launch.BladeApplication; import org.springblade.core.launch.constant.AppConstant; -import org.springblade.core.transaction.annotation.SeataCloudApplication; +import org.springframework.cloud.client.SpringCloudApplication; /** * Desk启动器 @@ -27,7 +27,8 @@ import org.springblade.core.transaction.annotation.SeataCloudApplication; * @author Chill */ @EnableBladeFeign -@SeataCloudApplication +@SpringCloudApplication +// @SeataCloudApplication public class DeskApplication { public static void main(String[] args) { diff --git a/blade-service/blade-desk/src/main/java/org/springblade/desk/service/impl/LeaveServiceImpl.java b/blade-service/blade-desk/src/main/java/org/springblade/desk/service/impl/LeaveServiceImpl.java index ac7f0468..73e7ec19 100644 --- a/blade-service/blade-desk/src/main/java/org/springblade/desk/service/impl/LeaveServiceImpl.java +++ b/blade-service/blade-desk/src/main/java/org/springblade/desk/service/impl/LeaveServiceImpl.java @@ -16,7 +16,6 @@ */ package org.springblade.desk.service.impl; -import io.seata.spring.annotation.GlobalTransactional; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.log.exception.ServiceException; @@ -50,8 +49,8 @@ public class LeaveServiceImpl extends BaseServiceImpl private IFlowClient flowClient; @Override - @GlobalTransactional @Transactional(rollbackFor = Exception.class) + // @GlobalTransactional public boolean startProcess(ProcessLeave leave) { String businessTable = FlowUtil.getBusinessTable(ProcessConstant.LEAVE_KEY); if (Func.isEmpty(leave.getId())) {