修正oss类

This commit is contained in:
wucongxing 2023-02-22 11:54:08 +08:00
parent fe23aee366
commit 2c04c5e192
2 changed files with 17 additions and 3 deletions

View File

@ -17,7 +17,7 @@ class SafeService extends BaseService
public function getOssSign(): array
{
$user_type = $this->request->input('user_type');
$path = $this->request->input('path');
$scene = $this->request->input('scene');
$user_info = $this->request->getAttribute("userInfo") ?? [];
if (empty($user_info)){
@ -32,7 +32,21 @@ class SafeService extends BaseService
$dir = "applet/pharmacist/";
}
$dir = $dir . $path;
$dir = $dir . $scene;
switch ($scene) {
case 1:
// 头像
$dir = $dir . 'avatar/';
break;
case 2:
// 证书
$dir = $dir . 'cert/';
break;
default:
// code...
break;
}
// 获取用户数据
$params = array();

View File

@ -57,7 +57,7 @@ class Oss
$response = array();
$response['accessid'] = $this->config['accessKey'];
$response['host'] = $this->config['bucket'] . '.' . $this->config['endpoint'];
$response['host'] = "https://" . $this->config['bucket'] . '.' . $this->config['endpoint'];
$response['policy'] = $base64_policy;
$response['signature'] = $signature;
$response['expire'] = $end;