张涛 1 year ago
parent
commit
23756635ec

+ 3
- 2
application/src/main/java/com/lyg/application/controller/TaMandatoryLeaveController.java View File

@@ -50,8 +50,9 @@ public class TaMandatoryLeaveController extends BaseController {
50 50
     @GetMapping("/taMandatoryLeave/{id}")
51 51
     public SaResult queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
52 52
         TaMandatoryLeave taMandatoryLeave = taMandatoryLeaveService.getById(id);
53
-        Boolean b = checkAuth() == null || checkAuth() == taMandatoryLeave.getCreateUser();
54
-
53
+        String isAdmin = checkAuth();
54
+        Boolean b = false;
55
+        b = (isAdmin == null) ? true : (isAdmin.equals(taMandatoryLeave.getCreateUser())) ? true : false;
55 56
         if (b) {
56 57
             return SaResult.data(taMandatoryLeaveService.getById(id));
57 58
         }

+ 3
- 4
application/src/main/java/com/lyg/application/controller/TaMessageController.java View File

@@ -44,10 +44,9 @@ public class TaMessageController extends BaseController {
44 44
     public SaResult queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
45 45
         TaMessage taMessage = taMessageService.getById(id);
46 46
 
47
-
48
-        System.out.println("checkAuth()" + checkAuth());
49
-        Boolean b = checkAuth() == null || checkAuth() == taMessage.getCreateUser();
50
-
47
+        String isAdmin = checkAuth();
48
+        Boolean b = false;
49
+        b = (isAdmin == null) ? true : (isAdmin.equals(taMessage.getCreateUser())) ? true : false;
51 50
         if (b) {
52 51
             return SaResult.data(taMessageService.getById(id));
53 52
         }

+ 3
- 2
application/src/main/java/com/lyg/application/controller/TaRotationController.java View File

@@ -55,8 +55,9 @@ public class TaRotationController extends BaseController {
55 55
     public SaResult queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
56 56
 
57 57
         TaRotation taRotation = taRotationService.getById(id);
58
-
59
-        Boolean b = checkAuth() == null || checkAuth() == taRotation.getCreateUser();
58
+        String isAdmin = checkAuth();
59
+        Boolean b = false;
60
+        b = isAdmin == null ? true : isAdmin.equals(taRotation.getCreateUser()) ? true : false;
60 61
         if (b) {
61 62
             return SaResult.data(taRotationService.getById(id));
62 63
         }

+ 3
- 2
application/src/main/java/com/lyg/application/controller/TaSendingController.java View File

@@ -43,8 +43,9 @@ public class TaSendingController extends BaseController {
43 43
     @GetMapping("/taSending/{id}")
44 44
     public SaResult queryById(@ApiParam("对象ID") @PathVariable String id) throws Exception {
45 45
         TaSending taSending = taSendingService.getById(id);
46
-
47
-        Boolean b = checkAuth() == null || checkAuth() == taSending.getCreateUser();
46
+        String isAdmin = checkAuth();
47
+        Boolean b = false;
48
+        b = (isAdmin == null) ? true : (isAdmin.equals(taSending.getCreateUser())) ? true : false;
48 49
         if (b) {
49 50
             return SaResult.data(taSendingService.getById(id));
50 51
         }