From 15952919a4646ae3d849aa18887fbe043d98ff7a Mon Sep 17 00:00:00 2001
From: feige996 <1020102647@qq.com>
Date: Tue, 3 Jun 2025 19:55:29 +0800
Subject: [PATCH] =?UTF-8?q?refactor(about):=20=E5=9C=A8request=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=E4=B8=AD=E5=BC=95=E5=85=A5useRequest=E5=92=8Cref?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
重构about页面的request组件,添加了useRequest hook和vue的ref引用,为后续功能扩展做准备
---
src/pages/about/components/request.vue | 75 +++-----------------------
1 file changed, 8 insertions(+), 67 deletions(-)
diff --git a/src/pages/about/components/request.vue b/src/pages/about/components/request.vue
index 5e0dfc5..b2e599b 100644
--- a/src/pages/about/components/request.vue
+++ b/src/pages/about/components/request.vue
@@ -1,67 +1,8 @@
-
-{
- layout: 'demo',
- style: {
- navigationBarTitleText: '请求',
- },
-}
-
-
-
-
- 使用的是 laf 云后台
- 我的推荐码,可以获得佣金
-
-
-
- {{ recommendUrl }}
-
-
-
-
- {{ recommendUrl }}
-
-
-
- 发送请求
-
- loading...
-
- 请求数据如下
- {{ JSON.stringify(data) }}
-
-
- 重置数据
-
-
-
-
+import useRequest from '@/hooks/useRequest' import { getFooAPI, postFooAPI, IFooItem } from
+'@/service/index/foo' import { ref } from 'vue' // import { findPetsByStatusQueryOptions } from
+'@/service/app' // import { useQuery } from '@tanstack/vue-query' const recommendUrl =
+ref('http://laf.run/signup?code=ohaOgIX') // const initialData = { // name: 'initialData', // id:
+'1234', // } const initialData = undefined //
+适合少部分全局性的接口————多个页面都需要的请求接口,额外编写一个 Service 层 const { loading, error,
+data, run } = useRequest
+