diff --git a/src/pages/chatgpt/index.jsx b/src/pages/chatgpt/index.jsx index a991648b..0dd4ae61 100644 --- a/src/pages/chatgpt/index.jsx +++ b/src/pages/chatgpt/index.jsx @@ -47,7 +47,7 @@ const ChatGpt = () => { if (e.data !== '[DONE]') { const payload = JSON.parse(e.data) const { - delta: { content }, + delta: { content } } = payload.choices[0] if (content) { apiResultRef.current += content @@ -118,7 +118,7 @@ const ChatGpt = () => { if (e.data !== '[DONE]') { const payload = JSON.parse(e.data) const { - delta: { content }, + delta: { content } } = payload.choices[0] if (content) { structureResultRef.current += content @@ -144,35 +144,35 @@ const ChatGpt = () => {
- + - + - @@ -190,11 +190,11 @@ const ChatGpt = () => { items: [ { key: '1', - label: '复制Markdown', - }, - ], + label: '复制Markdown' + } + ] }} - placement="bottom" + placement='bottom' arrow > @@ -229,18 +229,18 @@ const ChatGpt = () => { items: [ { key: '1', - label: '导出png格式', + label: '导出png格式' }, { key: '2', - label: '导出svg格式', - }, - ], + label: '导出svg格式' + } + ] }} - placement="bottom" + placement='bottom' arrow > - diff --git a/src/pages/chatgpt/sse.js b/src/pages/chatgpt/sse.js index c1e16c41..f3f57408 100644 --- a/src/pages/chatgpt/sse.js +++ b/src/pages/chatgpt/sse.js @@ -1,10 +1,10 @@ import { SSE } from 'sse' const initSSE = (apiKey, apiContent) => { - const source = new SSE(`https://api.openai.com/v1/chat/completions`, { + const source = new SSE('https://api.openai.com/v1/chat/completions', { headers: { 'Content-Type': 'application/json', - Authorization: `Bearer ${apiKey}`, + Authorization: `Bearer ${apiKey}` }, method: 'POST', payload: JSON.stringify({ @@ -13,10 +13,10 @@ const initSSE = (apiKey, apiContent) => { messages: [ { role: 'assistant', - content: apiContent, - }, - ], - }), + content: apiContent + } + ] + }) }) return source } diff --git a/src/pages/three/index.jsx b/src/pages/three/index.jsx index 4638a398..3a499af8 100644 --- a/src/pages/three/index.jsx +++ b/src/pages/three/index.jsx @@ -5,7 +5,7 @@ import * as random from 'maath/random/dist/maath-random.esm' import styles from './index.module.less' -export default function ReactThree() { +export default function ReactThree () { return (

React Three Fiber

@@ -16,7 +16,7 @@ export default function ReactThree() { ) } -function Stars(props) { +function Stars (props) { const ref = useRef() const [sphere] = useState(() => random.inSphere(new Float32Array(5000), { radius: 1.5 })) useFrame((state, delta) => { @@ -26,7 +26,7 @@ function Stars(props) { return ( - + )