Files
star-erp/bootstrap/app.php
sky121113 3ce96537b3
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Has been skipped
Koori-ERP-Deploy-System / deploy-production (push) Successful in 1m0s
feat: 標準化全系統數值輸入欄位與擴充商品價格功能
1. UI 標準化:
   - 針對全系統數值輸入欄位統一加上 step='any' 以支援小數點。
   - 表格形式 (Table) 的數值輸入欄位統一加上 text-right 靠右對齊。
   - 修正 Components 與 Pages 中所有涉及金額與數量的輸入框。

2. 功能擴充與修正:
   - 擴充 Product 模型與相關 Dialog 以支援多種價格設定。
   - 修正 Inventory/GoodsReceipt/Create.tsx 未使用的變數錯誤。
   - 優化庫存相關頁面的 UI 一致性。

3. 其他:
   - 更新相關的 Type 定義與 Controller 邏輯。
2026-02-05 11:45:08 +08:00

62 lines
2.4 KiB
PHP

<?php
use Illuminate\Foundation\Application;
use Illuminate\Foundation\Configuration\Exceptions;
use Illuminate\Foundation\Configuration\Middleware;
use Illuminate\Http\Middleware\TrustProxies;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Spatie\Permission\Exceptions\UnauthorizedException;
use Inertia\Inertia;
use Illuminate\Http\Request;
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
commands: __DIR__.'/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware): void {
// 信任所有代理(用於反向代理環境)
$middleware->trustProxies(at: '*');
// Tenancy 必須最先執行,確保資料庫連線在 Session 讀取之前建立
$middleware->web(prepend: [
\App\Http\Middleware\UniversalTenancy::class,
]);
$middleware->web(append: [
\App\Http\Middleware\HandleInertiaRequests::class,
]);
// 註冊 Spatie Permission 中間件別名
$middleware->alias([
'permission' => \Spatie\Permission\Middleware\PermissionMiddleware::class,
'role' => \Spatie\Permission\Middleware\RoleMiddleware::class,
'role_or_permission' => \Spatie\Permission\Middleware\RoleOrPermissionMiddleware::class,
]);
})
->withExceptions(function (Exceptions $exceptions): void {
// 處理 Spatie Permission 的 UnauthorizedException
$exceptions->render(function (UnauthorizedException $e) {
return Inertia::render('Error/Index', ['status' => 403])
->toResponse(request())
->setStatusCode(403);
});
// 處理 404 NotFoundHttpException
$exceptions->render(function (NotFoundHttpException $e) {
return Inertia::render('Error/Index', ['status' => 404])
->toResponse(request())
->setStatusCode(404);
});
// 處理其他一般的 HttpException (包含 403, 419, 429, 500, 503 等)
$exceptions->render(function (HttpException $e) {
$status = $e->getStatusCode();
return Inertia::render('Error/Index', ['status' => $status])
->toResponse(request())
->setStatusCode($status);
});
})->create();