add more backend services

This commit is contained in:
Sven Czarnian
2022-11-04 15:28:29 +01:00
orang tua ecc01fbb8c
melakukan 7807c2784c
3 mengubah file dengan 52 tambahan dan 1 penghapusan

18
src/services/system.ts Normal file
Melihat File

@@ -0,0 +1,18 @@
import axios from 'axios';
import { Configuration } from './configuration';
export class System {
static async timestamp(): Promise<number> {
const token = sessionStorage.getItem('token');
if (!token) return 0;
return axios
.get<number>(`${Configuration.resourceServer}/system/timestamp`, {
headers: {
Authorization: `Bearer ${token}`,
},
})
.then((response) => response.data)
.catch(() => 0);
}
}