This commit is contained in:
2022-09-09 15:17:37 +08:00
parent e395dd279d
commit a940c7c021
2 changed files with 11 additions and 3 deletions

4
.env
View File

@@ -28,6 +28,6 @@ REGIONID=cn-hangzhou
SIGNNAME=域展科技
TEMPLATECODE=SMS_176560077
OSS_BUCKET=hphb-storage
OSS_ENDPOINT=hphb-cdn.uzchain.tech
#OSS_ENDPOINT=oss-cn-beijing.aliyuncs.com
CDN_NAME=hphb-cdn.uzchain.tech
OSS_ENDPOINT=oss-cn-beijing.aliyuncs.com

View File

@@ -236,7 +236,15 @@ if (! function_exists('aliyun')) {
if (empty($info['info']['url'])) {
return ['code' => 1, 'message' => "上传失败"];
}
return ['code' => 0, 'message' => "", 'url' => $info['info']['url']];
return [
'code' => 0,
'message' => "",
'url' => str_replace(
env('ALIYUNSMS.OSS_BUCKET').'.'.env('ALIYUNSMS.OSS_ENDPOINT'),
env('ALIYUNSMS.CDN_NAME'),
$info['info']['url']
),
];
} catch (OssException $e) {
return ['code' => 1, 'message' => $e->getMessage()];
}