diff --git a/.env.production b/.env.production
index 8e694b2..e69de29 100644
--- a/.env.production
+++ b/.env.production
@@ -1,9 +0,0 @@
-# Update these with your Supabase details from your project settings > API
-# https://app.supabase.com/project/_/settings/api
-NEXT_PUBLIC_SUPABASE_URL=https://yidfukfbrluizjvfrrsj.supabase.co
-NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InlpZGZ1a2Zicmx1aXpqdmZycnNqIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MDQ4NjMyNjEsImV4cCI6MjAyMDQzOTI2MX0.EXIXAdNIGLFo5wHmwmY2-9bqLO9vyFYDvMMtCtkxgig
-NEXT_PUBLIC_TINYMCE_API_KEY=e983nu390inks6be1wwlsrdxjebot3yc4pld7d44zs6vcrxr
-NEXT_PUBLIC_OPENAI_API_KEY=sess-1CQMw0TDL0VZd9C1W3aGAZ6scffG32JJPcap7Re4
-NEXT_PUBLIC_SEMANTIC_API_KEY=hEQvK6ARe84dzDPcMnpzX4n9jfoqztkMfaftPWnb
-NEXT_PUBLIC_AI_URL=https://chatgpt-api-proxy-private.14790897abc.workers.dev/v1/chat/completions
-#"https://api.openai.com/v1/chat/completions"
\ No newline at end of file
diff --git a/components/QuillEditor.tsx b/components/QuillEditor.tsx
index eef4893..dd5e8f4 100644
--- a/components/QuillEditor.tsx
+++ b/components/QuillEditor.tsx
@@ -148,7 +148,7 @@ const QEditor = () => {
const newReferences = rawData.map((entry) => ({
url: entry.url,
title: entry.title,
- year: entry.published,
+ year: entry.year,
author: entry.authors?.slice(0, 3).join(", "),
venue: entry.venue,
journal: entry.journal,
@@ -174,15 +174,15 @@ const QEditor = () => {
}
// 插入论文信息
- const insertPapers = async (topic: string) => {
- const rawData = await getArxivPapers(topic);
- const dataString = rawData
- .map((entry) => {
- return `ID: ${entry.id}\nPublished: ${entry.published}\nTitle: ${entry.title}\nSummary: ${entry.summary}\n\n`;
- })
- .join("");
- quill.insertText(quill.getLength(), dataString);
- };
+ // const insertPapers = async (topic: string) => {
+ // const rawData = await getArxivPapers(topic);
+ // const dataString = rawData
+ // .map((entry) => {
+ // return `ID: ${entry.id}\nPublished: ${entry.published}\nTitle: ${entry.title}\nSummary: ${entry.summary}\n\n`;
+ // })
+ // .join("");
+ // quill.insertText(quill.getLength(), dataString);
+ // };
return (
@@ -199,12 +199,12 @@ const QEditor = () => {
>
Insert AI Text
*/}
-
+ */}
diff --git a/components/ReferenceList.tsx b/components/ReferenceList.tsx
index 6f4719c..117dc25 100644
--- a/components/ReferenceList.tsx
+++ b/components/ReferenceList.tsx
@@ -4,17 +4,20 @@ import { Reference } from "@/utils/global";
import {
copyToClipboard,
formatReferenceForCopy,
+ formatAllReferencesForCopy,
} from "@/utils/others/quillutils";
type ReferenceListProps = {
references: Reference[];
addReference: (reference: Reference) => void;
removeReference: (index: number) => void;
+ setReferences
};
function ReferenceList({
references,
addReference,
removeReference,
+ setReferences
}: ReferenceListProps) {
const [newTitle, setNewTitle] = useState("");
const [newAuthor, setNewAuthor] = useState("");
@@ -80,14 +83,32 @@ function ReferenceList({
placeholder="URL"
/>
-
-
+
+
+
+
+
+
+
+
{/* 引用列表显示区域 */}
{references.map((reference, index) => (
@@ -98,7 +119,7 @@ function ReferenceList({
{/* 判断 journal 字段是否存在 */}
{reference.journal && reference.journal.name ? (
- {reference.journal.name},{reference.year},
+ {reference.journal.name}[J],{reference.year},
{reference.journal.volume ? ` ${reference.journal.volume}` : ""}
{reference.journal.pages ? `: ${reference.journal.pages}` : ""}.
diff --git a/utils/others/quillutils.ts b/utils/others/quillutils.ts
index 83ccef1..ff81518 100644
--- a/utils/others/quillutils.ts
+++ b/utils/others/quillutils.ts
@@ -57,28 +57,36 @@ function getRandomOffset(max: number) {
function removeSpecialCharacters(str: string): string {
// 正则表达式匹配除了字母、空格和中文之外的所有字符
const regex = /[^\u4e00-\u9fa5a-zA-Z ]/g;
- return str.replace(regex, '');
+ return str.replace(regex, "");
}
function copyToClipboard(text: string) {
navigator.clipboard.writeText(text).then(
- () => console.log('文献引用复制到剪贴板'),
- (err) => console.error('复制到剪贴板失败:', err)
+ () => console.log("文献引用复制到剪贴板"),
+ (err) => console.error("复制到剪贴板失败:", err)
);
}
function formatReferenceForCopy(reference: Reference): string {
let referenceStr = `${reference.author}. ${reference.title}. `;
if (reference.journal && reference.journal.name) {
- referenceStr += `${reference.journal.name}, ${reference.year}, `;
+ referenceStr += `${reference.journal.name}[J], ${reference.year}, `;
if (reference.journal.volume) referenceStr += `${reference.journal.volume}`;
if (reference.journal.pages) referenceStr += `: ${reference.journal.pages}`;
- referenceStr += '.';
+ referenceStr += ".";
} else {
referenceStr += `${reference.venue}, ${reference.year}.`;
}
return referenceStr;
}
+function formatAllReferencesForCopy(references: Reference[]): string {
+ return references
+ .map(
+ (reference, index) =>
+ `[${index + 1}] ${formatReferenceForCopy(reference)}`
+ )
+ .join("\n");
+}
export {
getTextBeforeCursor,
@@ -89,4 +97,5 @@ export {
removeSpecialCharacters,
copyToClipboard,
formatReferenceForCopy,
+ formatAllReferencesForCopy,
};