瀏覽代碼

Merge remote-tracking branch 'origin/package' into package

wcc 11 月之前
父節點
當前提交
2a98c6475d

+ 1 - 1
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/PitcherDataServiceImpl.java

@@ -2125,7 +2125,7 @@ public class PitcherDataServiceImpl implements IPitcherDataService {
                 //得到需要计算的值
                 String[] temps = ((String) dayNTotalFieldMap.getT1().get(vo)).split("/");
                 //dn的金额总计
-                BigDecimal dNAmount = new BigDecimal(temps[0]);
+                BigDecimal dNAmount = new BigDecimal(temps[0]).setScale(2, RoundingMode.HALF_UP);
                 //d1-dn的金额总计
                 BigDecimal d1ToDNTotalAmount = new BigDecimal(temps[1]);
                 //d1-dn的消耗总计(排除了未到时间的cost)

+ 1 - 1
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/SDKApplication.java

@@ -23,7 +23,7 @@ public class SDKApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(SDKApplication.class, args);
-        System.out.println("赞象SDK服务启动成功 <游戏表新增字段> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象SDK服务启动成功 <解决token重复重现的问题> ( ´・・)ノ(._.`) \n" +
                 " ___________ _   __\n" +
                 "/  ___|  _  \\ | / /\n" +
                 "\\ `--.| | | | |/ / \n" +

+ 2 - 4
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/UserTokenServiceImpl.java

@@ -303,8 +303,8 @@ public class UserTokenServiceImpl extends ServiceImpl<UserTokenMapper, UserToken
     private UserToken tokenSave(Long userId, String token, Integer deviceType) {
         String lockKey = RedisKeyConstant.TOKEN_CREATE_LOCK + userId + "_" + deviceType;
         //上锁
-        if (!distributedLockComponent.doLock(lockKey, 0L, 3L, TimeUnit.MINUTES)) {
-            throw new BaseException("token创建中, 请勿重复请求!");
+        if (!distributedLockComponent.doLock(lockKey, 0L, 1L, TimeUnit.MINUTES)) {
+            throw new BaseException("操作频繁, 请1分钟后重试!");
         }
         try {
             UserToken userToken = UserToken.builder()
@@ -319,8 +319,6 @@ public class UserTokenServiceImpl extends ServiceImpl<UserTokenMapper, UserToken
             return userToken;
         } catch (Exception e) {
             throw new BaseException("创建token异常!");
-        } finally {
-            distributedLockComponent.unlock(lockKey);
         }
     }