Browse Source

🐛 注释seata模块,oauth依赖降级,最新版有坑

test
smallchill 5 years ago
parent
commit
495093fa62
  1. 2
      blade-auth/pom.xml
  2. 6
      blade-auth/src/main/java/org/springblade/auth/service/BladeUserDetailsServiceImpl.java
  3. 4
      blade-service/blade-desk/pom.xml
  4. 5
      blade-service/blade-desk/src/main/java/org/springblade/desk/DeskApplication.java
  5. 3
      blade-service/blade-desk/src/main/java/org/springblade/desk/service/impl/LeaveServiceImpl.java

2
blade-auth/pom.xml

@ -57,7 +57,7 @@
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.3.7.RELEASE</version>
<version>2.3.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>

6
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,

4
blade-service/blade-desk/pom.xml

@ -48,10 +48,10 @@
<groupId>org.springblade</groupId>
<artifactId>blade-starter-qiniu</artifactId>
</dependency>
<dependency>
<!--<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-starter-transaction</artifactId>
</dependency>
</dependency>-->
</dependencies>
<build>

5
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) {

3
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<LeaveMapper, ProcessLeave>
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())) {

Loading…
Cancel
Save