|
@@ -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();
|
|
|
|
|
+ }
|
|
|
|
|
+}
|