Skip to content

Commit

Permalink
first_add_slir
Browse files Browse the repository at this point in the history
  • Loading branch information
zerolethanh committed Dec 13, 2016
1 parent d49d210 commit 201c8c5
Show file tree
Hide file tree
Showing 9 changed files with 7,679 additions and 127 deletions.
5 changes: 5 additions & 0 deletions .idea/lapp.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions app/Http/Controllers/PhotoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Illuminate\Support\Facades\Crypt;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Validator;
use Symfony\Component\HttpFoundation\File\UploadedFile;

Expand Down Expand Up @@ -74,8 +75,12 @@ public function getUpload(Request $request, $event_id = null)

$this->user->increment('photo_last_group_id');

if (file_exists($view = "/var/www/html/js/jqFileUploads/index.php")) {
return view()->file($view, ['gid' => $this->user->photo_last_group_id, 'event' => $event]);
$indexFiles = [public_path('/js/jqFileUploads/index.php'), '/var/www/html/js/jqFileUploads/index.php'];

foreach ($indexFiles as $file) {
if (file_exists($file)) {
return view()->file($file, ['gid' => $this->user->photo_last_group_id, 'event' => $event]);
}
}

return 'view not found';
Expand Down Expand Up @@ -400,7 +405,12 @@ function createThumb($filename, Photo $photo, $newwidth = 100, $newheight = 100,
{
// /slir/h100/65/2/356_mori.JPG
$slirPath = $this->slirPath($photo);
copy("http://153.120.167.173/slir/h200/$slirPath", $this->photoThumbFullPath($photo));
$baseURL = 'http://153.120.167.173';
if (env('APP_ENV') === 'local') {
$baseURL = 'http://127.0.0.1';
}
@copy("$baseURL/slir/h200/$slirPath", $this->photoThumbFullPath($photo));


// header("Content-Type: $photo->mime");
// list($width, $height) = getimagesize($filename);
Expand Down
9 changes: 9 additions & 0 deletions app/Http/mobile.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
/**
* User: ZE
* Date: 2016/11/30
* Time: 2:37
*/
Route::get('token',function (){
return request()->session()->token();
});
12 changes: 12 additions & 0 deletions app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ public function map(Router $router)
require app_path('Http/routes.php');
});

$this->registerMobileRouter($router);

}

public function registerMobileRouter(Router $router)
{
$router->group([
'prefix' => 'api', 'namespace' => $this->namespace, 'middleware' => 'api',
], function ($router) {
require app_path('Http/mobile.php');
});


}
}
Loading

0 comments on commit 201c8c5

Please sign in to comment.