Browse Source

修改对应路径

15954078560 3 năm trước cách đây
mục cha
commit
8ad58e7caf

+ 1 - 1
application/api/controller/Index.php

@@ -39,7 +39,7 @@ class Index extends Api
      */
     public function index()
     {
-        getVideoCover('/www/wwwroot/yanyuan.lanmaonet.com/public/assets/123.mp4',3,'uploads/ffmpeg_test.png');
+        getVideoCover(config('project_path') . '/public/assets/123.mp4',3,'uploads/ffmpeg_test.png');
         $this->success('请求成功');
     }
 

+ 2 - 2
application/common.php

@@ -549,7 +549,7 @@ if (!function_exists('getVideoCover')) {
     function getVideoCover($file, $time, $name)
     {
         // 视频宽高 -- 开始
-        $command = sprintf('/www/wwwroot/yanyuan.lanmaonet.com/ffmpeg -i "%s" 2>&1', $file);
+        $command = sprintf(config('project_path') . '/ffmpeg -i "%s" 2>&1', $file);
         ob_start();
         passthru($command);
         $info = ob_get_contents();
@@ -568,7 +568,7 @@ if (!function_exists('getVideoCover')) {
         // 视频宽高 -- 结束
 
         if (empty($time)) $time = 0.1;//默认截取第一秒第一帧
-        $str = "/www/wwwroot/yanyuan.lanmaonet.com/ffmpeg -i " . $file . " -y -f mjpeg -ss 3 -t " . $time . " -s ".$resolution." " . $name;
+        $str = config('project_path') . "/ffmpeg -i " . $file . " -y -f mjpeg -ss 3 -t " . $time . " -s ".$resolution." " . $name;
         exec($str.'  2>&1',$result);
         return $result;
     }

+ 3 - 1
application/config.php

@@ -333,5 +333,7 @@ return [
     'onLogin' => [
         'phone_access_key' => 'LTAI5tJhtZsPFELiNFskbDWx',
         'phone_access_secret' => 'wBxojKDMnpgaH6BmknUM3SBoR7cMGZ',
-    ]
+    ],
+    //根路径
+    'project_path' => '/www/wwwroot/yanyuan_ll/yanyuan'
 ];

+ 1 - 1
public/hook.php

@@ -1,5 +1,5 @@
 <?php
-chdir("/www/wwwroot/yanyuan.lanmaonet.com");
+chdir(config('project_path'));
     exec("git pull origin master 2>&1", $out);
     foreach($out as $v)
     {