This commit is contained in:
2026-01-26 10:04:47 +08:00
parent 4c9393ed25
commit 83d2e9ff8d

View File

@@ -17,7 +17,7 @@ class Wechat extends Controller
* @param string $code 微信回调带来的code * @param string $code 微信回调带来的code
* @return string|bool 成功返回openid失败返回false * @return string|bool 成功返回openid失败返回false
*/ */
private function exchangeCodeForOpenId() private function exchangeOpenId()
{ {
$code = input('code', 0); $code = input('code', 0);
@@ -74,7 +74,7 @@ class Wechat extends Controller
{ {
$user_code = input('user_code', 0); $user_code = input('user_code', 0);
$user_info = db::name('user') $user_info = db::name('user')
->field('id user_id,nickname,avatar,mobile') ->field('id user_id,nickname,avatar,mobile,user_code')
->where(['user_code' => $user_code,'status' => ['<>',0]])->find(); ->where(['user_code' => $user_code,'status' => ['<>',0]])->find();
if(!$user_info){ if(!$user_info){
return ['code' => 0, 'msg' => '用户不存在或已注销', 'data' => null]; return ['code' => 0, 'msg' => '用户不存在或已注销', 'data' => null];