|
@ -181,25 +181,10 @@ class index extends publicBase { |
|
|
if (!$code)$this->ajax_json(false, '非法请求'); |
|
|
if (!$code)$this->ajax_json(false, '非法请求'); |
|
|
|
|
|
|
|
|
$m_user = new mUser(); |
|
|
$m_user = new mUser(); |
|
|
$openid = $m_user->getOpenid($code); |
|
|
$uid = $m_user->getUid($code); |
|
|
if (!$openid)$this->ajax_json(false, $m_user->getError()); |
|
|
$token = $m_user->getToken($uid); |
|
|
|
|
|
|
|
|
$user = $m_user->getUserByOpenid($openid); |
|
|
$this->ajax_json(true, '登录成功', array('uid' => $uid, 'token'=> $token)); |
|
|
if ($user){ |
|
|
|
|
|
$token = $m_user->getToken($user['uid']); |
|
|
|
|
|
$this->ajax_json(true, '登录成功', array('uid' => $user['uid'], 'token'=> $token)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//获取唯一uid串 |
|
|
|
|
|
$uid = $m_user->createUniqueUid($openid); |
|
|
|
|
|
$user = $m_user->getUserByUid($uid); |
|
|
|
|
|
if ($user)$this->ajax_json(false, 'uid生成失败'); |
|
|
|
|
|
|
|
|
|
|
|
$id = $m_user->createUser(array('uid'=>$uid,'openid'=>$openid)); |
|
|
|
|
|
if (!$id)$this->ajax_json(false, '用户创建失败'); |
|
|
|
|
|
|
|
|
|
|
|
$token = $m_user->getToken($user['uid']); |
|
|
|
|
|
$this->ajax_json(true, '登录成功', array('uid' => $user['uid'], 'token'=> $token)); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function ajax_contact_us(){ |
|
|
public function ajax_contact_us(){ |
|
|