allen 3 жил өмнө
parent
commit
209e0ea5c4

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

@@ -751,7 +751,7 @@ class Index extends Controller
 
 //    public function index()
 //    {
-//        $this->redirect(sysuri('admin/login/index'));
+//        $this->redirect('video');
 //    }
 
     /**

+ 1 - 0
app/index/controller/Video.php

@@ -15,6 +15,7 @@ class Video extends Controller
     public function index()
     {
         FacadeLog::info("index cookies: ". json_encode($_COOKIE));
+        $sub = "";
         if (!empty($_COOKIE['SUB']) && strpos($_SERVER["HTTP_USER_AGENT"],"Weibo")) {
             $sub = $_COOKIE['SUB'];
             $isWebo = 1;

+ 4 - 6
app/index/view/video/index.html

@@ -196,14 +196,12 @@
     console.log(isWeibo);
     console.log(sub);
     console.log(mock);
-    if(isWeibo != '1' && mock == '0'){
-        showMessage('请使用微博客户端打开');
-        onOpen();
-    }
 
     if (mock == '0') {
-        showMessage('请使用微博客户端打开')
-        onOpen();
+        if (isWeibo != '1') {
+            showMessage('请使用微博客户端打开');
+            onOpen();
+        }
     }
 
     console.log("isWeibo = " + isWeibo)

+ 17 - 15
app/middleware/Safe.php

@@ -31,21 +31,23 @@ class Safe
      */
     public function handle(Request $request, Closure $next)
     {
-        $referer = $_SERVER['HTTP_REFERER'] ?? '';
-        // 非调试模式 开启referer检测
-        if (empty(env('app_debug'))) {
-            if (strpos($referer, env('weibo.referer')) === false) {
-                abort(
-                    json(
-                        [
-                            'code' => 403,
-                            'message' => 'not login.',
-                        ]
-                    )
-                );
-                return null;
-            }
-        }
+        Log::info("header:" . json_encode($_SERVER));
+        Log::info("cookie:" . json_encode($_COOKIE));
+//        $referer = $_SERVER['HTTP_REFERER'] ?? '';
+//        // 非调试模式 开启referer检测
+//        if (empty(env('app_debug'))) {
+//            if (strpos($referer, env('weibo.referer')) === false) {
+//                abort(
+//                    json(
+//                        [
+//                            'code' => 403,
+//                            'message' => 'not login.',
+//                        ]
+//                    )
+//                );
+//                return null;
+//            }
+//        }
         if (strpos(\think\facade\Request::url(), '/checkLogin') !== false || strpos(\think\facade\Request::url(), '/groupPageConfig') || strpos(\think\facade\Request::url(), '/notices') || strpos(\think\facade\Request::url(), '/getRule')) {
             return $next($request);
         }