This commit is contained in:
2022-09-08 16:43:38 +08:00
parent 2db27956f8
commit 3444b93c1c
10 changed files with 25 additions and 25 deletions

View File

@@ -161,9 +161,9 @@ use OSS\OssClient;
if (!function_exists('aliyun')) {
function aliyun($savePath, $category = '', $isunlink = false, $bucket = "hphb-storage")
{
$accessKeyId = env('aliyunsms.accessKeyId');//去阿里云后台获取秘钥
$accessKeySecret = env('aliyunsms.accesskey');//去阿里云后台获取秘钥
$endpoint = env('aliyunsms.oss_endpoint');//你的阿里云OSS地址
$accessKeyId = env('ALIYUNSMS.accessKeyId');//去阿里云后台获取秘钥
$accessKeySecret = env('ALIYUNSMS.accesskey');//去阿里云后台获取秘钥
$endpoint = env('ALIYUNSMS.oss_endpoint');//你的阿里云OSS地址
$ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint);
// 判断bucketname是否存在不存在就去创建
if (!$ossClient->doesBucketExist($bucket)) {
@@ -172,7 +172,7 @@ if (!function_exists('aliyun')) {
$category = empty($category) ? $bucket : $category;
$savePath = str_replace("\\", "/", $savePath);
$object = '/' . $savePath;//想要保存文件的名称
$file = env("upload_directory").'\\' . $savePath;//文件路径,必须是本地的。
$file = env("UPLOAD_DIRECTORY").'\\' . $savePath;//文件路径,必须是本地的。
try {
echo 'bc';
@@ -185,7 +185,7 @@ if (!function_exists('aliyun')) {
} catch (OssException $e) {
echo $e->getErrorMessage();
}
$web = "https://hphb-storage.".env('aliyunsms.oss_endpoint').'/'.$object;//这里是你阿里云oss外网访问的Bucket域名
$web = "https://hphb-storage.".env('ALIYUNSMS.oss_endpoint').'/'.$object;//这里是你阿里云oss外网访问的Bucket域名
return $web;
}
}
@@ -194,13 +194,13 @@ if (!function_exists('aliyun')) {
function aliyun($localfile = '', $path = '')
{
$config = [
'access' => env('aliyunsms.accessKeyId'),
'access_key' => env('aliyunsms.accesskey'),
'access' => env('ALIYUNSMS.ACCESSKEYID'),
'access_key' => env('ALIYUNSMS.ACCESSKEY'),
'bucket' => 'hphb-storage',
'url' => 'https://oss-cn-beijing.aliyuncs.com'
];
$path = "r/".$localfile;
$localfile = env("upload_directory").'/' . $localfile;//文件路径,必须是本地的。
$localfile = env("UPLOAD_DIRECTORY").'/' . $localfile;//文件路径,必须是本地的。
if (!file_exists($localfile)) {
return ('Not found file');
}
@@ -255,7 +255,7 @@ function StudentToArray($list = []) : array {
"age"=>$vo['age'],
];
}
if(count($list)<env("page_count")){
if(count($list)<env("PAGE_COUNT")){
$result["lastIndex"] = 0;
}
return $result;