hookehuyr

fix(authRedirect): 修复检查用户是否有家庭时的数据判断逻辑

修复当data对象存在但families字段不存在时的判断错误,使用可选链操作符确保安全访问
/*
* @Date: 2025-01-25 10:00:00
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-09-13 09:07:59
* @LastEditTime: 2025-09-23 14:33:30
* @FilePath: /lls_program/src/utils/authRedirect.js
* @Description: 授权重定向处理工具函数
*/
......@@ -69,7 +69,7 @@ export const navigateToAuth = (returnPath) => {
export const checkUserHasFamily = async () => {
try {
const { code, data } = await getMyFamiliesAPI()
if (code && data && data.length > 0) {
if (code && data && data?.families?.length > 0) {
return true
}
return false
......