You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
874 B

2 months ago
<?php
/**
*
*/
include_once(dirname(dirname(__FILE__))."/library/publicBase.php");
class callback extends publicBase {
public function wxlogin() {
if(empty($this->get('code'))) $this->show_message('登录失败,请重新登录','goback');
$state = explode('-', $this->get('state'));
if ($state[0] == CALLBACK_KNOWLEDGE_LOGIN) {
$obj = new mManage();
$res = $obj->weixinLogin($this->get('code'), $this->get('state'));
if (!$res) $this->show_message($obj->getError(), 'goback');
session_start();
2 months ago
$_SESSION['nickname'] = $res['nickname'];
2 months ago
$_SESSION['openid'] = $res['openid'];
$_SESSION['token'] = $res['jwttoken'];
session_write_close();
header('Location:'.urldecode($state[1]));
exit;
}
exit;
}
}