mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-17 19:23:26 +00:00
no message
This commit is contained in:
parent
cb17110562
commit
4dc1f01cf0
@ -141,6 +141,7 @@ class Apps
|
|||||||
$info = [
|
$info = [
|
||||||
'name' => $appName,
|
'name' => $appName,
|
||||||
'description' => '',
|
'description' => '',
|
||||||
|
'icon' => '',
|
||||||
'author' => '',
|
'author' => '',
|
||||||
'website' => '',
|
'website' => '',
|
||||||
'github' => '',
|
'github' => '',
|
||||||
@ -148,6 +149,27 @@ class Apps
|
|||||||
'fields' => [],
|
'fields' => [],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// 处理应用图标
|
||||||
|
$iconFiles = ['logo.svg', 'logo.png', 'icon.svg', 'icon.png'];
|
||||||
|
foreach ($iconFiles as $iconFile) {
|
||||||
|
$iconPath = $baseDir . '/' . $iconFile;
|
||||||
|
if (file_exists($iconPath)) {
|
||||||
|
// 创建目标目录、路径
|
||||||
|
$targetDir = public_path('uploads/file/apps/' . $appName);
|
||||||
|
$targetFile = $targetDir . '/' . $iconFile;
|
||||||
|
|
||||||
|
// 判断目标文件是否存在,或源文件是否比目标文件新
|
||||||
|
if (!file_exists($targetFile) || filemtime($iconPath) > filemtime($targetFile)) {
|
||||||
|
Base::makeDir($targetDir);
|
||||||
|
copy($iconPath, $targetFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置图标URL
|
||||||
|
$info['icon'] = Base::fillUrl('uploads/file/apps/' . $appName . '/' . $iconFile);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (file_exists($baseDir . '/config.yml')) {
|
if (file_exists($baseDir . '/config.yml')) {
|
||||||
$configData = Yaml::parseFile($baseDir . '/config.yml');
|
$configData = Yaml::parseFile($baseDir . '/config.yml');
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user