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