作者 lyh

gx

... ... @@ -137,23 +137,6 @@ class BaseController extends Controller
throw new HttpResponseException($response);
}
/**
* @remark :获取文件交接链接
* @name :getImageUrl
* @author :lyh
* @method :post
* @time :2023/7/20 16:46
*/
public function getFileUrl($hash){
$fileModel = new File();
$info = $fileModel->read(['hash'=>$hash]);
if($info['is_cos'] == 1){
$cos = new CosService();
$url = $cos->getImageUrl($info['path']);
}else{
$url = url('a/file/'.$info['hash']);
}
return $url;
}
}
... ...
... ... @@ -231,22 +231,4 @@ class BaseController extends Controller
return '';
}
/**
* @remark :获取文件交接链接
* @name :getImageUrl
* @author :lyh
* @method :post
* @time :2023/7/20 16:46
*/
public function getFileUrl($hash){
$fileModel = new File();
$info = $fileModel->read(['hash'=>$hash]);
if($info['is_cos'] == 1){
$cos = new CosService();
$url = $cos->getImageUrl($info['path']);
}else{
$url = url('a/file/'.$info['hash']);
}
return $url;
}
}
... ...
... ... @@ -12,18 +12,6 @@ use Illuminate\Support\Facades\Cache;
class FileController
{
public $upload_img = [
//设置静态缓存参数(304)
'header' => [
'Cache-Control' => 'max-age=2592000',
'Pragma' => 'cache',
'Expires' => "%Expires%", // cache 1 month
'etag' => "%etag%",
'Last-Modified' => "%Last-Modified%",
'Content-Description' => 'File Transfer',
],
];
public $path = '';//路径
public $config = '';//存储默认配置
... ...
... ... @@ -22,11 +22,8 @@ class LoginAuthMiddleware
public function handle(Request $request, Closure $next)
{
$token = $request->header('token');
if(!isset($token) || empty($token)){
return response(['code'=>Code::USER_LOGIN_ERROE,'msg'=>'当前用户未登录']);
}
$info = Cache::get($token);
if(empty($info)){
if(empty($info) || empty($token)){
return response(['code'=>Code::USER_LOGIN_ERROE,'msg'=>'当前用户未登录']);
}
// 设置数据信息
... ...