perf: 去除console,

This commit is contained in:
archer
2023-03-05 23:08:23 +08:00
parent 52a752dab5
commit bf81d23de4
14 changed files with 21 additions and 48 deletions

View File

@@ -39,7 +39,7 @@ const Auth = ({ children }: { children: JSX.Element }) => {
}
},
onError(error) {
console.log(error);
console.error(error);
router.push('/login');
toast();
},

View File

@@ -107,7 +107,6 @@
font-size: 28px;
}
.markdown h2 {
border-bottom: 1px solid #cccccc;
color: #000000;
font-size: 24px;
}

View File

@@ -1,4 +1,4 @@
import React, { memo } from 'react';
import React, { memo, useMemo } from 'react';
import ReactMarkdown from 'react-markdown';
import remarkGfm from 'remark-gfm';
import styles from './index.module.scss';
@@ -9,9 +9,9 @@ import { useCopyData } from '@/utils/tools';
import Icon from '@/components/Icon';
const Markdown = ({ source, isChatting }: { source: string; isChatting: boolean }) => {
// const formatSource = useMemo(() => source.replace(/\n/g, '\n'), [source]);
const formatSource = useMemo(() => source.replace(/\n/g, ' \n'), [source]);
const { copyData } = useCopyData();
// console.log(source);
return (
<ReactMarkdown
className={`${styles.markdown} ${
@@ -56,7 +56,7 @@ const Markdown = ({ source, isChatting }: { source: string; isChatting: boolean
}
}}
>
{source}
{formatSource}
</ReactMarkdown>
);
};