UnisKB/ui/src/api/application/application-xpack.ts

42 lines
968 B
TypeScript
Raw Normal View History

2025-06-03 09:29:33 +00:00
import { Result } from '@/request/Result'
import { get, put } from '@/request/index'
import { type Ref } from 'vue'
const prefix = '/application'
/**
* -AccessToken
* @param application_id
*/
const getAccessToken: (application_id: string, loading?: Ref<boolean>) => Promise<Result<any>> = (
application_id,
loading
) => {
return get(`${prefix}/${application_id}/setting`, undefined, loading)
}
/**
* -AccessToken
* @param application_id
* data {
* "show_source": boolean,
* "show_history": boolean,
* "draggable": boolean,
* "show_guide": boolean,
* "avatar": file,
* "float_icon": file,
* }
*/
const putAccessToken: (
application_id: string,
data: any,
loading?: Ref<boolean>
) => Promise<Result<any>> = (application_id, data, loading) => {
return put(`${prefix}/${application_id}/setting`, data, undefined, loading)
}
export default {
getAccessToken,
putAccessToken
}