From abbc35e9e72f1bcd2904a383cdf6ab3232cb2173 Mon Sep 17 00:00:00 2001 From: MoYi <1545929126@qq.com> Date: Mon, 20 Nov 2023 15:47:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96=E6=89=80?= =?UTF-8?q?=E6=9C=89=E6=96=87=E4=BB=B6API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/Requester.ts | 12 ++++- src/views/AppMobile.vue | 113 +++++++++++++++++++++++++++------------- 2 files changed, 88 insertions(+), 37 deletions(-) diff --git a/src/api/Requester.ts b/src/api/Requester.ts index 2cbfc96..e33fce5 100644 --- a/src/api/Requester.ts +++ b/src/api/Requester.ts @@ -2,8 +2,9 @@ import axios from 'axios' import {md5Hex} from "./CryptoUtils"; import {User} from "../entities/User.ts"; import {Auth} from "../entities/Auth.ts"; +import {UnwrapRef} from "vue"; -export const baseUrl = 'http://localhost:8081'; +export const baseUrl = 'https://localhost:8081'; export interface Result { data: T; @@ -17,6 +18,11 @@ export interface Page { total: number; } +export interface File { + page: number; + num: number; +} + export type PageResult = Result> const instance = axios.create({ baseURL: baseUrl, @@ -54,4 +60,8 @@ export const register = (username: string, password: string, auth: Auth, verifyC auth: auth, verifyCode: verifyCode, }) +} + +export const getAllFiles = (page: UnwrapRef, num: UnwrapRef) => { + return instance.get>(`/api/file/getAll?page=${page}&num=${num}`); } \ No newline at end of file diff --git a/src/views/AppMobile.vue b/src/views/AppMobile.vue index 26743c7..93b5f9f 100644 --- a/src/views/AppMobile.vue +++ b/src/views/AppMobile.vue @@ -30,6 +30,7 @@
- + @@ -55,34 +56,39 @@ - +
+ + + +
\ No newline at end of file