diff --git a/README.md b/README.md index 5c4bfd33..80825b32 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ curl --location --request POST 'localhost:8080/base/cloud/spi' \ --data-raw '{ "appId":"7264840234423027259", "authId":"4463798", -"method":"testTime", +"method":"RefreshTokenTimer", "data":"{\"moveShopSettingId\":6}" }' diff --git a/ms-biz/src/main/java/com/ms/api/task/RefreshTokenTimerTaskService.java b/ms-biz/src/main/java/com/ms/api/task/RefreshTokenTimerTaskService.java index f50d0b2a..285607b4 100644 --- a/ms-biz/src/main/java/com/ms/api/task/RefreshTokenTimerTaskService.java +++ b/ms-biz/src/main/java/com/ms/api/task/RefreshTokenTimerTaskService.java @@ -115,16 +115,19 @@ public class RefreshTokenTimerTaskService extends TaskBaseService { if (ObjectUtil.isEmpty(newAccessToken)) { E.throwMSException("获取accessToken失败"); } - if (ObjectUtil.isEmpty(newAccessToken)) { + if (newAccessToken.equals(oldAccessToken)) { + log.info("accessToken无需更新"); Map result = new HashMap(); result.put("msg", "accessToken无需更新"); - return R.ok(Ret.success()); + return true; } shop.setExpiresIn(newExpires.toString()); shop.setRefreshToken(SecurityTool.encodeByAES(newRefreshToken)); shop.setAccessToken(SecurityTool.encodeByAES(newAccessToken)); - shop.setGmtExpire(new Date(TimeTool.getDateTimeBySeconds(new Long(newExpires).intValue()))); - shop.setGmtModified(new Date(TimeTool.getDateTimeBySeconds(0))); + log.info("oldAccessToken:"+oldAccessToken); + log.info("newAccessToken"+newAccessToken); + shop.setGmtExpire(DateUtil.parseDateTime(TimeTool.getDateTimeBySeconds(new Long(newExpires).intValue()))); + shop.setGmtModified(DateUtil.parseDateTime(TimeTool.getDateTimeBySeconds(0))); shopService.updateByPrimaryKey(shop); } return true; diff --git a/ms-dal/src/main/resources/mapper/ShopMapper.xml b/ms-dal/src/main/resources/mapper/ShopMapper.xml index 1960f5dd..a8d9bd45 100644 --- a/ms-dal/src/main/resources/mapper/ShopMapper.xml +++ b/ms-dal/src/main/resources/mapper/ShopMapper.xml @@ -151,10 +151,10 @@ gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} where shop_id = #{shopId,jdbcType=BIGINT} - select from shop - where gmt_expire < #{gmtExpireStart,jdbcType=TIMESTAMP} and gmt_expire > #{gmtExpireEnd,jdbcType=TIMESTAMP} + where gmt_expire < #{gmtExpireStart} and gmt_expire > #{gmtExpireEnd}