修正oss类
This commit is contained in:
parent
fe23aee366
commit
2c04c5e192
@ -17,7 +17,7 @@ class SafeService extends BaseService
|
|||||||
public function getOssSign(): array
|
public function getOssSign(): array
|
||||||
{
|
{
|
||||||
$user_type = $this->request->input('user_type');
|
$user_type = $this->request->input('user_type');
|
||||||
$path = $this->request->input('path');
|
$scene = $this->request->input('scene');
|
||||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||||
|
|
||||||
if (empty($user_info)){
|
if (empty($user_info)){
|
||||||
@ -32,7 +32,21 @@ class SafeService extends BaseService
|
|||||||
$dir = "applet/pharmacist/";
|
$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();
|
$params = array();
|
||||||
|
|||||||
@ -57,7 +57,7 @@ class Oss
|
|||||||
|
|
||||||
$response = array();
|
$response = array();
|
||||||
$response['accessid'] = $this->config['accessKey'];
|
$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['policy'] = $base64_policy;
|
||||||
$response['signature'] = $signature;
|
$response['signature'] = $signature;
|
||||||
$response['expire'] = $end;
|
$response['expire'] = $end;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user