mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 10:12:51 +00:00
28 lines
723 B
TypeScript
28 lines
723 B
TypeScript
import { Result } from '@/request/Result'
|
|
import { get, post, del, put } from '@/request/index'
|
|
import { type Ref } from 'vue'
|
|
|
|
const prefix = '/platform'
|
|
const getPlatformInfo: (loading?: Ref<boolean>) => Promise<Result<any>> = (loading) => {
|
|
return get(`${prefix}/source`, undefined, loading)
|
|
}
|
|
|
|
const updateConfig: (data: any, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
|
data,
|
|
loading
|
|
) => {
|
|
return post(`${prefix}/source`, data, undefined, loading)
|
|
}
|
|
|
|
const validateConnection: (data: any, loading?: Ref<boolean>) => Promise<Result<any>> = (
|
|
data,
|
|
loading
|
|
) => {
|
|
return put(`${prefix}/source`, data, undefined, loading)
|
|
}
|
|
export default {
|
|
getPlatformInfo,
|
|
updateConfig,
|
|
validateConnection
|
|
}
|