Files
orion-visor/orion-visor-ui/src/api/system/setting.ts

60 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-06-18 00:35:45 +08:00
import axios from 'axios';
/**
*
*/
export interface SystemLicenseResponse {
userCount: number;
hostCount: number;
release: string;
releaseName: string;
issueDate: number;
expireDate: number;
expireDay: number;
uuid: string;
}
2024-06-18 00:35:45 +08:00
/**
*
*/
export interface AppInfoResponse {
version: string;
uuid: string;
}
/**
*
2024-06-18 00:35:45 +08:00
*/
export interface AppReleaseResponse {
tagName: string;
2024-06-18 00:35:45 +08:00
body: string;
}
/**
* license
*/
export function getSystemLicenseInfo() {
return axios.get<SystemLicenseResponse>('/infra/system-setting/license');
}
2024-06-18 00:35:45 +08:00
/**
*
*/
export function getSystemAppInfo() {
return axios.get<AppInfoResponse>('/infra/system-setting/app-info');
}
/**
*
2024-06-18 00:35:45 +08:00
*/
export function getAppLatestRelease() {
return axios.get<AppReleaseResponse>('https://visor.orionsec.cn/releases-latest.json', {
2024-06-18 00:35:45 +08:00
// 不添加请求头 否则会报 401
setAuthorization: false,
// 返回原始输出
unwrap: true,
// 不提示请求错误信息 可能会 403
promptRequestErrorMessage: false,
});
}