From 6f67273a9a12bb2568a3b9e551b5de666d06a83c Mon Sep 17 00:00:00 2001
From: xingyy <64720302+Concur-max@users.noreply.github.com>
Date: Fri, 17 Jan 2025 16:56:13 +0800
Subject: [PATCH] =?UTF-8?q?refactor(store):=20=E9=87=8D=E6=9E=84=20home=20?=
=?UTF-8?q?store=20=E5=B9=B6=E6=94=B9=E5=90=8D=E4=B8=BA=20goods=20store?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 将 home store 重命名为 goods store,以更准确地反映其用途
- 更新了相关文件中的导入路径和引用
-调整了首页布局和组件以适应新的 goods store 结构
- 新增了 goods store 中的 actionDetails 和 itemList 属性
---
app/api/goods/index.js | 16 ++++++++++++++++
app/api/http.js | 6 +++---
app/components/AppHeader.vue | 4 ++--
app/layouts/README.md | 2 +-
app/layouts/default.vue | 2 +-
app/pages/home/components/Cescribe/index.vue | 15 +++++++++++++++
app/pages/home/components/Column/index.vue | 8 ++++++--
app/pages/home/components/index.vue | 2 +-
app/pages/home/index.vue | 15 +++++++--------
app/stores/{home => goods}/index.js | 7 +++++--
10 files changed, 57 insertions(+), 20 deletions(-)
create mode 100644 app/api/goods/index.js
create mode 100644 app/pages/home/components/Cescribe/index.vue
rename app/stores/{home => goods}/index.js (95%)
diff --git a/app/api/goods/index.js b/app/api/goods/index.js
new file mode 100644
index 0000000..7f9adea
--- /dev/null
+++ b/app/api/goods/index.js
@@ -0,0 +1,16 @@
+import { getHttp } from '~/api/http.js'
+
+export async function artworkList(data) {
+ const http = getHttp()
+ return await http('/api/v1/m/auction/default/artwork/list', {
+ method: 'POST',
+ body: data,
+ })
+}
+export async function defaultDetail(data) {
+ const http = getHttp()
+ return await http('/api/v1/m/auction/default/detail', {
+ method: 'POST',
+ body: data,
+ })
+}
\ No newline at end of file
diff --git a/app/api/http.js b/app/api/http.js
index db74379..85ca5bd 100644
--- a/app/api/http.js
+++ b/app/api/http.js
@@ -2,6 +2,7 @@
import { useRuntimeConfig } from '#app'
import { ofetch } from 'ofetch'
import {message} from '@/components/x-message/useMessage.js'
+import {authStore} from "@/stores/auth/index.js";
let httpStatusErrorHandler
let http
@@ -12,15 +13,14 @@ export function setupHttp() {
const config = useRuntimeConfig()
const baseURL = config.public.NUXT_PUBLIC_API_BASE
-
+ const {token}= authStore()
http = ofetch.create({
baseURL,
headers: { 'Content-Type': 'application/json' },
async onRequest({ options }) {
- const token = localStorage.getItem('token')
options.headers = {
...options.headers,
- ...(token && { Authorization: token }),
+ Authorization:token.value
}
},
async onResponse({ response }) {
diff --git a/app/components/AppHeader.vue b/app/components/AppHeader.vue
index 9a047ac..4c058c7 100644
--- a/app/components/AppHeader.vue
+++ b/app/components/AppHeader.vue
@@ -1,6 +1,6 @@
```
diff --git a/app/layouts/default.vue b/app/layouts/default.vue
index c20d956..c29e7ce 100644
--- a/app/layouts/default.vue
+++ b/app/layouts/default.vue
@@ -8,6 +8,6 @@
\ No newline at end of file
diff --git a/app/pages/home/components/Cescribe/index.vue b/app/pages/home/components/Cescribe/index.vue
new file mode 100644
index 0000000..20594f0
--- /dev/null
+++ b/app/pages/home/components/Cescribe/index.vue
@@ -0,0 +1,15 @@
+
+
+
+