| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 | <?php/*|--------------------------------------------------------------------------| Web Routes|--------------------------------------------------------------------------|| Here is where you can register web routes for your application. These| routes are loaded by the RouteServiceProvider within a group which| contains the "web" middleware group. Now create something great!|*///心跳Route::any('/request/heartbeat', 'Api\DeviceController@heartbeat');//上传名单回调Route::any('/request/addperson', 'Api\DeviceController@addperson');//获取人脸图片地址Route::any('/capture', 'Api\DeviceController@capture');Route::get('/image/{filename}', function ($filename) {    $path = storage_path('app/public/' . $filename);    $path = $path.'.jpg';    if (!File::exists($path)) {        abort(404);    }    $file = File::get($path);    $type = File::mimeType($path);    return response($file, 200)->header('Content-Type', $type);});//获取考勤的图片Route::get('/kq/image/{filename}', function ($filename) {    $last_dir = explode('_',$filename)[0];    $path = storage_path('app/kq/'.date('Ymd',$last_dir).'/' . $filename);    $path = $path.'.jpg';    if (!File::exists($path)) {        abort(404);    }    $file = File::get($path);    $type = File::mimeType($path);    return response($file, 200)->header('Content-Type', $type);});
 |