allen 3 年之前
父节点
当前提交
6d5959c594
共有 4 个文件被更改,包括 36 次插入25 次删除
  1. 0 20
      app/index/controller/Index.php
  2. 34 0
      app/index/controller/Video.php
  3. 1 4
      app/index/view/video/index.html
  4. 1 1
      app/middleware/Safe.php

+ 0 - 20
app/index/controller/Index.php

@@ -28,26 +28,6 @@ use think\db\exception\ModelNotFoundException;
  */
 class Index extends Controller
 {
-    public function index()
-    {
-        FacadeLog::info("index cookies: ". json_encode($_COOKIE));
-        if (!empty($_COOKIE['SUB']) && strpos($_SERVER["HTTP_USER_AGENT"],"Weibo")) {
-            $sub = $_COOKIE['SUB'];
-            $isWebo = 1;
-        } else {
-            $isWebo = 0;
-            // 只在调试模式下开启从POST参数中获取UID,方便测试联调
-            if (env('app_debug')) {
-                $sub = Request::get('cookie');
-            }
-        }
-        $this->assign('sub', $sub);
-        $this->assign('isWeibo', $isWebo);
-        $this->assign('mock', env('weibo.mock', '0'));
-
-        $this->fetch();
-    }
-
     /**
      * 获取品牌任务相关配置
      *

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

@@ -0,0 +1,34 @@
+<?php
+
+namespace app\index\controller;
+
+use think\facade\Request;
+use think\admin\Controller;
+use think\facade\Log as FacadeLog;
+
+/**
+ * Class Index
+ * @package app\index\controller
+ */
+class Video extends Controller
+{
+    public function index()
+    {
+        FacadeLog::info("index cookies: ". json_encode($_COOKIE));
+        if (!empty($_COOKIE['SUB']) && strpos($_SERVER["HTTP_USER_AGENT"],"Weibo")) {
+            $sub = $_COOKIE['SUB'];
+            $isWebo = 1;
+        } else {
+            $isWebo = 0;
+            // 只在调试模式下开启从POST参数中获取UID,方便测试联调
+            if (env('app_debug')) {
+                $sub = Request::get('cookie');
+            }
+        }
+        $this->assign('sub', $sub);
+        $this->assign('isWeibo', $isWebo);
+        $this->assign('mock', env('weibo.mock', '0'));
+
+        $this->fetch();
+    }
+}

+ 1 - 4
app/index/view/index/index.html → app/index/view/video/index.html

@@ -267,7 +267,7 @@
     var isShare = 0;
     var theTokenData = '';
 
-    var YUMING = 'https://video.shuncheng.lu/';
+    var YUMING = '/';
 
 
     // 登录接口
@@ -332,9 +332,6 @@
 
         var obj = {token:theTokenData};
         $.post(u,obj,function(data){
-            if(window.location.host == 'local.sina.com'){
-
-            }
             console.log(data)
 
             if(data.code == 0){

+ 1 - 1
app/middleware/Safe.php

@@ -50,7 +50,7 @@ class Safe
             return $next($request);
         }
 
-        if (strpos(\think\facade\Request::url(), '/index') !== false) {
+        if (strpos(\think\facade\Request::url(), '/video') !== false) {
             return $next($request);
         }