lizhen_gitee 4 mesi fa
parent
commit
71152af094

+ 2 - 2
addons/alioss/controller/Index.php

@@ -80,9 +80,9 @@ class Index extends Controller
     public function upload($isApi = false)
     public function upload($isApi = false)
     {
     {
         if ($isApi === true) {
         if ($isApi === true) {
-            if (!$this->auth->isLogin()) {
+            /*if (!$this->auth->isLogin()) {
                 $this->error("请登录后再进行操作");
                 $this->error("请登录后再进行操作");
-            }
+            }*/
         } else {
         } else {
             $this->check();
             $this->check();
         }
         }

+ 15 - 1
application/api/controller/Demo.php

@@ -16,7 +16,7 @@ class Demo extends Api
     //如果接口已经设置无需登录,那也就无需鉴权了
     //如果接口已经设置无需登录,那也就无需鉴权了
     //
     //
     // 无需登录的接口,*表示全部
     // 无需登录的接口,*表示全部
-    protected $noNeedLogin = ['test', 'test1'];
+    protected $noNeedLogin = ['*'];
     // 无需鉴权的接口,*表示全部
     // 无需鉴权的接口,*表示全部
     protected $noNeedRight = ['test2'];
     protected $noNeedRight = ['test2'];
 
 
@@ -52,6 +52,20 @@ class Demo extends Api
         $params['vodid'] = $res;
         $params['vodid'] = $res;
     }
     }
 
 
+    //因后缀问题被拒了
+    public function test33()
+    {
+        $params = [
+            'video_file' => 'C:\Windows\Temp\php4F8B.tmp',
+            'title' => '测试'.rand(10,99),
+        ];
+        $full_filepath = $params['video_file'];
+
+        $uploadvideo = new Uploadvideo();
+        $res = $uploadvideo->testUploadLocalVideo($full_filepath,$params['title']);
+        $params['vodid'] = $res;
+    }
+
     /**
     /**
      * 无需登录的接口
      * 无需登录的接口
      *
      *

+ 2 - 2
application/common/library/Uploadvideo.php

@@ -35,11 +35,11 @@ class Uploadvideo{
     }
     }
 
 
     // 测试上传本地视频
     // 测试上传本地视频
-    public function testUploadLocalVideo($filePath)
+    public function testUploadLocalVideo($filePath,$title = '')
     {
     {
         try {
         try {
             $uploader = new \AliyunVodUploader($this->accessKeyId, $this->accessKeySecret);
             $uploader = new \AliyunVodUploader($this->accessKeyId, $this->accessKeySecret);
-            $uploadVideoRequest = new \UploadVideoRequest($filePath, 'testUploadLocalVideo via PHP-SDK');
+            $uploadVideoRequest = new \UploadVideoRequest($filePath, $title);
             //$uploadVideoRequest->setCateId(1);
             //$uploadVideoRequest->setCateId(1);
             //$uploadVideoRequest->setCoverURL("http://xxxx.jpg");
             //$uploadVideoRequest->setCoverURL("http://xxxx.jpg");
             //$uploadVideoRequest->setTags('test1,test2');
             //$uploadVideoRequest->setTags('test1,test2');