diff --git a/app/api/controller/TeacherController.php b/app/api/controller/TeacherController.php index 0dcf4cc..21df9d3 100644 --- a/app/api/controller/TeacherController.php +++ b/app/api/controller/TeacherController.php @@ -29,18 +29,12 @@ class TeacherController extends BaseController public function getCode(Request $request) { $appid = getenv('APP_ID'); - $domain = getenv('SERVER_DOMAIN'); - $redirect_uri = urlencode("$domain/h5#/pages/index/index");//重定向地址 -// $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"; + $redirect_uri = urlencode(getenv('SERVER_DOMAIN') . "/h5#/pages/index/index");//重定向地址 $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 $this->json([ 'code' => ResponseCode::SUCCESS, 'data' => $url ]); - return redirect($url); } /**