From e8f99790d0357d19a648040a8bd09a4b765c807b Mon Sep 17 00:00:00 2001
From: pengda <10266652509@qq.com>
Date: Fri, 21 Mar 2025 16:55:59 +0800
Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E9=99=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 config/define.php              | 4 ++--
 control/weibo.php              | 4 +++-
 index.php                      | 6 +++---
 view/templates/weibo/home.html | 4 ++--
 4 files changed, 10 insertions(+), 8 deletions(-)

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 @@
                 <img src="{$smarty.const.CSS_URL}/images/home-more.png" alt="">
                 <div class="dropdown">
                     <button class="dropdown-toggle">
-                        学术论文出版
+                        {$nickname}
                         <img class="icon" src="{$smarty.const.CSS_URL}/images/drop-icon.svg" alt="">
                     </button>
                     <div class="dropdown-panel">
-                        <a href="#">退出</a>
+                        <a href="/loginout">退出</a>
                     </div>
                 </div>
             </div>
-- 
1.8.3.1