2024-06-18 00:35:45 +08:00
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 应用信息查询响应
|
|
|
|
|
*/
|
|
|
|
|
export interface AppInfoResponse {
|
|
|
|
|
version: string;
|
|
|
|
|
uuid: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 仓库版本信息查询响应
|
|
|
|
|
*/
|
|
|
|
|
export interface RepoReleaseResponse {
|
|
|
|
|
tag_name: string;
|
|
|
|
|
body: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询应用信息
|
|
|
|
|
*/
|
|
|
|
|
export function getSystemAppInfo() {
|
|
|
|
|
return axios.get<AppInfoResponse>('/infra/system-setting/app-info');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取仓库最后版本信息
|
|
|
|
|
*/
|
|
|
|
|
export function getRepoLatestRelease() {
|
2024-08-28 17:14:18 +08:00
|
|
|
return axios.get<RepoReleaseResponse>('https://visor.orionsec.cn/releases-latest.json', {
|
2024-06-18 00:35:45 +08:00
|
|
|
// 不添加请求头 否则会报 401
|
|
|
|
|
setAuthorization: false,
|
|
|
|
|
// 返回原始输出
|
|
|
|
|
unwrap: true,
|
|
|
|
|
// 不提示请求错误信息 可能会 403
|
|
|
|
|
promptRequestErrorMessage: false,
|
|
|
|
|
});
|
|
|
|
|
}
|