浏览代码

feat: bump panel version to 2023.3

M1Screw 2 年之前
父节点
当前提交
cd1b1780af

+ 1 - 1
app/predefine.php

@@ -7,4 +7,4 @@ declare(strict_types=1);
  */
  */
 
 
 const BASE_PATH = __DIR__ . '/..';
 const BASE_PATH = __DIR__ . '/..';
-const VERSION = '2023.2';
+const VERSION = '2023.3';

+ 5 - 0
src/Controllers/Admin/IpController.php

@@ -9,6 +9,8 @@ use App\Models\LoginIp;
 use App\Services\DB;
 use App\Services\DB;
 use App\Utils\Tools;
 use App\Utils\Tools;
 use Exception;
 use Exception;
+use GeoIp2\Exception\AddressNotFoundException;
+use MaxMind\Db\Reader\InvalidDatabaseException;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ResponseInterface;
 use Slim\Http\Response;
 use Slim\Http\Response;
 use Slim\Http\ServerRequest;
 use Slim\Http\ServerRequest;
@@ -62,6 +64,9 @@ final class IpController extends BaseController
 
 
     /**
     /**
      * 后台登录记录页面 AJAX
      * 后台登录记录页面 AJAX
+     *
+     * @throws AddressNotFoundException
+     * @throws InvalidDatabaseException
      */
      */
     public function ajaxLogin(ServerRequest $request, Response $response, array $args): Response|ResponseInterface
     public function ajaxLogin(ServerRequest $request, Response $response, array $args): Response|ResponseInterface
     {
     {

+ 5 - 0
src/Controllers/Admin/SubscribeLogController.php

@@ -8,6 +8,8 @@ use App\Controllers\BaseController;
 use App\Models\UserSubscribeLog;
 use App\Models\UserSubscribeLog;
 use App\Utils\Tools;
 use App\Utils\Tools;
 use Exception;
 use Exception;
+use GeoIp2\Exception\AddressNotFoundException;
+use MaxMind\Db\Reader\InvalidDatabaseException;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ResponseInterface;
 use Slim\Http\Response;
 use Slim\Http\Response;
 use Slim\Http\ServerRequest;
 use Slim\Http\ServerRequest;
@@ -45,6 +47,9 @@ final class SubscribeLogController extends BaseController
 
 
     /**
     /**
      * 后台订阅记录页面 AJAX
      * 后台订阅记录页面 AJAX
+     *
+     * @throws AddressNotFoundException
+     * @throws InvalidDatabaseException
      */
      */
     public function ajax(ServerRequest $request, Response $response, array $args): ResponseInterface
     public function ajax(ServerRequest $request, Response $response, array $args): ResponseInterface
     {
     {

+ 2 - 2
src/Controllers/User/CouponController.php

@@ -40,7 +40,7 @@ final class CouponController extends BaseController
             ]);
             ]);
         }
         }
 
 
-        if ($coupon->expire_time < time()) {
+        if ($coupon->expire_time !== 0 && $coupon->expire_time < time()) {
             return $response->withJson([
             return $response->withJson([
                 'ret' => 0,
                 'ret' => 0,
                 'msg' => '优惠码无效',
                 'msg' => '优惠码无效',
@@ -52,7 +52,7 @@ final class CouponController extends BaseController
         if ($product === null) {
         if ($product === null) {
             return $response->withJson([
             return $response->withJson([
                 'ret' => 0,
                 'ret' => 0,
-                'msg' => '优惠码无效',
+                'msg' => '商品ID无效',
             ]);
             ]);
         }
         }
 
 

+ 6 - 0
src/Utils/Telegram/Callback.php

@@ -14,6 +14,8 @@ use App\Models\Setting;
 use App\Models\UserSubscribeLog;
 use App\Models\UserSubscribeLog;
 use App\Services\Config;
 use App\Services\Config;
 use App\Utils\Tools;
 use App\Utils\Tools;
+use GeoIp2\Exception\AddressNotFoundException;
+use MaxMind\Db\Reader\InvalidDatabaseException;
 use Telegram\Bot\Api;
 use Telegram\Bot\Api;
 use Telegram\Bot\Exceptions\TelegramSDKException;
 use Telegram\Bot\Exceptions\TelegramSDKException;
 use Telegram\Bot\Objects\CallbackQuery;
 use Telegram\Bot\Objects\CallbackQuery;
@@ -274,6 +276,8 @@ final class Callback
     /**
     /**
      * 用户相关回调数据处理
      * 用户相关回调数据处理
      *
      *
+     * @throws AddressNotFoundException
+     * @throws InvalidDatabaseException
      * @throws TelegramSDKException
      * @throws TelegramSDKException
      */
      */
     public function userCallback(): void
     public function userCallback(): void
@@ -379,6 +383,8 @@ final class Callback
      * 用户中心
      * 用户中心
      *
      *
      * @throws TelegramSDKException
      * @throws TelegramSDKException
+     * @throws AddressNotFoundException
+     * @throws InvalidDatabaseException
      */
      */
     public function userCenter(): void
     public function userCenter(): void
     {
     {