This commit is contained in:
Dai 2024-07-23 22:18:17 +08:00
parent 60f22db576
commit f92658ffed
2 changed files with 12 additions and 2 deletions

View File

@ -4,6 +4,7 @@ namespace app\api\controller;
use app\BaseController;
use app\common\service\StudentService;
use app\constant\ResponseCode;
use support\Request;
class StudentController extends BaseController
@ -37,7 +38,11 @@ class StudentController extends BaseController
$url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=$appid&redirect_uri=$redirect_uri&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect";
// $url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=$appid&redirect_uri=$redirect_uri&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
return redirect($url);
return $this->json([
'code' => ResponseCode::SUCCESS,
'data' => $url
]);
// return redirect($url);
}
/**

View File

@ -4,6 +4,7 @@ namespace app\api\controller;
use app\BaseController;
use app\common\service\TeacherService;
use app\constant\ResponseCode;
use support\Request;
class TeacherController extends BaseController
@ -30,7 +31,11 @@ class TeacherController extends BaseController
$redirect_uri = urlencode(getenv('SERVER_DOMAIN') . "/h5#/pages/login/login");//重定向地址
$url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=$appid&redirect_uri=$redirect_uri&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect";
return redirect($url);
return $this->json([
'code' => ResponseCode::SUCCESS,
'data' => $url
]);
// return redirect($url);
}
/**