From 92488b96e4e01224d7d5e53273877ec5da36f90e Mon Sep 17 00:00:00 2001 From: kuaileWu <1432334894@qq.com> Date: Tue, 3 Sep 2024 15:22:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- control/index.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/control/index.php b/control/index.php index 9df35eb..e8cfa3c 100644 --- a/control/index.php +++ b/control/index.php @@ -174,7 +174,7 @@ class index extends publicBase { } public function ajax_login() { - $code = $this->get('code'); + $code = $this->post('code'); if (!$code) $this->ajax_json(false, '非法请求'); $m_user = new mUser(); @@ -184,6 +184,18 @@ class index extends publicBase { $this->ajax_json(true, '登录成功', array('uid' => $user['uid'], 'identifier' => $user['identifier'], 'token' => $token)); } + public function get_user() { + $uid = $this->post('uid'); + $token = $this->post('token'); + if (empty($uid) || empty($token)) $this->ajax_json(false, '未登录或登录已经失效', array('code' => CODE_LOGIN_EXIPRE)); + + $obj = new mUser(); + $uinfo = $obj->getUserByUid($uid); + if(empty($uinfo)) $this->ajax_json(false, '未登录或登录已经失效', array('code' => CODE_LOGIN_EXIPRE)); + + $this->ajax_json(true, '', $uinfo); + } + public function ajax_contact_us() { $this->ajax_json(true, '获取成功', array('img_url' => CONTACT_US_IMG_URL)); }