Skip to content

Commit 53dab66

Browse files
author
derek
committed
update qiniuoss and aliyunoss
1 parent 227f4b0 commit 53dab66

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

app/Controller/Admin/SysOssController.php

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -183,27 +183,6 @@ public function sysOssUpload()
183183
} catch (\Exception $e) {
184184
return $this->response->error($e->getMessage());
185185
}
186-
187-
/*$auth = new Auth($config['qiniuAccessKey'], $config['qiniuSecretKey']);
188-
$uploadToken = $auth->uploadToken($config['qiniuBucketName']);
189-
$upload_mgr = new UploadManager();
190-
$rel = $upload_mgr->putFile($uploadToken, $config['qiniuPrefix'] . "/" . $file->getClientFilename(), $fileName);
191-
192-
if (empty($rel[0])) {
193-
return $this->response->error("请检查七牛云的oss配置");
194-
}
195-
196-
if (!empty($rel) && file_exists($fileName)) {
197-
unlink($fileName);
198-
}
199-
$url = $config['qiniuDomain'] . "/" . $rel[0]['key'];
200-
201-
$data = [
202-
'url' => $url,
203-
'create_date' => date("Y-m-d h:i:s", time())
204-
];
205-
$result = $this->commonService->sysOssSave($data);*/
206-
207186
}
208187

209188
// 阿里云
@@ -218,27 +197,6 @@ public function sysOssUpload()
218197
} catch (\Exception $e) {
219198
return $this->response->error($e->getMessage());
220199
}
221-
222-
/*try {
223-
$ossClient = new OssClient($config['aliyunAccessKeyId'], $config['aliyunAccessKeySecret'], $config['aliyunEndPoint']);
224-
$aliOssResult = $ossClient->uploadFile($config['aliyunBucketName'], $config['aliyunPrefix'] . "/" . $file->getClientFilename(), $fileName);
225-
if (is_array($aliOssResult) && !empty($aliOssResult['oss-request-url'])) {
226-
$data = [
227-
'url' => $aliOssResult['oss-request-url'],
228-
'create_date' => date("Y-m-d h:i:s", time())
229-
];
230-
// 删除本地文件
231-
if (file_exists($fileName)) {
232-
unlink($fileName);
233-
}
234-
$result = $this->commonService->sysOssSave($data);
235-
} else {
236-
return $this->response->error("请检查阿里云的oss配置");
237-
}
238-
} catch (OssException $e) {
239-
Log::get()->error($e->getMessage());
240-
return $this->response->error("请检查阿里云的oss配置");
241-
}*/
242200
}
243201

244202
// 本地

0 commit comments

Comments
 (0)