IndexController.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace App\Http\Controllers\V1;
  3. use App\Auth;
  4. use App\libs\google\GoogleOauth;
  5. use App\libs\helpers\Curl;
  6. use App\libs\helpers\LogHelper;
  7. use App\libs\wechat\auth\WeChat;
  8. use App\Models\Help;
  9. use App\Models\Region;
  10. use Illuminate\Http\Request;
  11. use App\Models\Setting;
  12. use Illuminate\Support\Facades\Redis;
  13. use App\libs\helpers\Response;
  14. class IndexController extends Controller
  15. {
  16. private $code = '_Index';
  17. /**
  18. * 首页
  19. *
  20. * @return \Illuminate\Http\JsonResponse
  21. */
  22. public function index(){
  23. try {
  24. $google = GoogleOauth::appAuth();
  25. // $weChat = WeChat::General();
  26. // $userInfo = $weChat->auth('snsapi_userinfo');
  27. // $userInfo = $weChat->userDetailInfo($userInfo['openid']);
  28. var_dump($google);
  29. return Response::success();
  30. }catch (\Exception $exception){
  31. LogHelper::exceptionLog($exception,$this->code);
  32. return Response::fail($exception->getMessage());
  33. }
  34. }
  35. //隐私政策
  36. public function privacyPolice()
  37. {
  38. $info = Setting::where('key', 'privacy')->where('is_delete', 0)->select('title', 'key', 'value')->first();
  39. return $this->success($info);
  40. }
  41. //用户协议
  42. public function userAgreement()
  43. {
  44. $info = Setting::where('key', 'agreement')->where('is_delete', 0)->select('title', 'key', 'value')->first();
  45. return $this->success($info);
  46. }
  47. //关于我们
  48. public function aboutus()
  49. {
  50. $info = Setting::where('key', 'aboutus')->where('is_delete', 0)->select('title', 'key', 'value')->first();
  51. return $this->success($info);
  52. }
  53. }