正在显示
4 个修改的文件
包含
2 行增加
和
52 行删除
| @@ -137,23 +137,6 @@ class BaseController extends Controller | @@ -137,23 +137,6 @@ class BaseController extends Controller | ||
| 137 | throw new HttpResponseException($response); | 137 | throw new HttpResponseException($response); |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | - /** | ||
| 141 | - * @remark :获取文件交接链接 | ||
| 142 | - * @name :getImageUrl | ||
| 143 | - * @author :lyh | ||
| 144 | - * @method :post | ||
| 145 | - * @time :2023/7/20 16:46 | ||
| 146 | - */ | ||
| 147 | - public function getFileUrl($hash){ | ||
| 148 | - $fileModel = new File(); | ||
| 149 | - $info = $fileModel->read(['hash'=>$hash]); | ||
| 150 | - if($info['is_cos'] == 1){ | ||
| 151 | - $cos = new CosService(); | ||
| 152 | - $url = $cos->getImageUrl($info['path']); | ||
| 153 | - }else{ | ||
| 154 | - $url = url('a/file/'.$info['hash']); | ||
| 155 | - } | ||
| 156 | - return $url; | ||
| 157 | - } | 140 | + |
| 158 | 141 | ||
| 159 | } | 142 | } |
| @@ -231,22 +231,4 @@ class BaseController extends Controller | @@ -231,22 +231,4 @@ class BaseController extends Controller | ||
| 231 | return ''; | 231 | return ''; |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | - /** | ||
| 235 | - * @remark :获取文件交接链接 | ||
| 236 | - * @name :getImageUrl | ||
| 237 | - * @author :lyh | ||
| 238 | - * @method :post | ||
| 239 | - * @time :2023/7/20 16:46 | ||
| 240 | - */ | ||
| 241 | - public function getFileUrl($hash){ | ||
| 242 | - $fileModel = new File(); | ||
| 243 | - $info = $fileModel->read(['hash'=>$hash]); | ||
| 244 | - if($info['is_cos'] == 1){ | ||
| 245 | - $cos = new CosService(); | ||
| 246 | - $url = $cos->getImageUrl($info['path']); | ||
| 247 | - }else{ | ||
| 248 | - $url = url('a/file/'.$info['hash']); | ||
| 249 | - } | ||
| 250 | - return $url; | ||
| 251 | - } | ||
| 252 | } | 234 | } |
| @@ -12,18 +12,6 @@ use Illuminate\Support\Facades\Cache; | @@ -12,18 +12,6 @@ use Illuminate\Support\Facades\Cache; | ||
| 12 | 12 | ||
| 13 | class FileController | 13 | class FileController |
| 14 | { | 14 | { |
| 15 | - public $upload_img = [ | ||
| 16 | - //设置静态缓存参数(304) | ||
| 17 | - 'header' => [ | ||
| 18 | - 'Cache-Control' => 'max-age=2592000', | ||
| 19 | - 'Pragma' => 'cache', | ||
| 20 | - 'Expires' => "%Expires%", // cache 1 month | ||
| 21 | - 'etag' => "%etag%", | ||
| 22 | - 'Last-Modified' => "%Last-Modified%", | ||
| 23 | - 'Content-Description' => 'File Transfer', | ||
| 24 | - ], | ||
| 25 | - ]; | ||
| 26 | - | ||
| 27 | public $path = '';//路径 | 15 | public $path = '';//路径 |
| 28 | 16 | ||
| 29 | public $config = '';//存储默认配置 | 17 | public $config = '';//存储默认配置 |
| @@ -22,11 +22,8 @@ class LoginAuthMiddleware | @@ -22,11 +22,8 @@ class LoginAuthMiddleware | ||
| 22 | public function handle(Request $request, Closure $next) | 22 | public function handle(Request $request, Closure $next) |
| 23 | { | 23 | { |
| 24 | $token = $request->header('token'); | 24 | $token = $request->header('token'); |
| 25 | - if(!isset($token) || empty($token)){ | ||
| 26 | - return response(['code'=>Code::USER_LOGIN_ERROE,'msg'=>'当前用户未登录']); | ||
| 27 | - } | ||
| 28 | $info = Cache::get($token); | 25 | $info = Cache::get($token); |
| 29 | - if(empty($info)){ | 26 | + if(empty($info) || empty($token)){ |
| 30 | return response(['code'=>Code::USER_LOGIN_ERROE,'msg'=>'当前用户未登录']); | 27 | return response(['code'=>Code::USER_LOGIN_ERROE,'msg'=>'当前用户未登录']); |
| 31 | } | 28 | } |
| 32 | // 设置数据信息 | 29 | // 设置数据信息 |
-
请 注册 或 登录 后发表评论