From 3a46627d44ca5db2cd48a70f94b5244e8c5e100c Mon Sep 17 00:00:00 2001 From: pengda <10266652509@qq.com> Date: Fri, 11 Apr 2025 10:20:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=85=8D=E7=99=BB?= =?UTF-8?q?=E9=99=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/define.php | 1 + index.php | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config/define.php b/config/define.php index 1b4d021..3bafc3b 100644 --- a/config/define.php +++ b/config/define.php @@ -30,6 +30,7 @@ define('ADMIN_USER_OPEN', 1); define('ADMIN_USER_CLOSE', 2); + define('FREE_LOGIN_STR', '2c131fa45a19a7aa6d9d0123g'); define('WEIXIN_OPEN_APPID','wx68a1060c4ec4722f'); define('WEIXIN_OPEN_APPSCRET','9f8a1dd8352e1150a40ebf3262429f69'); define('WEIXIN_OPEN_GET_ACCESS_TOKEN','https://api.weixin.qq.com/sns/oauth2/access_token?appid=%s&secret=%s&code=%s&grant_type=authorization_code'); diff --git a/index.php b/index.php index e8e4bb1..0b2dc41 100644 --- a/index.php +++ b/index.php @@ -62,8 +62,14 @@ error_reporting(E_ERROR); // 记录所有级别的错误 } private function aftercheckpara() { - session_start(); - session_write_close(); + //免登陆链接 + if($_GET['str'] == FREE_LOGIN_STR){ + session_start(); + $_SESSION['nickname'] = 'wpd'; + $_SESSION['openid'] = 'or-ec1PPqWGBywnl5guSMkAYBXko'; + $_SESSION['token'] = '1213'; + session_write_close(); + } //登陆检查 $needlogin = true; From 2d1b65dcf98afdbd7173cd4b1a219aeb355b45d1 Mon Sep 17 00:00:00 2001 From: pengda <10266652509@qq.com> Date: Fri, 11 Apr 2025 10:21:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=85=8D=E7=99=BB?= =?UTF-8?q?=E9=99=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.php b/index.php index 0b2dc41..1ec327b 100644 --- a/index.php +++ b/index.php @@ -62,6 +62,9 @@ error_reporting(E_ERROR); // 记录所有级别的错误 } private function aftercheckpara() { + session_start(); + session_write_close(); + //免登陆链接 if($_GET['str'] == FREE_LOGIN_STR){ session_start();