diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/oj/DiscussionController.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/oj/DiscussionController.java index 37418c11..c3ad89f9 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/oj/DiscussionController.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/controller/oj/DiscussionController.java @@ -49,7 +49,7 @@ public class DiscussionController { private DiscussionReportServiceImpl discussionReportService; @GetMapping("/discussions") - public CommonResult getDiscussionList(@RequestParam(value = "limit", required = false, defaultValue = "15") Integer limit, + public CommonResult getDiscussionList(@RequestParam(value = "limit", required = false, defaultValue = "8") Integer limit, @RequestParam(value = "currentPage", required = false, defaultValue = "1") Integer currentPage, @RequestParam(value = "cid", required = false) Integer categoryId, @RequestParam(value = "pid", required = false) String pid, diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/utils/JwtUtils.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/utils/JwtUtils.java index 489c7bac..ab20b752 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/utils/JwtUtils.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/utils/JwtUtils.java @@ -28,6 +28,7 @@ public class JwtUtils { @Autowired private RedisUtils redisUtils; + /** * 生成jwt token */ @@ -43,8 +44,8 @@ public class JwtUtils { .setExpiration(expireDate) .signWith(SignatureAlgorithm.HS512, secret) .compact(); - redisUtils.set(TOKEN_REFRESH+userId, token,checkRefreshExpire); - redisUtils.set(TOKEN_KEY+userId,token,expire); + redisUtils.set(TOKEN_REFRESH + userId, token, checkRefreshExpire); + redisUtils.set(TOKEN_KEY + userId, token, expire); return token; } @@ -54,7 +55,7 @@ public class JwtUtils { .setSigningKey(secret) .parseClaimsJws(token) .getBody(); - }catch (Exception e){ + } catch (Exception e) { log.debug("validate is token error ", e); return null; } @@ -62,7 +63,8 @@ public class JwtUtils { /** * token是否过期 - * @return true:过期 + * + * @return true:过期 */ public boolean isTokenExpired(Date expiration) { return expiration.before(new Date()); diff --git a/hoj-vue/src/views/oj/discussion/discussionList.vue b/hoj-vue/src/views/oj/discussion/discussionList.vue index b286209d..1a5d554f 100644 --- a/hoj-vue/src/views/oj/discussion/discussionList.vue +++ b/hoj-vue/src/views/oj/discussion/discussionList.vue @@ -497,7 +497,7 @@ export default { getDiscussionList() { let queryParams = Object.assign({}, this.query); this.loading.discussion = true; - api.getDiscussionList(this.limit, queryParams).then( + api.getDiscussionList(this.query.limit, queryParams).then( (res) => { this.total = res.data.data.total; this.discussionList = res.data.data.records;