add more backend services
This commit is contained in:
18
src/services/system.ts
Normal file
18
src/services/system.ts
Normal 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user