mirror of
https://github.com/OpenFactorioServerManager/factorio-server-manager.git
synced 2024-12-31 03:11:17 +02:00
33 lines
1.0 KiB
JavaScript
33 lines
1.0 KiB
JavaScript
import regeneratorRuntime from "regenerator-runtime";
|
|
import client from "../client";
|
|
|
|
export default {
|
|
status: async () => {
|
|
const response = await client.get('/api/user/status');
|
|
return response.data;
|
|
},
|
|
login: async data => {
|
|
const response = await client.post('/api/login', data);
|
|
return response.data;
|
|
},
|
|
logout: async () => {
|
|
const response = await client.get('/api/logout');
|
|
return response.data;
|
|
},
|
|
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;
|
|
},
|
|
changePassword: async data => {
|
|
const response = await client.post('/api/user/password', data);
|
|
return response.data;
|
|
}
|
|
} |