diff --git a/update-service/src/main/java/com/xuqm/update/controller/AppVersionController.java b/update-service/src/main/java/com/xuqm/update/controller/AppVersionController.java index e28d91a..f28c00c 100644 --- a/update-service/src/main/java/com/xuqm/update/controller/AppVersionController.java +++ b/update-service/src/main/java/com/xuqm/update/controller/AppVersionController.java @@ -60,11 +60,10 @@ public class AppVersionController { @RequestParam(required = false) String appKey, @RequestParam AppVersionEntity.Platform platform, @RequestParam int currentVersionCode, - @RequestParam @jakarta.validation.constraints.NotBlank String packageName, @RequestParam(required = false) String licenseFile, @RequestParam(required = false) String userId) { - String resolvedAppKey = resolveAndValidate(appKey, platform, packageName, licenseFile); + String resolvedAppKey = resolveAndValidate(appKey, platform, licenseFile); boolean allowAnonymousCheck = publishConfigService.allowAnonymousUpdateCheck(resolvedAppKey); Optional latest = versionRepository @@ -494,26 +493,14 @@ public class AppVersionController { return currentStatus == AppVersionEntity.PublishStatus.PUBLISHED ? "PUBLISH" : "SAVE_DRAFT"; } - private String resolveAndValidate(String appKey, AppVersionEntity.Platform platform, String packageName, String licenseFile) { + private String resolveAndValidate(String appKey, AppVersionEntity.Platform platform, String licenseFile) { if (hasText(licenseFile)) { LicenseFileCrypto.LicensePayload payload = LicenseFileCrypto.decrypt(licenseFile); - if (!payload.matchesPackageName(packageName)) { - throw new BusinessException(403, "包名与应用配置不匹配"); - } return payload.appKey(); } if (!hasText(appKey)) { throw new BusinessException(400, "appKey 或 licenseFile 必须提供其中一个"); } - UpdateTenantClient.PlatformInfo info = tenantClient.getPlatformInfo(appKey); - String registered = switch (platform) { - case IOS -> info.iosBundleId(); - case HARMONY -> info.harmonyBundleName(); - default -> info.androidPackageName(); - }; - if (hasText(registered) && !registered.equals(packageName)) { - throw new BusinessException(403, "包名与应用配置不匹配"); - } return appKey; }