抖店token刷新,测试完善

20230922-ljl-fixBug
cxxxxxxx详 1 year ago
parent b0880269e6
commit 1231da0912

@ -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}"
}'

@ -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;

@ -151,10 +151,10 @@
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where shop_id = #{shopId,jdbcType=BIGINT}
</update>
<select id="getExpiresTokenShops" parameterType="java.lang.Long" resultMap="BaseResultMap">
<select id="getExpiresTokenShops" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from shop
where gmt_expire &lt; #{gmtExpireStart,jdbcType=TIMESTAMP} and gmt_expire &gt; #{gmtExpireEnd,jdbcType=TIMESTAMP}
where gmt_expire &lt; #{gmtExpireStart} and gmt_expire &gt; #{gmtExpireEnd}
</select>
</mapper>

Loading…
Cancel
Save