2020-06-09 23:41:08 +02:00
|
|
|
import client from "../client";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
status: async () => {
|
|
|
|
|
const response = await client.get('/api/user/status');
|
|
|
|
|
return response.data;
|
2020-06-10 15:15:00 +02:00
|
|
|
},
|
|
|
|
|
login: async data => {
|
2020-06-10 21:44:02 +02:00
|
|
|
const response = await client.post('/api/login', JSON.stringify(data));
|
2020-06-10 15:15:00 +02:00
|
|
|
return response.data;
|
2020-06-13 17:03:14 +02:00
|
|
|
},
|
|
|
|
|
logout: async () => {
|
|
|
|
|
const response = await client.get('/api/logout');
|
|
|
|
|
return response.data;
|
2020-08-02 20:22:53 +02:00
|
|
|
},
|
|
|
|
|
list: async () => {
|
|
|
|
|
const response = await client.get('/api/user/list');
|
|
|
|
|
return response.data;
|
|
|
|
|
},
|
|
|
|
|
add: async (user) => {
|
|
|
|
|
const response = await client.post('/api/user/add', user);
|
|
|
|
|
return response.data;
|
|
|
|
|
},
|
|
|
|
|
delete: async (username) => {
|
|
|
|
|
const response = await client.post('/api/user/remove', JSON.stringify({username}));
|
|
|
|
|
return response.data;
|
2020-06-09 23:41:08 +02:00
|
|
|
}
|
|
|
|
|
}
|