Просмотр исходного кода

微信查询企业信息+档案新增查看权限

anderx 1 год назад
Родитель
Сommit
fcc1cdb284

+ 12 - 2
src/main/java/com/goafanti/customer/controller/UserArchivesController.java

@@ -1,7 +1,10 @@
 package com.goafanti.customer.controller;
 
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.controller.BaseController;
 import com.goafanti.common.model.UserArchives;
+import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.customer.service.UserArchivesService;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -18,7 +21,7 @@ import javax.annotation.Resource;
  */
 @RestController
 @RequestMapping("/api/admin/userArchives")
-public class UserArchivesController {
+public class UserArchivesController  extends BaseController {
     /**
      * 服务对象
      */
@@ -103,7 +106,14 @@ public class UserArchivesController {
      */
     @GetMapping("/queryByUidAll")
     public Result queryByUidAll( String id) {
-        return new Result<>().data(this.userArchivesService.queryByUidAll(id));
+        Result res = new Result<>();
+        if (!TokenManager.hasRole(AFTConstants.SUPERADMIN)&&!TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)
+        &&!TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)){
+            res.error(buildError("查看权限不足"));
+            return res;
+        }
+        res.data(this.userArchivesService.queryByUidAll(id));
+        return res;
     }