23 lines
518 B
TypeScript
23 lines
518 B
TypeScript
import { requestGetJson, requestPostJson } from '@/shared/api/http'
|
|
|
|
export interface VersionResponse {
|
|
version?: string
|
|
has_update?: boolean
|
|
latest_version?: string
|
|
desc?: string
|
|
file_url?: string
|
|
}
|
|
|
|
export interface UpdateStartResponse {
|
|
success: boolean
|
|
error?: string
|
|
}
|
|
|
|
export function fetchVersion() {
|
|
return requestGetJson<VersionResponse>('/api/version')
|
|
}
|
|
|
|
export function startUpdate(fileUrl: string) {
|
|
return requestPostJson<UpdateStartResponse>('/api/update/do', { file_url: fileUrl })
|
|
}
|