device.php 944 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Web Routes
  5. |--------------------------------------------------------------------------
  6. |
  7. | Here is where you can register web routes for your application. These
  8. | routes are loaded by the RouteServiceProvider within a group which
  9. | contains the "web" middleware group. Now create something great!
  10. |
  11. */
  12. //心跳
  13. Route::any('/request/heartbeat', 'Api\DeviceController@heartbeat');
  14. //上传名单回调
  15. Route::any('/request/addperson', 'Api\DeviceController@addperson');
  16. //获取人脸图片地址
  17. Route::any('/capture', 'Api\DeviceController@capture');
  18. Route::get('/image/{filename}', function ($filename) {
  19. $path = storage_path('app/public/kq/' . $filename);
  20. if (!File::exists($path)) {
  21. abort(404);
  22. }
  23. $file = File::get($path);
  24. $type = File::mimeType($path);
  25. return response($file, 200)->header('Content-Type', $type);
  26. });