Merge branch 'dev' of https://gitea.f2b211.com/jsasg/orico-official-website into dev
This commit is contained in:
@@ -72,7 +72,7 @@ class Upload
|
|||||||
$webp = $image->toWebp(75);
|
$webp = $image->toWebp(75);
|
||||||
$root = config('filesystem.disks.image.root');
|
$root = config('filesystem.disks.image.root');
|
||||||
$filename = $param['module'] . '/' . ($name_rule() ?? date('Ymd') . '/' . md5((string)time()) . '.webp');
|
$filename = $param['module'] . '/' . ($name_rule() ?? date('Ymd') . '/' . md5((string)time()) . '.webp');
|
||||||
$webp->save($root . '/' . $filename);
|
$webp->save($this->checkPath($root . '/' . $filename));
|
||||||
// 获取webp文件大小
|
// 获取webp文件大小
|
||||||
$file_size = $webp->size();
|
$file_size = $webp->size();
|
||||||
// 获取webp文件mime类型
|
// 获取webp文件mime类型
|
||||||
@@ -171,11 +171,36 @@ class Upload
|
|||||||
'filesha1' => $image_model->file_sha1
|
'filesha1' => $image_model->file_sha1
|
||||||
]);
|
]);
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
|
dump($th);exit;
|
||||||
return error($th->getMessage());
|
return error($th->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
return error('上传失败');
|
return error('上传失败');
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 检查路径
|
||||||
|
*
|
||||||
|
* @param string $path
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function checkPath($path): string
|
||||||
|
{
|
||||||
|
$ok = false;
|
||||||
|
$filename = basename($path);
|
||||||
|
$dirname = dirname($path);
|
||||||
|
if (!is_dir($dirname)) {
|
||||||
|
$ok = @mkdir($dirname, 0755, true);
|
||||||
|
}
|
||||||
|
else if (!is_writable($dirname)) {
|
||||||
|
$ok = @chmod($dirname,0755);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($ok) {
|
||||||
|
return $dirname . '/' . $filename;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new \Exception("上传目标目录不可用");
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 文件名生成回调
|
* 文件名生成回调
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<div class="orico_Page_brand">
|
<div class="orico_Page_brand">
|
||||||
<!--内容 -->
|
<!--内容 -->
|
||||||
<div class="brandMain">
|
<div class="brandMain">
|
||||||
<img src="__IMAGES__/OurBrand.png" class="img-responsive" />
|
<img src="__IMAGES__/OurBrand.webp" class="img-responsive" />
|
||||||
{notempty name="banners"}
|
{notempty name="banners"}
|
||||||
<div class="our_brand_con">
|
<div class="our_brand_con">
|
||||||
{volist name="banners" id="ba" offset="0" length="2"}
|
{volist name="banners" id="ba" offset="0" length="2"}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<!-- 内容 -->
|
<!-- 内容 -->
|
||||||
<div class="downloadMain">
|
<div class="downloadMain">
|
||||||
<div class="topimg">
|
<div class="topimg">
|
||||||
<img src="__IMAGES__/banner_01.png" />
|
<img src="__IMAGES__/banner_01.webp" />
|
||||||
<div class="banner_title">{:lang_i18n('软件和驱动程序')}</div>
|
<div class="banner_title">{:lang_i18n('软件和驱动程序')}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="contact_c">
|
<div class="contact_c">
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<!-- 内容 -->
|
<!-- 内容 -->
|
||||||
<div class="downloadMain">
|
<div class="downloadMain">
|
||||||
<div class="topimg">
|
<div class="topimg">
|
||||||
<img src="__IMAGES__/banner_01.png" />
|
<img src="__IMAGES__/banner_01.webp" />
|
||||||
<div class="banner_title">{:lang_i18n('软件和驱动程序')}</div>
|
<div class="banner_title">{:lang_i18n('软件和驱动程序')}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="contact_c">
|
<div class="contact_c">
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.4 MiB |
BIN
public/static/index/pc/images/OurBrand.webp
Normal file
BIN
public/static/index/pc/images/OurBrand.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 185 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 MiB |
BIN
public/static/index/pc/images/banner_01.webp
Normal file
BIN
public/static/index/pc/images/banner_01.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
Reference in New Issue
Block a user