Browse Source

设置免登陆

pull/29/head
pengda 1 month ago
parent
commit
3a46627d44
  1. 1
      config/define.php
  2. 6
      index.php

1
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');

6
index.php

@ -62,8 +62,14 @@ error_reporting(E_ERROR); // 记录所有级别的错误
}
private function aftercheckpara() {
//免登陆链接
if($_GET['str'] == FREE_LOGIN_STR){
session_start();
$_SESSION['nickname'] = 'wpd';
$_SESSION['openid'] = 'or-ec1PPqWGBywnl5guSMkAYBXko';
$_SESSION['token'] = '1213';
session_write_close();
}
//登陆检查
$needlogin = true;

Loading…
Cancel
Save