fix: support App builder type in deleteWebTree + correct delete prompt

- ChannelProjectService: normalizeBuilderType accepts 'app' (Channel::BUILDER_APP)
- deleteWebTree: app type deletes public/channel/<id>/ (IPA output)
- Blade: correct pathHint for app builder type
This commit is contained in:
hashbro
2026-10-06 06:45:16 +08:00
parent 08ef9e718e
commit ba444a96b1
2 changed files with 21 additions and 5 deletions
+13 -2
View File
@@ -71,6 +71,17 @@ class ChannelProjectService
): void {
$builderType = $this->normalizeBuilderType($builderType);
// App builder channels have no static resource tree —
// only the DB row + optionally an IPA output directory.
if ($builderType === Channel::BUILDER_APP) {
$dir = public_path('channel/'.$channelId);
if (is_dir($dir) && ! $this->removeDirectory($dir)) {
throw new RuntimeException('删除渠道资源失败: '.$dir);
}
return;
}
if ($builderType === self::BUILDER_NEW) {
$code = Channel::normalizeNewChannelId($channelId);
if ($code === null) {
@@ -707,8 +718,8 @@ class ChannelProjectService
if ($builderType === '') {
return self::BUILDER_OLD;
}
if (! in_array($builderType, [self::BUILDER_OLD, self::BUILDER_NEW], true)) {
throw new RuntimeException('无效的渠道类型(支持: old, new)');
if (! in_array($builderType, [self::BUILDER_OLD, self::BUILDER_NEW, Channel::BUILDER_APP], true)) {
throw new RuntimeException('无效的渠道类型(支持: old, new, app)');
}
return $builderType;