IndexController.php 1.7 KB

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