refactor: 外链中转拆为内置插件 neatstudio.link-tracker

- 插件承载全部逻辑:redirects 迁移(hasTable 兼容旧库)、Redirect 模型、UrlRedirector、/go 路由+控制器、Filament 外链中转资源
- 核心只留 hook 接入点:
  - tracked_url() 助手走 link.redirect 过滤器(评论正文/作者网址/友链模板统一调用)
  - 正文外链改写移到插件的 post.rendered 过滤器(优先级 20,晚于会员付费过滤)
- 停用插件:链接恢复直连、内容不受影响;后台「管理 → 外链中转」查看点击量/启停
- 测试更新为插件上下文(含无过滤器降级断言);97 通过
This commit is contained in:
ak
2026-08-13 02:05:32 +08:00
parent 8f1ff6e3f9
commit f1b9d1e1c3
20 changed files with 118 additions and 62 deletions
@@ -55,7 +55,7 @@
<h3>友情链接</h3>
<ul>
@forelse($links as $link)
<li><a href="{{ go_url($link->url) }}" target="_blank" rel="noopener">{{ $link->name }}</a></li>
<li><a href="{{ tracked_url($link->url) }}" target="_blank" rel="noopener">{{ $link->name }}</a></li>
@empty
<li>暂无链接</li>
@endforelse
+1 -1
View File
@@ -66,7 +66,7 @@
<div class="comment" id="comment-{{ $comment->id }}">
<div class="comment-head">
<strong>{{ $comment->author_name }}</strong>
@if($comment->author_url)<span>· <a href="{{ go_url($comment->author_url) }}" target="_blank" rel="noopener nofollow">访问主页</a></span>@endif
@if($comment->author_url)<span>· <a href="{{ tracked_url($comment->author_url) }}" target="_blank" rel="noopener nofollow">访问主页</a></span>@endif
<span class="comment-time">· {{ $comment->created_at->format(blog_setting('comment_timeformat', 'Y-m-d H:i')) }}</span>
</div>
<div class="comment-body">{!! comment_body($comment->content) !!}</div>