From 0d26f2f6d7837c851d84e1a91aaa021ccea59fd1 Mon Sep 17 00:00:00 2001 From: xiaoming <31494286+gitdq1016@users.noreply.github.com> Date: Sun, 28 Jul 2024 16:17:59 +0800 Subject: [PATCH] remove some permission check --- .../java/com/dl/officialsite/admin/AdminController.java | 5 +++-- .../java/com/dl/officialsite/bounty/BountyController.java | 3 +-- .../java/com/dl/officialsite/hiring/HireController.java | 4 ++-- .../java/com/dl/officialsite/login/filter/LoginFilter.java | 6 ++++++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/dl/officialsite/admin/AdminController.java b/src/main/java/com/dl/officialsite/admin/AdminController.java index 0476714c..90cd02c4 100644 --- a/src/main/java/com/dl/officialsite/admin/AdminController.java +++ b/src/main/java/com/dl/officialsite/admin/AdminController.java @@ -1,5 +1,6 @@ package com.dl.officialsite.admin; +import cn.hutool.core.util.StrUtil; import com.dl.officialsite.admin.vo.HireSearchParams; import com.dl.officialsite.bounty.BountyService; import com.dl.officialsite.bounty.vo.BountySearchVo; @@ -87,11 +88,11 @@ public BaseResponse deleteHire(@RequestParam String adminAddress, @RequestParam } @PostMapping("/bounty/all") - public BaseResponse allBounty(@RequestParam String adminAddress, + public BaseResponse allBounty(@RequestParam(required = false) String adminAddress, @RequestParam(defaultValue = "1") Integer pageNumber, @RequestParam(defaultValue = "10") Integer pageSize, @RequestBody BountySearchVo bountySearchParams) { - if (!teamService.checkMemberIsAdmin(adminAddress)) { + if (StrUtil.isNotEmpty(adminAddress) && !teamService.checkMemberIsAdmin(adminAddress)) { throw new BizException(CodeEnums.NOT_THE_ADMIN); } Pageable pageable = PageRequest.of(pageNumber - 1, pageSize, diff --git a/src/main/java/com/dl/officialsite/bounty/BountyController.java b/src/main/java/com/dl/officialsite/bounty/BountyController.java index 21bbdf2c..63d2747c 100644 --- a/src/main/java/com/dl/officialsite/bounty/BountyController.java +++ b/src/main/java/com/dl/officialsite/bounty/BountyController.java @@ -70,7 +70,6 @@ public BaseResponse list(@RequestBody BountySearchVo bountySearchVo, */ @GetMapping("/detail") public BaseResponse detail(@RequestParam Long id, - @RequestParam String address, @RequestParam(defaultValue = "1") Integer pageNumber, @RequestParam(defaultValue = "10") Integer pageSize) { BountyVo bountyVo = bountyService.findByIdInternal(id); @@ -81,7 +80,7 @@ public BaseResponse detail(@RequestParam Long id, * 查询bounty申请人下的信息 */ @GetMapping("/detail/member") - public BaseResponse detailMember(@RequestParam Long id, @RequestParam String address, + public BaseResponse detailMember(@RequestParam Long id, @RequestParam(defaultValue = "1") Integer pageNumber, @RequestParam(defaultValue = "10") Integer pageSize) { Pageable pageable = PageRequest.of(pageNumber - 1, pageSize, Sort.by(Sort.Direction.DESC, "createTime")); diff --git a/src/main/java/com/dl/officialsite/hiring/HireController.java b/src/main/java/com/dl/officialsite/hiring/HireController.java index fa8051af..c61bc1ac 100644 --- a/src/main/java/com/dl/officialsite/hiring/HireController.java +++ b/src/main/java/com/dl/officialsite/hiring/HireController.java @@ -58,7 +58,7 @@ public BaseResponse update(@RequestParam String address,@RequestBody HiringVO hi * 查询招聘详情 */ @GetMapping - public BaseResponse detail(@RequestParam String address,@RequestParam Long id) { + public BaseResponse detail(@RequestParam Long id) { HiringVO hiringVO = hireService.detail(id); return BaseResponse.successWithData(hiringVO); } @@ -67,7 +67,7 @@ public BaseResponse detail(@RequestParam String address,@RequestParam Long id) { * 查询所有招聘 */ @GetMapping("/all") - public BaseResponse all(@RequestParam String address, + public BaseResponse all( @RequestParam(defaultValue = "1") Integer pageNumber, @RequestParam(defaultValue = "10") Integer pageSize) { Pageable pageable = PageRequest.of(pageNumber - 1, pageSize, Sort.by(Sort.Direction.DESC, "createTime")); diff --git a/src/main/java/com/dl/officialsite/login/filter/LoginFilter.java b/src/main/java/com/dl/officialsite/login/filter/LoginFilter.java index 6de12100..04c0004c 100644 --- a/src/main/java/com/dl/officialsite/login/filter/LoginFilter.java +++ b/src/main/java/com/dl/officialsite/login/filter/LoginFilter.java @@ -62,6 +62,12 @@ public class LoginFilter extends OncePerRequestFilter { add("/bounty/list"); add("/nft/WarCraft"); add("/nft/raw/WarCraft"); + add("/admin/bounty/all"); + add("/bounty/list"); + add("/bounty/detail"); + add("/bounty/detail/member"); + add("/hire/all"); + add("/hire/detail"); }} ; private Set noAddrCheckApis = new HashSet() {{