权限管理-token管理权限修改

This commit is contained in:
liuzhaotian
2025-03-10 14:33:50 +08:00
parent b7e371ffa8
commit dbbf8f1bca
@@ -14,6 +14,7 @@ import com.cf.imes.module.system.dal.dataobject.tokenconfig.TokenConfigDO;
import com.cf.imes.module.system.service.tokenconfig.TokenConfigService; import com.cf.imes.module.system.service.tokenconfig.TokenConfigService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -42,7 +43,7 @@ public class TokenConfigController {
@GetMapping() @GetMapping()
@Operation(summary = "获得token配置的分页列表") @Operation(summary = "获得token配置的分页列表")
// @PreAuthorize("@ss.hasAnyPermissions('system:token:query')") @PreAuthorize("@ss.hasAnyPermissions('system:token:query')")
public CommonResult<PageResult<TokenConfigRespVO>> getTokenConfigPage(@Valid TokenConfigPageReqVO pageReqVO) { public CommonResult<PageResult<TokenConfigRespVO>> getTokenConfigPage(@Valid TokenConfigPageReqVO pageReqVO) {
PageResult<TokenConfigRespVO> pageResult = tokenConfigService.getTokenConfigPage(pageReqVO); PageResult<TokenConfigRespVO> pageResult = tokenConfigService.getTokenConfigPage(pageReqVO);
@@ -54,7 +55,7 @@ public class TokenConfigController {
@GetMapping("/{id}") @GetMapping("/{id}")
@Operation(summary = "根据ID获取对应的token配置信息") @Operation(summary = "根据ID获取对应的token配置信息")
// @PreAuthorize("@ss.hasAnyPermissions('system:token:query')") @PreAuthorize("@ss.hasAnyPermissions('system:token:query','system:token:update')")
public CommonResult<TokenConfigRespVO> getTokenConConfig(@PathVariable("id") Long id) { public CommonResult<TokenConfigRespVO> getTokenConConfig(@PathVariable("id") Long id) {
TokenConfigDO tokenConConfig = tokenConfigService.getTokenConConfig(id); TokenConfigDO tokenConConfig = tokenConfigService.getTokenConConfig(id);
return success(BeanUtils.toBean(tokenConConfig, TokenConfigRespVO.class)); return success(BeanUtils.toBean(tokenConConfig, TokenConfigRespVO.class));
@@ -64,7 +65,7 @@ public class TokenConfigController {
@PostMapping() @PostMapping()
@Operation(summary = "token配置新增") @Operation(summary = "token配置新增")
// @PreAuthorize("@ss.hasAnyPermissions('system:token:create')") @PreAuthorize("@ss.hasAnyPermissions('system:token:create')")
public CommonResult<Boolean> insertTokenConfig(@Valid @RequestBody TokenConfigSaveReqVO reqVO) { public CommonResult<Boolean> insertTokenConfig(@Valid @RequestBody TokenConfigSaveReqVO reqVO) {
tokenConfigService.insertTokenConfig(reqVO); tokenConfigService.insertTokenConfig(reqVO);
return success(true); return success(true);
@@ -74,7 +75,7 @@ public class TokenConfigController {
@PutMapping() @PutMapping()
@Operation(summary = "token配置修改") @Operation(summary = "token配置修改")
// @PreAuthorize("@ss.hasAnyPermissions('system:token:update')") @PreAuthorize("@ss.hasAnyPermissions('system:token:update')")
public CommonResult<Boolean> updateTokenConfig(@Valid @RequestBody TokenConfigSaveReqVO reqVO) { public CommonResult<Boolean> updateTokenConfig(@Valid @RequestBody TokenConfigSaveReqVO reqVO) {
tokenConfigService.updateTokenConfig(reqVO); tokenConfigService.updateTokenConfig(reqVO);
return success(true); return success(true);
@@ -84,7 +85,7 @@ public class TokenConfigController {
@DeleteMapping("/{id}") @DeleteMapping("/{id}")
@Operation(summary = "token配置删除") @Operation(summary = "token配置删除")
// @PreAuthorize("@ss.hasPermission('system:token:delete')") @PreAuthorize("@ss.hasPermission('system:token:delete')")
public CommonResult<Boolean> deleteTokenConfig(@PathVariable("id") Long id) { public CommonResult<Boolean> deleteTokenConfig(@PathVariable("id") Long id) {
tokenConfigService.deleteTokenConfig(id); tokenConfigService.deleteTokenConfig(id);
return success(true); return success(true);
@@ -95,7 +96,6 @@ public class TokenConfigController {
@GetMapping("/check") @GetMapping("/check")
@Operation(summary = "token校验") @Operation(summary = "token校验")
// @PreAuthorize("@ss.hasAnyPermissions('system:base-setting:query','unplannedOrders:query','placeorder:query')")
public CommonResult<Long> checkTokenConfig(@RequestParam("token") String token) { public CommonResult<Long> checkTokenConfig(@RequestParam("token") String token) {
return success(tokenConfigService.checkTokenConfig(token)); return success(tokenConfigService.checkTokenConfig(token));
@@ -105,7 +105,7 @@ public class TokenConfigController {
@GetMapping("/copy") @GetMapping("/copy")
@Operation(summary = "token复制") @Operation(summary = "token复制")
// @PreAuthorize("@ss.hasAnyPermissions('system:base-setting:query','unplannedOrders:query','placeorder:query')") @PreAuthorize("@ss.hasPermission('system:token:copy')")
public CommonResult<String> tokenConfigCopy(@RequestParam("id") Long id) { public CommonResult<String> tokenConfigCopy(@RequestParam("id") Long id) {
return success(tokenConfigService.tokenConfigCopy(id)); return success(tokenConfigService.tokenConfigCopy(id));
@@ -116,7 +116,7 @@ public class TokenConfigController {
@GetMapping("/export") @GetMapping("/export")
@Operation(summary = "导出配置信息") @Operation(summary = "导出配置信息")
// @PreAuthorize("@ss.hasAnyPermissions('system:token:export')") @PreAuthorize("@ss.hasAnyPermissions('system:token:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
public void exportTokenConfigExcel(@Valid TokenConfigPageReqVO pageReqVO, public void exportTokenConfigExcel(@Valid TokenConfigPageReqVO pageReqVO,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {