Skip to content

Commit

Permalink
chore: 移除对部分 API 重复的权限校验
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Apr 29, 2024
1 parent 9a1a472 commit 53eaef9
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -49,14 +48,12 @@
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -48,14 +47,12 @@
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,13 @@
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 = "重置用户登录密码")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
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;
Expand All @@ -54,7 +53,6 @@
@RequestMapping("/generator")
public class GeneratorController {

private final ProjectProperties projectProperties;
private final GeneratorService generatorService;

@Operation(summary = "分页查询数据表", description = "分页查询数据表")
Expand Down

0 comments on commit 53eaef9

Please sign in to comment.