2024.4.12
加入了SaToken的注解鉴权
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.hongliang.videotask.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.hongliang.videotask.bean.LoginBean;
|
||||
import com.hongliang.videotask.bean.LoginResultBean;
|
||||
@@ -56,8 +57,9 @@ public class UserControl {
|
||||
return ResponseEntity.ok(new Response(ResponseCode.OK,"成功退出",null));
|
||||
}
|
||||
|
||||
@GetMapping("getuserbyid")
|
||||
public ResponseEntity<?> GetUserByID(@RequestParam("id") int id){
|
||||
@SaCheckLogin
|
||||
@GetMapping("/user/{id}")
|
||||
public ResponseEntity<?> GetUserByID(@PathVariable("id") int id){
|
||||
return ResponseEntity.ok(new Response(ResponseCode.OK,"成功",userService.GetUserByID(id)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user