Browse Source

场景路径, 超级管理员不能删除

wuweihao 4 years ago
parent
commit
7ffc923e39

+ 0 - 7
gis_admin/src/main/java/com/gis/admin/controller/SysUserController.java

@@ -50,13 +50,6 @@ public class SysUserController {
     @ApiOperation("详情")
     @GetMapping("detail/{id}")
     public Result<SysUserEntity> detail(@PathVariable Long id) {
-//        SysUserEntity user = userService.findById(id);
-//
-//        if (user == null) {
-//            log.error("用户不存在: {}", id);
-//            return Result.failure("用户不存在");
-//        }
-//        return Result.success(user);
         return userService.detail(id);
     }
 

+ 2 - 7
gis_admin/src/main/java/com/gis/admin/service/impl/SysUserServiceImpl.java

@@ -187,7 +187,8 @@ public class SysUserServiceImpl extends IBaseServiceImpl<SysUserEntity, Long> im
             return Result.failure("用户不存在");
         }
 
-        if ("sys_admin".equals(user.getRole())) {
+        List tokenRole = getTokenRole();
+        if (tokenRole.contains("sys_admin")) {
             log.error("管理员账户不能停用/注销: {}", id);
             return Result.failure("管理员账户不能停用/注销");
         }
@@ -236,12 +237,6 @@ public class SysUserServiceImpl extends IBaseServiceImpl<SysUserEntity, Long> im
 
     @Override
     public Result<SysUserEntity> detail(Long id) {
-//        SysUserEntity user = this.findById(id);
-//
-//        if (user == null) {
-//            log.error("用户不存在: {}", id);
-//            return Result.failure("用户不存在");
-//        }
 
         SysUserEntity user = entityMapper.detailMapper(id);
 

+ 3 - 3
gis_scene/src/main/java/com/gis/scene/service/impl/SceneServiceImpl.java

@@ -70,7 +70,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
         // 注意网络下载会有缓存,必须加时间戳
 //        log.info("网络下载文件地址: {}", urlPath);
 //        String localBasePath = FILE_PATH + sceneCode;
-        String localBasePath = configConstant.serverBasePath + sceneCode;
+        String localBasePath = configConstant.serverBasePath +"/" + sceneCode;
 
         // 2. 将vision.modeldata 转 vision.json
         String visionModelDataPath = localBasePath + "/" + visionModelDataName;
@@ -151,7 +151,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
             return Result.failure("场景不存在");
         }
 
-        String basePath = configConstant.serverBasePath + sceneCode;
+        String basePath = configConstant.serverBasePath +"/" + sceneCode;
 
 
         // 处理someData.json
@@ -392,7 +392,7 @@ public class SceneServiceImpl extends IBaseServiceImpl<SceneEntity, Long> implem
         }
 
         log.info("out data.js : {}", dataJsJson);
-        String basePath = configConstant.serverBasePath + entity.getSceneCode();
+        String basePath = configConstant.serverBasePath +"/" + entity.getSceneCode();
 
         String dataPath = basePath + "/hot/js/data.js";
         FileUtil.writeUtf8String(dataJsJson.toJSONString(), dataPath);