feat: 增强管理员 API 鉴权,新增 token 有效天数配置,更新相关异常处理与错误码引用
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\Api\V1\Wallet;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Lottery\ErrorCode;
|
||||
use App\Models\Player;
|
||||
use App\Models\PlayerWallet;
|
||||
use App\Support\ApiResponse;
|
||||
@@ -58,7 +59,7 @@ class WalletBalanceController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|JsonResponse 合法币种码或错误响应(code 1003:参数非法)
|
||||
* @return string|JsonResponse 合法币种码或错误响应({@see ErrorCode::WalletInvalidCurrency})
|
||||
*/
|
||||
private function resolveCurrencyCode(Request $request, Player $player): string|JsonResponse
|
||||
{
|
||||
@@ -72,10 +73,9 @@ class WalletBalanceController extends Controller
|
||||
|
||||
// 币种码:字母数字,长度 1–16,与 migrations 字段一致
|
||||
if (! preg_match('/^[A-Z0-9]{1,16}$/', $code)) {
|
||||
// 业务码占用 1000–1999 钱包段;1003 已在 PRD 保留为「金额超出限制」,币种非法单用 1005
|
||||
return ApiResponse::error(
|
||||
__('wallet.invalid_currency'),
|
||||
1005,
|
||||
ErrorCode::WalletInvalidCurrency->value,
|
||||
null,
|
||||
400,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user