From b509c94bc7e9c2b36bba37b3aeb002f3a17a013d Mon Sep 17 00:00:00 2001 From: Dai Date: Thu, 25 Jul 2024 10:52:13 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/TeacherController.php | 10 +++++----- config/route.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/api/controller/TeacherController.php b/app/api/controller/TeacherController.php index fba15a5..09ef179 100644 --- a/app/api/controller/TeacherController.php +++ b/app/api/controller/TeacherController.php @@ -30,16 +30,16 @@ class TeacherController extends BaseController { $appid = getenv('APP_ID'); - $redirect_uri = urlencode(getenv('SERVER_DOMAIN') . "/h5/#/pages/index/index");//重定向地址 + $redirect_uri = urlencode(getenv('SERVER_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"; $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 $this->json([ + 'code' => ResponseCode::SUCCESS, + 'data' => $url + ]); return redirect($url); } diff --git a/config/route.php b/config/route.php index 730fa3b..9ee6998 100644 --- a/config/route.php +++ b/config/route.php @@ -17,7 +17,7 @@ use Webman\Route; // 默认路由 Route::any('/', [\plugin\admin\app\controller\IndexController::class, 'index']); -Route::any('/h5/', function (){ +Route::any('/h5', function (){ // return view(public_path() . '/h5'); return view('../../public/h5/index'); });