Initial commit for open-source version

This commit is contained in:
jiangrui
2024-12-17 11:30:59 +08:00
commit 42c07ed34c
57 changed files with 10559 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import request from "@/utils/request";
import type { ShareInfoResponse, Folder, Save115FileParams } from "@/types";
export const cloud115Api = {
async getShareInfo(shareCode: string, receiveCode = ""): Promise<ShareInfoResponse> {
const { data } = await request.get("/api/cloud115/share-info", {
params: { shareCode, receiveCode },
});
return data;
},
async getFolderList(parentCid = "0"): Promise<{ data: Folder[] }> {
const { data } = await request.get("/api/cloud115/folders", {
params: { parentCid },
});
return data;
},
async saveFile(params: Save115FileParams) {
const { data } = await request.post("/api/cloud115/save", params);
return data;
},
};

23
frontend/src/api/quark.ts Normal file
View File

@@ -0,0 +1,23 @@
import request from "@/utils/request";
import type { ShareInfoResponse, Folder, SaveQuarkFileParams } from "@/types";
export const quarkApi = {
async getShareInfo(pwdId: string, passcode = ""): Promise<ShareInfoResponse> {
const { data } = await request.get("/api/quark/share-info", {
params: { pwdId, passcode },
});
return data;
},
async getFolderList(parentCid = "0"): Promise<{ data: Folder[] }> {
const { data } = await request.get("/api/quark/folders", {
params: { parentCid },
});
return data;
},
async saveFile(params: SaveQuarkFileParams) {
const { data } = await request.post("/api/quark/save", params);
return data;
},
};

View File

@@ -0,0 +1,10 @@
import request from "@/utils/request";
import type { Resource } from "@/types/index";
export const resourceApi = {
search(keyword: string, backupPlan: boolean, channelId?: string, lastMessageId?: string) {
return request.get<Resource[]>(`/api/${backupPlan ? "rssSearch" : "search"}`, {
params: { keyword, channelId, lastMessageId },
});
},
};