import axios from 'axios'; import type { TableData } from '@arco-design/web-vue/es/table/interface'; import instance from './interceptor'; export interface DataRes { success: boolean; message: string; code: string; data: DataList; } export interface DataList { id?: number; userId?: number | null; server?: string; user?: string; password?: string; location: string; hostName: string; } export interface ExportUrl { success: boolean; message: string; code: string; data: string; } export interface PluginList { success: boolean; message: string; code: string; data: DataList[]; totalCount: number; totalPage: number; } export interface PluginParams { pageIndex: number; pageSize: number; hostName: string | null; address: string | null; server: string | null; location: string | null; } export async function queryPluginList( params: Record ): Promise { const formData = new URLSearchParams(); Object.keys(params).forEach(key => { formData.append(key, params[key]); }); const res = await instance.post('/api/Plugin/PluginList', formData, { headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, }); return res.data; } export async function deletePluginDetails(params: object): Promise { const res = await instance.post('/api/Plugin/DeletePlugin', params); return res.data; } export async function getPluginDetails(params: object): Promise { const res = await instance.post('/api/Plugin/PluginDetail', params); return res.data; } export async function savePluginDetails( params: Record ): Promise { const formData = new URLSearchParams(); Object.keys(params).forEach(key => { formData.append(key, params[key]); }); const res = await instance.post('/api/Plugin/SavePlugin', formData, { headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, }); return res.data; } export async function exportPluginList(params: object): Promise { const res = await instance.post('/api/Author/Export', params); return res.data; }