完成部分权限的认证操作的迁移
This commit is contained in:
@@ -7,9 +7,7 @@ import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
@@ -22,7 +20,7 @@ public class SysAuthLoginReqVO {
|
||||
|
||||
@ApiModelProperty(value = "账号", required = true, example = "yudaoyuanma")
|
||||
@NotEmpty(message = "登陆账号不能为空")
|
||||
@Length(min = 5, max = 16, message = "账号长度为 5-16 位")
|
||||
@Length(min = 4, max = 16, message = "账号长度为 4-16 位")
|
||||
@Pattern(regexp = "^[A-Za-z0-9]+$", message = "账号格式为数字以及字母")
|
||||
private String username;
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
### 请求 /system/user/page 接口 => 没有权限
|
||||
GET {{baseUrl}}/system/user/page?pageNo=1&pageSize=10
|
||||
Authorization: Bearer test104 # 使用测试账号
|
||||
@@ -18,6 +18,7 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -41,7 +42,7 @@ public class SysUserController {
|
||||
|
||||
@ApiOperation("获得用户分页列表")
|
||||
@GetMapping("/page")
|
||||
// @PreAuthorize("@ss.hasPermi('system:user:list')")
|
||||
@PreAuthorize("@ss.hasPermission('system:user:list')")
|
||||
public CommonResult<PageResult<SysUserPageItemRespVO>> pageUsers(@Validated SysUserPageReqVO reqVO) {
|
||||
// 获得用户分页列表
|
||||
PageResult<SysUserDO> pageResult = userService.pageUsers(reqVO);
|
||||
|
||||
Reference in New Issue
Block a user