1.提交缺失的东西

This commit is contained in:
2025-05-14 17:37:56 +08:00
parent 2278b261b8
commit 09353673c6
2 changed files with 10 additions and 5 deletions

View File

@ -253,7 +253,12 @@ class AccountController extends BaseApiController
return $this->fail('参数缺失'); return $this->fail('参数缺失');
} }
$data = LoginLogic::authLogin($post); $data = LoginLogic::authLogin($post);
return $this->success("登录成功",$data); if($data){
return $this->success("登录成功",$data);
}else{
return $this->fail("登录失败");
}
} }
/** /**

View File

@ -664,9 +664,9 @@ class LoginLogic extends LogicBase
$user_id = self::getUserByWechatResponse($response); $user_id = self::getUserByWechatResponse($response);
} catch (Exception $e) { } catch (Exception $e) {
return self::dataError('登录失败:' . $e->getMessage()); return false;
} catch (\think\Exception $e) { } catch (\think\Exception $e) {
return self::dataError('登录失败:' . $e->getMessage()); return false;
} }
if (empty($user_id)) { if (empty($user_id)) {
@ -678,14 +678,14 @@ class LoginLogic extends LogicBase
//验证用户信息 //验证用户信息
$check_res = self::checkUserInfo($user_info); $check_res = self::checkUserInfo($user_info);
if (true !== $check_res) { if (true !== $check_res) {
return self::dataError($check_res); return false;
} }
//创建会话 //创建会话
$user_info['token'] = self::createSession($user_info['id'], Client_::mnp); $user_info['token'] = self::createSession($user_info['id'], Client_::mnp);
unset($user_info['id'], $user_info['disable']); unset($user_info['id'], $user_info['disable']);
return self::dataSuccess('登录成功', $user_info); return $user_info;
} }
/** /**