wupengfei 2 yıl önce
ebeveyn
işleme
d7dcb72ab6

+ 3 - 1
.idea/workspace.xml

@@ -3,7 +3,9 @@
   <component name="ChangeListManager">
     <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Qc.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Qc.php" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/application/api/controller/VideoDemand.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/VideoDemand.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/common.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/common.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -189,7 +191,7 @@
       <workItem from="1668991533353" duration="2596000" />
       <workItem from="1669429338320" duration="861000" />
       <workItem from="1669448616248" duration="5065000" />
-      <workItem from="1669597148644" duration="14366000" />
+      <workItem from="1669597148644" duration="15750000" />
     </task>
     <servers />
   </component>

+ 1 - 7
application/api/controller/Qc.php

@@ -10,13 +10,7 @@ class Qc extends Base {
 
     public function index()
     {
-        var_dump($this->request->header());
-
-
-        $agreement =  Db::name('system_config')->where('name','in','agreement')->value('value');
-        $str            = openssl_encrypt($agreement,'DES-ECB',123456,0);
-        $dec_agreement      = openssl_decrypt($str,'DES-ECB',123456,0);
-        $this->success('获取成功',compact('agreement','str','dec_agreement'));
+        getVideoTime('3d15d4704a064033a6e9167874f9fdb5');
     }
 
 

+ 17 - 0
application/api/controller/VideoDemand.php

@@ -260,6 +260,23 @@ class VideoDemand extends Base
          $this->success('ok',$res_arr['body'] );
     }
 
+    public function getVideoInfo($ali_vid)
+    {
+        $client = self::createClient($this->access_key, $this->access_secret);
+        $getVideoPlayAuthRequest = new GetPlayInfoRequest(['videoId'=>$ali_vid]);
+        $runtime = new RuntimeOptions([]);
+        try {
+            $res =  $client->getPlayInfoWithOptions($getVideoPlayAuthRequest, $runtime);
+            $json_res =  json_encode($res,true);
+            $res_arr = json_decode($json_res,true);
+        }catch (\Exception $error){
+            if (!($error instanceof TeaError)) {
+                $error = new TeaError([], $error->getMessage(), $error->getCode(), $error);
+            }
+            $this->error($error->message);
+        }
+        return $res_arr['body'];
+    }
 
 
 

+ 7 - 0
application/common.php

@@ -350,3 +350,10 @@ function encryptStr($str,$key,$base64 = true)
 }
 
 
+function getVideoTime($ali_id)
+{
+    $res = (new \app\api\controller\VideoDemand())->getVideoInfo($ali_id);
+    var_dump($res);
+}
+
+