This commit is contained in:
2025-04-30 14:38:54 +08:00
parent 05f0c795ac
commit 4c2beebfe6
3 changed files with 15 additions and 10 deletions
+10 -5
View File
@@ -1,9 +1,14 @@
# db
DB_HOST = '127.0.0.1'
DB_HOST = '1Panel-mysql-sLiG'
DB_PORT = 3306
DB_NAME = 'car_info'
DB_USER = 'root'
DB_PASSWORD = 'root'
DB_USER = 'car_info'
DB_PASSWORD = 'btciadYXir7kXC6x'
WEBMAN_LISTEN = 'http://0.0.0.0:9007'
WEBMAN_COUNT = 4
WEBMAN_LISTEN = 'http://0.0.0.0:9021'
WEBMAN_COUNT = 2
OSS_ACCESS_KEY_ID=LTAI5tAGiH7bkVkmrniXnfkA
OSS_ACCESS_KEY_SECRET=nqklJBft6t3S0A4ZvxF4ci9ni91kmm
OSS_BUCKET=vehicle-album
OSS_ENDPOINT=https://oss-cn-beijing.aliyuncs.com
+4 -4
View File
@@ -15,10 +15,10 @@ class OssService
public function __construct()
{
$this->accessKeyId = 'LTAI5tAGiH7bkVkmrniXnfkA';
$this->accessKeySecret = 'nqklJBft6t3S0A4ZvxF4ci9ni91kmm';
$this->bucket = 'vehicle-album';
$this->endpoint = 'https://oss-cn-beijing.aliyuncs.com';
$this->accessKeyId = env('OSS_ACCESS_KEY_ID');
$this->accessKeySecret = env('OSS_ACCESS_KEY_SECRET');
$this->bucket = env('OSS_BUCKET', 'vehicle-album');
$this->endpoint = env('OSS_ENDPOINT', 'https://oss-cn-beijing.aliyuncs.com');
$this->ossClient = new OssClient($this->accessKeyId, $this->accessKeySecret, $this->endpoint);
}
@@ -130,7 +130,7 @@ class VehicleController extends Crud
if(!str_starts_with($item['img_url'], 'http')){
$ossservice = new OssService();
$img_url = $ossservice->generatePrivateUrl($item['img_url'],86400);
$img_url = $ossservice->generatePrivateUrl($item['img_url'], 3600);
$item['img_url'] = $img_url;
}
}