From e29cfe99dcd34f376308f4a3842bff51151b3e3d Mon Sep 17 00:00:00 2001 From: Burt <1020103647@qq.com> Date: Sat, 23 Dec 2023 11:47:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AF=B7=E6=B1=82=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/index/index.vue | 7 ++++--- src/typings.d.ts | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 4c224d1..bec1d32 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -7,7 +7,7 @@ - + Demo Count: {{ countStore.count }} @@ -28,6 +28,7 @@ import { ref } from 'vue' import { useCountStore, useUserStore } from '@/store' import { http } from '@/utils/http' +import { UserItem } from '@/typings' const countStore = useCountStore() const title = ref('Hello') @@ -43,8 +44,8 @@ const setUserInfo = () => { const clearUserInfo = () => { userStore.clearUserInfo() } -const request = () => { - const res = http({ +const handleRequest = () => { + const res = http({ url: '/getUserList', method: 'GET', }) diff --git a/src/typings.d.ts b/src/typings.d.ts index c8b35b5..ad584c7 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -2,3 +2,7 @@ export type UserInfo = { username: string token: string } +export type UserItem = { + username: string + age: number +}