feat: 日志优化
This commit is contained in:
@@ -279,7 +279,11 @@ export default function AuthFormContent() {
|
||||
// ⚡ Mock 模式:先在前端侧写入 localStorage,确保时序正确
|
||||
if (process.env.REACT_APP_ENABLE_MOCK === 'true' && data.user) {
|
||||
setCurrentUser(data.user);
|
||||
console.log('[Auth] 前端侧设置当前用户(Mock模式):', data.user);
|
||||
logger.debug('AuthFormContent', '前端侧设置当前用户(Mock模式)', {
|
||||
userId: data.user?.id,
|
||||
phone: data.user?.phone,
|
||||
mockMode: true
|
||||
});
|
||||
}
|
||||
|
||||
// 更新session
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React from "react";
|
||||
import { FormControl, FormErrorMessage, HStack, Input, Button, Spinner } from "@chakra-ui/react";
|
||||
import { logger } from "../../utils/logger";
|
||||
|
||||
/**
|
||||
* 通用验证码输入组件
|
||||
@@ -26,7 +27,12 @@ export default function VerificationCodeInput({
|
||||
}
|
||||
} catch (error) {
|
||||
// 错误已经在父组件处理,这里只需要防止未捕获的 Promise rejection
|
||||
console.error('Send code error (caught in VerificationCodeInput):', error);
|
||||
logger.error('VerificationCodeInput', 'handleSendCode', error, {
|
||||
hasOnSendCode: !!onSendCode,
|
||||
countdown,
|
||||
isLoading,
|
||||
isSending
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import { Typography, Space, Tag } from 'antd';
|
||||
import { RobotOutlined, FileSearchOutlined } from '@ant-design/icons';
|
||||
import CitationMark from './CitationMark';
|
||||
import { processCitationData } from '../../utils/citationUtils';
|
||||
import { logger } from '../../utils/logger';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
@@ -37,7 +38,10 @@ const CitedContent = ({
|
||||
|
||||
// 如果数据无效,不渲染
|
||||
if (!processed) {
|
||||
console.warn('CitedContent: Invalid data, not rendering');
|
||||
logger.warn('CitedContent', '无效数据,不渲染', {
|
||||
hasData: !!data,
|
||||
title
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user