fix: review 修复——meta 覆盖、重复支付、卸载守卫、测试补全

- EditPost 保存时合并表单中的部分 meta 键,防止插件注入字段覆盖 unlocked_user_ids 等其他键(单篇解锁用户会失去权限的 bug)
- unlockPost:已有阅读权限(会员/作者/已解锁)直接跳文章,不重复支付
- subscribe:已有该套餐有效订阅直接跳我的订阅页
- uninstall:存在已启用的依赖者时拒绝卸载(与 disable 一致)
- .gitignore 排除 storage/media-library/temp 测试残留
- 测试:AdminPagesTest 补 /admin/plugins /admin/payments;新增 Livewire 保存验证 meta 保留、解锁/订阅防重复支付、卸载守卫
This commit is contained in:
ak
2026-08-12 00:53:46 +08:00
parent ec087fe2a8
commit 6a7daa79da
8 changed files with 124 additions and 3 deletions
+6
View File
@@ -178,6 +178,12 @@ class PluginManager
public function uninstall(string $plugin): void
{
$dependents = $this->dependents($plugin);
if ($dependents) {
throw new RuntimeException('无法卸载 '.$plugin.':以下已启用插件依赖它:'.implode('、', $dependents).'。请先停用这些插件。');
}
[$vendor, $name] = array_pad(explode('.', $plugin), 2, $plugin);
PluginRecord::query()->where('vendor', $vendor)->where('name', $name)->delete();
}