修复bug

This commit is contained in:
liaofei 2020-04-14 15:13:10 +08:00
parent 6c2cba8e7c
commit 73cbd85243
4 changed files with 5 additions and 4 deletions

View File

@ -400,7 +400,7 @@ class SystemConfig extends AuthController
* 文件上传
* */
public function file_upload(){
$res = Upload::instance()->setUploadPath('config/file')->file($this->request->param('file','file'));
$res = Upload::instance()->setAutoValidate(true)->setUploadPath('config/file')->file($this->request->param('file','file'));
if(!$res->status) return Json::fail($res->error);
return Json::successful('上传成功!',['filePath'=>$res->filePath]);
}

View File

@ -123,8 +123,9 @@ class Images extends AuthController
* @param $att_id
*/
public function deleteimganddata($att_id){
$attinfo = SystemAttachmentModel::get($att_id)->toArray();
$attinfo = SystemAttachmentModel::get($att_id);
if($attinfo){
$attinfo = $attinfo->toArray();
if($attinfo['image_type'] == 1){
@unlink(app()->getRootPath().ltrim($attinfo['att_dir'],'.'));
@unlink(app()->getRootPath().ltrim($attinfo['satt_dir'],'.'));

View File

@ -247,7 +247,7 @@ class UserBillController
$urlCode = $imageInfo['dir'];
} else $urlCode = $imageInfo['att_dir'];
if ($imageInfo['image_type'] == 1) $urlCode = $siteUrl . $urlCode;
$siteUrl = UtilService::setHttpType($siteUrl, 1);
$siteUrl = UtilService::setHttpType($siteUrl, $request->isSsl() ? 0 : 1);
$filelink = [
'Bold' => 'static' . DS . 'font' . DS . 'Alibaba-PuHuiTi-Regular.otf',
'Normal' => 'static' . DS . 'font' . DS . 'Alibaba-PuHuiTi-Regular.otf',

View File

@ -378,7 +378,7 @@ class UploadService
protected function setUploadInfo(string $url, int $imageType, string $name = '', string $thumbPath = '', array $headerArray = [])
{
$headerArray = count($headerArray) ? $headerArray : self::getImageHeaders($url);
if (is_array($headerArray['Content-Type']) && count($headerArray['Content-Length']) == 2) {
if (is_array($headerArray['Content-Length']) && count($headerArray['Content-Length']) == 2) {
$headerArray['Content-Length'] = $headerArray['Content-Length'][1];
}
if (is_array($headerArray['Content-Type']) && count($headerArray['Content-Type']) == 2) {