From 8e492ee5aefa5294beec02f3b6e474678ce7e084 Mon Sep 17 00:00:00 2001 From: MoYi <1545929126@qq.com> Date: Mon, 20 Nov 2023 18:09:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=96=87=E4=BB=B6API?= =?UTF-8?q?=E6=8C=82=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/Requester.ts | 19 ++- src/entities/File.ts | 10 ++ src/style.css | 3 - src/views/AppMobile.vue | 254 +++++++++++----------------------------- 4 files changed, 87 insertions(+), 199 deletions(-) create mode 100644 src/entities/File.ts diff --git a/src/api/Requester.ts b/src/api/Requester.ts index e33fce5..91cc23f 100644 --- a/src/api/Requester.ts +++ b/src/api/Requester.ts @@ -1,10 +1,10 @@ import axios from 'axios' import {md5Hex} from "./CryptoUtils"; -import {User} from "../entities/User.ts"; -import {Auth} from "../entities/Auth.ts"; -import {UnwrapRef} from "vue"; +import {User} from "../entities/User"; +import {Auth} from "../entities/Auth"; +import {File} from "../entities/File"; -export const baseUrl = 'https://localhost:8081'; +export const baseUrl = 'http://localhost:8081'; export interface Result { data: T; @@ -14,15 +14,10 @@ export interface Result { } export interface Page { - data: T[]; + data: Array; total: number; } -export interface File { - page: number; - num: number; -} - export type PageResult = Result> const instance = axios.create({ baseURL: baseUrl, @@ -62,6 +57,6 @@ export const register = (username: string, password: string, auth: Auth, verifyC }) } -export const getAllFiles = (page: UnwrapRef, num: UnwrapRef) => { - return instance.get>(`/api/file/getAll?page=${page}&num=${num}`); +export const getAllFiles = (page: number, num: number) => { + return instance.get>("/api/file/getAll", {params: {num, page}}); } \ No newline at end of file diff --git a/src/entities/File.ts b/src/entities/File.ts new file mode 100644 index 0000000..8db8964 --- /dev/null +++ b/src/entities/File.ts @@ -0,0 +1,10 @@ +export interface File { + downloadCount: number; + hash: string; + id: number; + name: string; + size: number; + type: string; + uploadTime: string; + uploaderName: string; +} \ No newline at end of file diff --git a/src/style.css b/src/style.css index 6e1b86e..e69de29 100644 --- a/src/style.css +++ b/src/style.css @@ -1,3 +0,0 @@ -:root { - background-color: #242424; -} \ No newline at end of file diff --git a/src/views/AppMobile.vue b/src/views/AppMobile.vue index 93b5f9f..d425bd8 100644 --- a/src/views/AppMobile.vue +++ b/src/views/AppMobile.vue @@ -1,11 +1,11 @@