fix route
This commit is contained in:
parent
d91477263f
commit
24daddff7b
4 changed files with 8 additions and 2 deletions
|
|
@ -30,6 +30,7 @@ public function boot(): void
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->routes(function () {
|
$this->routes(function () {
|
||||||
|
logger('Loading API routes...'); // 測試代碼
|
||||||
Route::middleware('api')
|
Route::middleware('api')
|
||||||
->prefix('api')
|
->prefix('api')
|
||||||
->group(base_path('routes/api.php'));
|
->group(base_path('routes/api.php'));
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
return Application::configure(basePath: dirname(__DIR__))
|
return Application::configure(basePath: dirname(__DIR__))
|
||||||
->withRouting(
|
->withRouting(
|
||||||
web: __DIR__.'/../routes/web.php',
|
web: __DIR__.'/../routes/web.php',
|
||||||
|
api: __DIR__.'/../routes/api.php',
|
||||||
commands: __DIR__.'/../routes/console.php',
|
commands: __DIR__.'/../routes/console.php',
|
||||||
health: '/up',
|
health: '/up',
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
-- 插入超級管理員帳號
|
-- 插入超級管理員帳號
|
||||||
-- 密碼 'abc123' 使用 bcrypt 加密
|
-- 密碼 'abc123' 使用 bcrypt 加密
|
||||||
INSERT INTO `admins` (`username`, `password`, `role`, `created_at`, `updated_at`)
|
INSERT INTO `admins` (`username`, `email`, `password`, `role`, `created_at`, `updated_at`)
|
||||||
VALUES (
|
VALUES (
|
||||||
'admin',
|
'admin',
|
||||||
|
'admin@cv6.me',
|
||||||
'$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', -- 'abc123' 的 bcrypt hash
|
'$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', -- 'abc123' 的 bcrypt hash
|
||||||
'super',
|
'super',
|
||||||
CURRENT_TIMESTAMP,
|
CURRENT_TIMESTAMP,
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,9 @@
|
||||||
use App\Http\Controllers\Api\LlmController;
|
use App\Http\Controllers\Api\LlmController;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
Route::get('/test', function () {
|
||||||
|
return 'Test Route';
|
||||||
|
});
|
||||||
// Public routes
|
// Public routes
|
||||||
Route::post('/auth/token', [AuthController::class, 'getAccessToken']);
|
Route::post('/auth/token', [AuthController::class, 'getAccessToken']);
|
||||||
|
|
||||||
|
|
@ -23,7 +26,7 @@
|
||||||
// Protected admin routes
|
// Protected admin routes
|
||||||
Route::middleware(['auth:sanctum', 'auth.admin'])->group(function () {
|
Route::middleware(['auth:sanctum', 'auth.admin'])->group(function () {
|
||||||
Route::post('logout', [AdminAuthController::class, 'logout']);
|
Route::post('logout', [AdminAuthController::class, 'logout']);
|
||||||
Route::post('change-password', [AdminAuthController::class, 'changePassword']);
|
Route::put('change-password', [AdminAuthController::class, 'changePassword']);
|
||||||
|
|
||||||
// LLM Provider management
|
// LLM Provider management
|
||||||
Route::apiResource('llm-providers', LlmProviderController::class);
|
Route::apiResource('llm-providers', LlmProviderController::class);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue