web.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. use \Illuminate\Support\Facades\Route;
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Web Routes
  6. |--------------------------------------------------------------------------
  7. |
  8. | Here is where you can register web routes for your application. These
  9. | routes are loaded by the RouteServiceProvider within a group which
  10. | contains the "web" middleware group. Now create something great!
  11. |
  12. */
  13. Route::group(['middleware' => ['web', 'wechat.oauth:default,snsapi_userinfo']], function () {
  14. Route::any('wechat', 'WechatController@index');
  15. });
  16. Route::get('/', function () {
  17. return redirect('/admin/login');
  18. });
  19. Route::get('attachment/{md5}', [
  20. 'as' => 'attachment.download',
  21. 'uses' => 'Web\AttachmentController@download',
  22. ]);
  23. Route::get('image/{md5}', [
  24. 'as' => 'attachment.image',
  25. 'uses' => 'Web\AttachmentController@image',
  26. ]);
  27. Route::get('/test',function() {
  28. // $password = bcrypt('admin');
  29. // dd($password);
  30. // dd(dict()->get('user_info','work_type'));
  31. // $password = bcrypt('admin');
  32. // dd($password);
  33. $obj = new \App\Services\User\Info();
  34. $obj = $obj->find(1);
  35. // var_dump($obj);exit;
  36. // $user = UserInfoModel::find(1);
  37. dump(Auth::guard('admin')->user());
  38. Auth::login($obj);
  39. dd(Auth::user());
  40. });
  41. //Route::get('/test', 'Web\AuthController@test');