Browse Source

获取用户信息

pull/1/head
kuaileWu 9 months ago
parent
commit
92488b96e4
  1. 14
      control/index.php

14
control/index.php

@ -174,7 +174,7 @@ class index extends publicBase {
} }
public function ajax_login() { public function ajax_login() {
$code = $this->get('code'); $code = $this->post('code');
if (!$code) $this->ajax_json(false, '非法请求'); if (!$code) $this->ajax_json(false, '非法请求');
$m_user = new mUser(); $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)); $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() { public function ajax_contact_us() {
$this->ajax_json(true, '获取成功', array('img_url' => CONTACT_US_IMG_URL)); $this->ajax_json(true, '获取成功', array('img_url' => CONTACT_US_IMG_URL));
} }

Loading…
Cancel
Save