From 6ce581047bf195a636dfe6d675d289a4e33b0476 Mon Sep 17 00:00:00 2001 From: Gary Date: Fri, 26 Jan 2024 13:23:39 +0800 Subject: [PATCH] 1.add auth check for journal/song/myInfo --- .../main/java/com/luoo/music/controller/JournalController.java | 2 +- .../main/java/com/luoo/music/controller/SongController.java | 2 +- .../src/main/java/com/luoo/user/controller/MyController.java | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/luoo_music/src/main/java/com/luoo/music/controller/JournalController.java b/luoo_music/src/main/java/com/luoo/music/controller/JournalController.java index b50c166..004dc6b 100644 --- a/luoo_music/src/main/java/com/luoo/music/controller/JournalController.java +++ b/luoo_music/src/main/java/com/luoo/music/controller/JournalController.java @@ -73,7 +73,7 @@ public class JournalController { @ApiImplicitParam(name = "pageSize", value = "分页: 每页数量", required = true) }) @GetMapping("/collect/{userId}/{pageNum}/{pageSize}") - @GlobalInterceptor + @GlobalInterceptor(checkAppUserLogin = true) public Result> collectPage( @PathVariable @VerifyParam(required = true)String userId, @PathVariable @VerifyParam(required = true)Integer pageNum, diff --git a/luoo_music/src/main/java/com/luoo/music/controller/SongController.java b/luoo_music/src/main/java/com/luoo/music/controller/SongController.java index d4fb322..d1455d5 100644 --- a/luoo_music/src/main/java/com/luoo/music/controller/SongController.java +++ b/luoo_music/src/main/java/com/luoo/music/controller/SongController.java @@ -80,7 +80,7 @@ public class SongController { @ApiImplicitParam(name = "pageSize", value = "分页: 每页数量", required = true) }) @GetMapping("/collect/{userId}/{pageNum}/{pageSize}") - @GlobalInterceptor + @GlobalInterceptor(checkAppUserLogin = true) public Result> collectPage( @PathVariable @VerifyParam(required = true)String userId, @PathVariable @VerifyParam(required = true)Integer pageNum, diff --git a/luoo_user/src/main/java/com/luoo/user/controller/MyController.java b/luoo_user/src/main/java/com/luoo/user/controller/MyController.java index ed267c1..a7587f4 100644 --- a/luoo_user/src/main/java/com/luoo/user/controller/MyController.java +++ b/luoo_user/src/main/java/com/luoo/user/controller/MyController.java @@ -173,8 +173,7 @@ public class MyController extends BaseController { @ApiOperation(value = "4.查看他人信息", notes = "游客无法查看他人信息") @GetMapping("/getOtherUserInfo/{userId}") @GlobalInterceptor(checkAppUserLogin = true) - public Result getOtherUserInfo(@RequestHeader(value = "token", required = false) String token, - @VerifyParam(required = true) @PathVariable String userId) { + public Result getOtherUserInfo(@VerifyParam(required = true) @PathVariable String userId) { UserInfo user = userInfoService.findById(userId); if (null == user) { return Result.failed(StatusCode.USER_INVALID_USER_ID);