diff --git a/config/define.php b/config/define.php index 09a469e..b9a398c 100644 --- a/config/define.php +++ b/config/define.php @@ -21,8 +21,8 @@ define('CALLBACK_KNOWLEDGE_LOGIN', 'knowledge_login'); - define('WEIXIN_OPEN_APPID','wxd31fa56cbcd5c650'); - define('WEIXIN_OPEN_APPSCRET','5e6d75001fca1b13788ece389b2bd40d'); + 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'); define('WEIXIN_OPEN_GET_PERSONAL_INFORMATION','https://api.weixin.qq.com/sns/userinfo?access_token=%s&openid=%s'); diff --git a/control/weibo.php b/control/weibo.php index 8377d3e..e1a0339 100644 --- a/control/weibo.php +++ b/control/weibo.php @@ -7,7 +7,9 @@ include_once(dirname(dirname(__FILE__)) . "/library/publicBase.php"); class weibo extends publicBase { - public function home() {} + public function home() { + $this->view['nickname'] = $_SESSION['nickname']; + } public function ajax_weibo_list() { $status = $this->post('status') + 0; diff --git a/index.php b/index.php index 127fc90..8aa862e 100644 --- a/index.php +++ b/index.php @@ -31,7 +31,7 @@ error_reporting(E_ERROR); // 记录所有级别的错误 $this->control_name = $array[0]; $this->control_func = !isset($array[1]) || $array[1]=='' ? 'home' : $array[1]; - if(preg_match('/^(login|login_submit).*/', $this->control_name)){ + if(preg_match('/^(login|loginout).*/', $this->control_name)){ $this->control_name = 'index'; $this->control_func = $array[0]; } @@ -66,9 +66,9 @@ error_reporting(E_ERROR); // 记录所有级别的错误 session_write_close(); //登陆检查 - $needlogin = false; + $needlogin = true; if ($this->control_name == 'index') { - if (preg_match('/^(login|login_submit).*/', $this->control_func)) { + if (preg_match('/^(login).*/', $this->control_func)) { $needlogin = false; } }elseif($this->control_name == 'callback'){ diff --git a/view/templates/weibo/home.html b/view/templates/weibo/home.html index c7edc9d..b6155fa 100644 --- a/view/templates/weibo/home.html +++ b/view/templates/weibo/home.html @@ -18,11 +18,11 @@