fix(aihr): require login for position sop navigation
This commit is contained in:
+1
-2
@@ -2,7 +2,6 @@ package org.dromara.aihr.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckLogin;
|
||||
import cn.dev33.satoken.annotation.SaCheckRole;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -102,8 +101,8 @@ public class AihrSopController {
|
||||
return new SearchRequest(request.queryText(), request.category(), request.position(), "knowledge_search", request.limit());
|
||||
}
|
||||
|
||||
@SaCheckLogin
|
||||
@GetMapping("/position-sop")
|
||||
@SaIgnore
|
||||
public R<PositionSopResponse> positionSop(@RequestParam(required = false) String position,
|
||||
@RequestParam(required = false) String projectType) {
|
||||
return R.ok(sopSeedService.positionSop(position, projectType));
|
||||
|
||||
+13
@@ -231,6 +231,19 @@ public class AihrSopSeedServiceTest {
|
||||
assertTrue(code.contains("restrictDemoVerificationSource(request)"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Tag("dev")
|
||||
public void positionSopSummaryRequiresLogin() throws Exception {
|
||||
Path source = Path.of("src/main/java/org/dromara/aihr/controller/AihrSopController.java");
|
||||
if (!Files.exists(source)) {
|
||||
source = Path.of("ruoyi-modules/ruoyi-aihr/src/main/java/org/dromara/aihr/controller/AihrSopController.java");
|
||||
}
|
||||
String code = Files.readString(source);
|
||||
|
||||
assertTrue(code.contains("@SaCheckLogin\n @GetMapping(\"/position-sop\")"));
|
||||
assertFalse(code.contains("@SaIgnore\n @GetMapping(\"/position-sop\")"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Tag("dev")
|
||||
public void answerFeedbackReviewUsesAuthenticatedOperatorForAuditTrail() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user