chore: 批量修改文件权限为可执行

将项目内绝大多数文件的权限从644调整为755,统一可执行权限配置
This commit is contained in:
2026-08-02 16:29:01 +08:00
parent cd953adcc0
commit 9bab04be20
905 changed files with 161 additions and 135 deletions
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
+45 -21
View File
@@ -1,7 +1,9 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
namespace app\command; namespace app\command;
use Exception; use Exception;
use think\console\Command; use think\console\Command;
use think\console\Input; use think\console\Input;
@@ -31,7 +33,7 @@ class Lebo extends Command
} }
protected function execute(Input $input, Output $output) protected function execute(Input $input, Output $output)
{ {
$this->aria2 = new Aria2('http://127.0.0.1:16800/jsonrpc','11223344'); $this->aria2 = new Aria2('http://192.168.100.106:16800/jsonrpc', '11223344');
$this->completed = false; $this->completed = false;
while ($this->completed === false) { while ($this->completed === false) {
try { try {
@@ -47,21 +49,32 @@ class Lebo extends Command
} }
private function start() private function start()
{ {
// $savepath = store_path() . '/lebolebo/'; $savepath = store_path() . '/lebolebo/';
$savepath = 'D:/lebolebo/'; // $savepath = 'D:/lebolebo/';
$account_cache_key = 'lebo_account';
$account_info = Cache::get($account_cache_key);
if ($account_info) {
} else {
$account = new Account(); $account = new Account();
$account_info = $account->login('13880615958', 'robo520'); $account_info = $account->login('13880615958', 'robo520');
if ($account_info['code'] == 500) { if ($account_info['code'] == 500) {
dump($account_info['msg']); dump($account_info['msg']);
exit; exit;
} }
$curl = new Curl(); Cache::set($account_cache_key, $account_info, 3600);
dump('账号信息缓存成功');
}
// $curl = new Curl();
$curr = new Curriculum(); $curr = new Curriculum();
$curr->setHeader('token', $account_info['data']['token']); $curr->setHeader('token', $account_info['data']['token']);
$course = $curr->list(0); $course = $curr->list(1);
foreach ($course['data']['list'] as $list){ foreach ($course['data']['list'] as $index => $list) {
$c = $savepath . $list['courseName']; $c = $savepath . $list['courseName'];
// dump($index,$list['courseName']);
if ($list['courseName'] != '线上-CSP-J 集训课程') {
continue;
}
is_dir($c) || mkdir($c, 0755, true); is_dir($c) || mkdir($c, 0755, true);
$detail = $curr->detail($list['id']); $detail = $curr->detail($list['id']);
$courseCover = $c . '/courseCover.png'; $courseCover = $c . '/courseCover.png';
@@ -72,7 +85,8 @@ class Lebo extends Command
// $result = $curl->_fastDownload($downloadurl,$courseCover); // $result = $curl->_fastDownload($downloadurl,$courseCover);
$this->aria2->addUri( $this->aria2->addUri(
[$downloadurl], [$downloadurl],
['dir'=>$c, [
'dir' => $c,
'out' => 'courseCover.png' 'out' => 'courseCover.png'
] ]
); );
@@ -123,7 +137,7 @@ class Lebo extends Command
switch ($kk['resourceType']) { switch ($kk['resourceType']) {
case '1': // PPT-HTML case '1': // PPT-HTML
if (!isset($kk['content'])) { if (!isset($kk['content'])) {
continue; break;
} }
$filename = $kk['content']['fileName']; $filename = $kk['content']['fileName'];
$downloadurl = $kk['content']['fileUrl']; $downloadurl = $kk['content']['fileUrl'];
@@ -141,8 +155,10 @@ class Lebo extends Command
// } // }
$this->aria2->addUri( $this->aria2->addUri(
[$downloadurl], [$downloadurl],
['dir'=>$sessionName, [
'out'=>$filename] 'dir' => $sessionName,
'out' => $filename
]
); );
} else if ($check && !is_file($file)) { } else if ($check && !is_file($file)) {
if (is_file($check)) { if (is_file($check)) {
@@ -161,8 +177,10 @@ class Lebo extends Command
// } // }
$this->aria2->addUri( $this->aria2->addUri(
[$downloadurl], [$downloadurl],
['dir'=>$sessionName, [
'out'=>$filename] 'dir' => $sessionName,
'out' => $filename
]
); );
} }
@@ -204,8 +222,10 @@ class Lebo extends Command
// } // }
$this->aria2->addUri( $this->aria2->addUri(
[$downloadurl], [$downloadurl],
['dir'=>$shiyishi, [
'out'=>$filename] 'dir' => $shiyishi,
'out' => $filename
]
); );
} else if ($check && !is_file($file)) { } else if ($check && !is_file($file)) {
copy($check, $file); copy($check, $file);
@@ -225,7 +245,7 @@ class Lebo extends Command
case '13': case '13':
// 教辅 // 教辅
if (!isset($kk['content']['resourceList'])) { if (!isset($kk['content']['resourceList'])) {
continue; break;
} }
$jiaofupath = $sessionName . '/教辅/'; $jiaofupath = $sessionName . '/教辅/';
if (!is_dir($jiaofupath)) { if (!is_dir($jiaofupath)) {
@@ -256,8 +276,10 @@ class Lebo extends Command
// } // }
$this->aria2->addUri( $this->aria2->addUri(
[$downloadurl], [$downloadurl],
['dir'=>$jiaofupath, [
'out'=>$resourceList['fileName']] 'dir' => $jiaofupath,
'out' => $resourceList['fileName']
]
); );
} else if ($check && !is_file($file)) { } else if ($check && !is_file($file)) {
copy($check, $file); copy($check, $file);
@@ -271,7 +293,7 @@ class Lebo extends Command
case '14': case '14':
// 备课 // 备课
if (!isset($kk['content']['resourceList'])) { if (!isset($kk['content']['resourceList'])) {
continue; break;
} }
$beikepath = $sessionName . '/备课/'; $beikepath = $sessionName . '/备课/';
if (!is_dir($beikepath)) { if (!is_dir($beikepath)) {
@@ -299,8 +321,10 @@ class Lebo extends Command
// } // }
$this->aria2->addUri( $this->aria2->addUri(
[$downloadurl], [$downloadurl],
['dir'=>$beikepath, [
'out'=>$resourceList['fileName']] 'dir' => $beikepath,
'out' => $resourceList['fileName']
]
); );
} else if ($check && !is_file($file)) { } else if ($check && !is_file($file)) {
copy($check, $file); copy($check, $file);
@@ -337,7 +361,7 @@ class Lebo extends Command
$key = 'lebolebo_check_header_' . md5($url); $key = 'lebolebo_check_header_' . md5($url);
try { try {
if (($head = Cache::get($key, null)) === NULL) { if (($head = Cache::get($key, null)) === NULL) {
$head = @get_headers($url,1); $head = @get_headers($url, true);
if ($head === false) { if ($head === false) {
dump('获取文件信息失败,直接重新下载' . $file); dump('获取文件信息失败,直接重新下载' . $file);
return false; return false;
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
+6 -4
View File
@@ -33,14 +33,16 @@ class Curriculum
public function list(int $page = 0) public function list(int $page = 0)
{ {
$url = 'https://api-manage2.shengtongedu.cn/st-course-server/manage/course/coursePageListV3'; // $url = 'https://api-manage2.shengtongedu.cn/st-course-server/manage/course/coursePageListV3';
$url = 'https://api-manage2.shengtongedu.cn/st-course-server/manage/course/coursePageListV6';
$options = [ $options = [
'body'=>json_encode([ 'body'=>json_encode([
'campusIdList'=>["1863"], 'campusIdList'=>["2404"],
'pageNum'=>$page, 'pageNum'=>$page,
'pageSize'=>200, 'pageSize'=>96,
'platform'=>"OMO_WEB", 'platform'=>"OMO_WEB",
'total'=>101, 'searchType'=>true,
'total'=>152,
]), ]),
'headers'=>$this->headers 'headers'=>$this->headers
]; ];
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Generated Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
View File
Vendored Regular → Executable
View File
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
Vendored Regular → Executable
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File

Some files were not shown because too many files have changed in this diff Show More