chore: 移除对部分 API 重复的权限校验

This commit is contained in:
Charles7c 2024-04-29 21:27:30 +08:00
parent 9a1a472ec9
commit 53eaef9fbd
5 changed files with 4 additions and 11 deletions

View File

@ -49,6 +49,9 @@ public class CaptchaResp implements Serializable {
@Schema(description = "验证码图片Base64编码带图片格式data:image/gif;base64", example = "data:image/png;base64,iVBORw0KGgoAAAAN...")
private String img;
/**
* 过期时间戳
*/
@Schema(description = "过期时间戳", example = "1714376969409")
private Long expireTime;
}

View File

@ -16,7 +16,6 @@
package top.continew.admin.webapi.system;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -49,14 +48,12 @@ import top.continew.starter.web.model.R;
public class MenuController extends BaseController<MenuService, MenuResp, MenuResp, MenuQuery, MenuReq> {
@Override
@SaCheckPermission("system:menu:add")
public R<Long> add(@Validated(ValidateGroup.Crud.Add.class) @RequestBody MenuReq req) {
this.checkPath(req);
return super.add(req);
}
@Override
@SaCheckPermission("system:menu:update")
public R<Void> update(@Validated(ValidateGroup.Crud.Update.class) @RequestBody MenuReq req, @PathVariable Long id) {
this.checkPath(req);
return super.update(req, id);

View File

@ -16,7 +16,6 @@
package top.continew.admin.webapi.system;
import cn.dev33.satoken.annotation.SaCheckPermission;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
@ -48,14 +47,12 @@ import java.time.LocalDateTime;
public class NoticeController extends BaseController<NoticeService, NoticeResp, NoticeDetailResp, NoticeQuery, NoticeReq> {
@Override
@SaCheckPermission("system:notice:add")
public R<Long> add(@Validated(ValidateGroup.Crud.Add.class) @RequestBody NoticeReq req) {
this.checkTime(req);
return super.add(req);
}
@Override
@SaCheckPermission("system:notice:update")
public R<Void> update(@Validated(ValidateGroup.Crud.Update.class) @RequestBody NoticeReq req,
@PathVariable Long id) {
this.checkTime(req);

View File

@ -57,15 +57,13 @@ import top.continew.starter.web.model.R;
public class UserController extends BaseController<UserService, UserResp, UserDetailResp, UserQuery, UserReq> {
@Override
@SaCheckPermission("system:user:add")
public R<Long> add(@Validated(ValidateGroup.Crud.Add.class) @RequestBody UserReq req) {
String rawPassword = ExceptionUtils.exToNull(() -> SecureUtils.decryptByRsaPrivateKey(req.getPassword()));
ValidationUtils.throwIfNull(rawPassword, "密码解密失败");
ValidationUtils.throwIf(!ReUtil
.isMatch(RegexConstants.PASSWORD, rawPassword), "密码长度为 6 到 32 位,可以包含字母、数字、下划线,特殊字符,同时包含字母和数字");
req.setPassword(rawPassword);
Long id = baseService.add(req);
return R.ok("新增成功", id);
return super.add(req);
}
@Operation(summary = "重置密码", description = "重置用户登录密码")

View File

@ -33,7 +33,6 @@ import top.continew.admin.generator.model.req.GenConfigReq;
import top.continew.admin.generator.model.resp.GeneratePreviewResp;
import top.continew.admin.generator.model.resp.TableResp;
import top.continew.admin.generator.service.GeneratorService;
import top.continew.starter.core.autoconfigure.project.ProjectProperties;
import top.continew.starter.extension.crud.model.query.PageQuery;
import top.continew.starter.extension.crud.model.resp.PageResp;
import top.continew.starter.web.model.R;
@ -54,7 +53,6 @@ import java.util.List;
@RequestMapping("/generator")
public class GeneratorController {
private final ProjectProperties projectProperties;
private final GeneratorService generatorService;
@Operation(summary = "分页查询数据表", description = "分页查询数据表")