无人机项目后端代码
xieb
2023-09-22 ec46a32ca330e5c416302eb082e44fa164b37829
配置修改
2 files modified
5 ■■■■■ changed files
src/main/java/com/dji/sample/component/websocket/config/AuthPrincipalHandler.java 3 ●●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/control/service/impl/ControlServiceImpl.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/dji/sample/component/websocket/config/AuthPrincipalHandler.java
@@ -15,7 +15,6 @@
import java.security.Principal;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
/**
 * @author sean.zhou
@@ -64,7 +63,7 @@
            CustomClaim claim = (CustomClaim) ((ServletServerHttpRequest) request).getServletRequest()
                    .getAttribute(AuthInterceptor.TOKEN_CLAIM);
            return () -> UUID.randomUUID().toString() + "/" + claim.getUserType() + "/" + claim.getId();
            return () -> claim.getWorkspaceId() + "/" + claim.getUserType() + "/" + claim.getId();
        }
        return () -> null;
    }
src/main/java/com/dji/sample/control/service/impl/ControlServiceImpl.java
@@ -68,7 +68,7 @@
                mapper.convertValue(Objects.nonNull(param) ? param : new Object(), controlMethodEnum.getClazz())
                : new RemoteDebugHandler();
        if (!handler.canPublish(sn)) {
            throw new RuntimeException("The current state of the dock does not support this function.");
            throw new RuntimeException("当前的机场状态不支持此功能。");
        }
        if (Objects.nonNull(param) && !handler.valid()) {
            throw new RuntimeException(CommonErrorEnum.ILLEGAL_ARGUMENT.getErrorMsg());