| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- 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<string, any>
- ): Promise<PluginList> {
- 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<DataRes> {
- const res = await instance.post('/api/Plugin/DeletePlugin', params);
- return res.data;
- }
- export async function getPluginDetails(params: object): Promise<DataRes> {
- const res = await instance.post('/api/Plugin/PluginDetail', params);
- return res.data;
- }
- export async function savePluginDetails(
- params: Record<string, any>
- ): Promise<DataRes> {
- 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<ExportUrl> {
- const res = await instance.post('/api/Author/Export', params);
- return res.data;
- }
|