lushuncheng 4 жил өмнө
parent
commit
d176388bb7

+ 1 - 1
app/index/controller/Index.php

@@ -46,7 +46,7 @@ class Index extends Controller
             $sub = $_COOKIE['SUB'];
         } else {
             // 只在调试模式下开启从POST参数中获取UID,方便测试联调
-            if (env('app_debug') === true || env('app_debug') === 'true') {
+            if (env('app_debug')) {
                 $sub = Request::post('cookie');
                 $uid = $sub;
             } else {

+ 1 - 1
app/middleware/Safe.php

@@ -25,7 +25,7 @@ class Safe
     {
         $referer = $_SERVER['HTTP_REFERER'] ?? '';
         // 非调试模式 开启referer检测
-        if (env('app_debug') === false || env('app_debug') === 'false') {
+        if (empty(env('app_debug'))) {
             if (strpos($referer, env('weibo.referer')) === false) {
                 abort(
                     json(