From 62429a13b2a8d00df7c556a4a76fbdfb8b905596 Mon Sep 17 00:00:00 2001
From: ZZY <2450266535@qq.com>
Date: Sun, 25 Aug 2024 11:10:22 +0800
Subject: [PATCH] =?UTF-8?q?refactor(src):=20=E9=87=8D=E6=9E=84=E5=8D=A1?=
=?UTF-8?q?=E7=89=87=E5=92=8C=E7=AC=94=E8=AE=B0=E7=9A=84=E8=B7=AF=E7=94=B1?=
=?UTF-8?q?=E5=8F=8A=E9=A1=B5=E9=9D=A2=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 移除`config.json`中的文件API配置
- 将卡片和笔记的路由及组件整合至`index.ts`和对应的页面组件中
- 删除不再使用的`CardShower`组件
- 更新`NoteShower`组件以使用新的路由配置
- 重构`Home.vue`,移除编辑功能并使用新的卡片显示逻辑
BREAKING CHANGE: 卡片和笔记的API端点及相关配置已从`config.json`中移除。
---
src/assets/vue_config.json | 3 +
src/components/cards/Card.ts | 3 -
src/components/cards/Card.vue | 4 +-
src/pages/{CardShower.vue => CardsShower.vue} | 23 +++----
src/pages/Home.vue | 65 ++-----------------
src/pages/NoteShower.vue | 2 +-
src/router/card.ts | 31 +++++++++
src/{config => router}/config.json | 0
src/router/index.ts | 21 +++---
9 files changed, 58 insertions(+), 94 deletions(-)
create mode 100644 src/assets/vue_config.json
rename src/pages/{CardShower.vue => CardsShower.vue} (80%)
create mode 100644 src/router/card.ts
rename src/{config => router}/config.json (100%)
diff --git a/src/assets/vue_config.json b/src/assets/vue_config.json
new file mode 100644
index 0000000..544b7b4
--- /dev/null
+++ b/src/assets/vue_config.json
@@ -0,0 +1,3 @@
+{
+
+}
\ No newline at end of file
diff --git a/src/components/cards/Card.ts b/src/components/cards/Card.ts
index b2b931f..f60e9a5 100644
--- a/src/components/cards/Card.ts
+++ b/src/components/cards/Card.ts
@@ -21,17 +21,14 @@ export type cardType = {
};
export function getDatas(url: string, cards: cardType[]) {
- console.log(url);
FetchWrapper.fetch(url, { timeout: 3000 })
.then(response => {
if (!response.ok) {
// throw new Error(`HTTP error! status: ${response.status}`);
return null;
}
- console.log(response);
return response.json();
}).then(jsonData => {
- console.log('JSON Data:', jsonData);
if (!jsonData) {
return null;
}
diff --git a/src/components/cards/Card.vue b/src/components/cards/Card.vue
index 32623c0..47b87ab 100644
--- a/src/components/cards/Card.vue
+++ b/src/components/cards/Card.vue
@@ -27,9 +27,9 @@ let { card, idx } = defineProps<{
idx: number
}>()
-function getRealHref(href: string) {
+function getRealHref(href: string, user_name: string = "$") {
if (href.startsWith('$')) {
- return `/card/_${href.substring(1)}`;
+ href = `/card/${user_name}${href.substring(1)}`;
}
return href;
}
diff --git a/src/pages/CardShower.vue b/src/pages/CardsShower.vue
similarity index 80%
rename from src/pages/CardShower.vue
rename to src/pages/CardsShower.vue
index 5e7e679..229d5f2 100644
--- a/src/pages/CardShower.vue
+++ b/src/pages/CardsShower.vue
@@ -1,12 +1,12 @@
-
+
TOKEN is
-
+