OAuth.php 983 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | A3Mall
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2020 http://www.a3-mall.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Author: xzncit <158373108@qq.com>
  8. // +----------------------------------------------------------------------
  9. namespace app\api\controller\wechat;
  10. use think\facade\Request;
  11. use app\api\controller\Base;
  12. use app\api\service\wechat\OAuth as OAuthService;
  13. use app\common\library\oauth\QQ;
  14. use app\common\library\oauth\WeChat;
  15. class OAuth extends Base {
  16. /**
  17. * 登录
  18. * @return \think\response\Json
  19. */
  20. public function login(){
  21. try {
  22. return $this->returnAjax("ok",1,OAuthService::login(Request::param()));
  23. }catch (\Exception $ex){
  24. return $this->returnAjax($ex->getMessage(),$ex->getCode());
  25. }
  26. }
  27. }