|
|
@@ -9,23 +9,8 @@ try {
|
|
|
$code = safeCheck($_POST["code"], 0);
|
|
|
$weixin_public = new weixin_public(APPID, APPSECRET, APPURI);
|
|
|
$info = $weixin_public->getAllInfo($code);
|
|
|
+ echo action_msg($info, 200);
|
|
|
|
|
|
- echo action_msg($info, 300);
|
|
|
- exit;
|
|
|
-
|
|
|
- if (empty($info['openid'])) {
|
|
|
- echo action_msg($info['errmsg'], $info['errcode']);
|
|
|
- exit;
|
|
|
- } else {
|
|
|
- $attr = Reader::getInfoByOpenId($info['openid']);
|
|
|
- if (empty($attr)) {
|
|
|
- Reader::add($attr);
|
|
|
- } else {
|
|
|
- Reader::update($attr['id'], $info);
|
|
|
- }
|
|
|
- echo action_msg($info, 200);
|
|
|
- exit;
|
|
|
- }
|
|
|
} catch (MyException $e) {
|
|
|
echo action_msg($e->getMessage(), $e->getCode());
|
|
|
}
|