update fe

This commit is contained in:
Himit_ZH 2021-10-05 12:12:03 +08:00
parent 817265dad8
commit ff074676ff
3 changed files with 8 additions and 6 deletions

View File

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

View File

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

View File

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