Browse Source

Merge branch 'dev_v1.3.4_20220909' of http://git.dayaedu.com/yonge/cooleshow into dev_v1.3.4_20220909

Eric 2 years ago
parent
commit
3f613b4191

+ 2 - 2
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/config/ResourceServerConfig.java

@@ -25,8 +25,8 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 	@Override
 	public void configure(HttpSecurity http) throws Exception {
 		http.csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler).authenticationEntryPoint(baseAuthenticationEntryPoint).and()
-				.authorizeRequests().antMatchers("/task/**").hasIpAddress("0.0.0.0/0")
-				// .authorizeRequests().antMatchers("/task/**").permitAll()
+				// .authorizeRequests().antMatchers("/task/**").hasIpAddress("0.0.0.0/0")
+				.authorizeRequests().antMatchers("/task/**").permitAll()
 				.antMatchers("/v2/api-docs", "/code/*", "/api/*", "/appVersionInfo/queryByPlatform", "/uploadFile","/open/**").permitAll().anyRequest().authenticated()
 				.and().httpBasic();
 	}

+ 4 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/ActivityRewardServiceImpl.java

@@ -270,7 +270,7 @@ public class ActivityRewardServiceImpl extends ServiceImpl<ActivityRewardDao, Ac
         List<Long> activityRewardIdList = new ArrayList<>();
         List<String> rewardNameList = new ArrayList<>();
         try {
-            // lock.lock();
+            lock.lock();
             for (ActivityReward activityReward : activityRewards) {
                 int update = activityPlanRewardService.reduceStock(activityId, activityReward.getId());
                 if (update == 0) {
@@ -311,7 +311,9 @@ public class ActivityRewardServiceImpl extends ServiceImpl<ActivityRewardDao, Ac
                 sendActivityMessage(userId, activityPlan.getActivityName(),name, activityPlan.getActivityClient());
             }
         } finally {
-            lock.unlock();
+            if (lock.getHoldCount() != 0 && lock.isHeldByCurrentThread()) {
+                lock.unlock();
+            }
         }
 
         return activityRewardIdList;

+ 1 - 1
toolset/toolset-payment/src/main/java/com/yonge/toolset/payment/util/DistributedLock.java

@@ -160,7 +160,7 @@ public class DistributedLock {
      * 解锁
      */
     public void unlock(RLock lock) {
-        if (lock.getHoldCount() != 0) {
+        if (lock.getHoldCount() != 0 && lock.isHeldByCurrentThread()) {
             lock.unlock();
         }
     }