- 用户主界面
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.title }}
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/main/account.vue b/pages/user/main/account.vue
new file mode 100644
index 0000000..a5323ae
--- /dev/null
+++ b/pages/user/main/account.vue
@@ -0,0 +1,22 @@
+
+
+ 登出
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/main/index.vue b/pages/user/main/index.vue
new file mode 100644
index 0000000..6103605
--- /dev/null
+++ b/pages/user/main/index.vue
@@ -0,0 +1,13 @@
+
+
+ index
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/main/post.vue b/pages/user/main/post.vue
new file mode 100644
index 0000000..1e324ec
--- /dev/null
+++ b/pages/user/main/post.vue
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/main/post/edit-[id].vue b/pages/user/main/post/edit-[id].vue
new file mode 100644
index 0000000..59d37ff
--- /dev/null
+++ b/pages/user/main/post/edit-[id].vue
@@ -0,0 +1,15 @@
+
+
+ edit: id-{{ route.params.id }}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/main/post/index.vue b/pages/user/main/post/index.vue
new file mode 100644
index 0000000..52d61e6
--- /dev/null
+++ b/pages/user/main/post/index.vue
@@ -0,0 +1,149 @@
+
+
+
+ 文章列表
+
+
+
+ 上传文章
+
+
+
+
+
+ {{ post.summary }}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/user/test.vue b/pages/user/main/test.vue
similarity index 100%
rename from pages/user/test.vue
rename to pages/user/main/test.vue
diff --git a/style/default.scss b/style/default.scss
index 6032bee..55a35cd 100644
--- a/style/default.scss
+++ b/style/default.scss
@@ -1,6 +1,7 @@
body,html {
padding: 0;
- margin: 0
+ margin: 0;
+ -webkit-tap-highlight-color: transparent;
}
body {
@@ -10,4 +11,8 @@ body {
font-size: 16px;
color: #2c3e50;
background-color: #fff
+}
+
+:focus-visible {
+ outline: #15aa8761 auto 1px;
}
\ No newline at end of file
diff --git a/utils/getPost.ts b/utils/getPost.ts
new file mode 100644
index 0000000..42f04da
--- /dev/null
+++ b/utils/getPost.ts
@@ -0,0 +1,33 @@
+import useDefaultStore from "~/hooks/pinia/useDefaultStore"
+import usePostStore from "~/hooks/pinia/usePostStore"
+import useMiaoFetch from "~/hooks/useMiaoFetch"
+// import usePostStore from "~/hooks/pinia/usePostStore"
+import type { postContent, postItem } from "~/types/post"
+
+export default async function getPostList() {
+ const store = useDefaultStore()
+ const cache = store.getCache('posts')
+ if (cache) {
+ return cache as postItem[]
+ }
+ const response = await $fetch('/api/posts/getPostList')
+ const res = response.data
+ store.setCache('posts', res)
+ return res
+}
+
+export async function getPostData(id: number | string) {
+ const postStore = usePostStore()
+ const cache = postStore.getPostCache(`${id}`)
+ if (cache) {
+ return cache
+ }
+ const res = await $fetch('/api/posts/getPostContent', {
+ method: 'POST',
+ body: {
+ id
+ }
+ }) as postContent
+ postStore.setPostCache(`${id}`, res)
+ return res
+}
\ No newline at end of file