This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/src/services/Server.js

32 lines
901 B
JavaScript
Raw Normal View History

2019-05-22 12:51:57 +00:00
import Api from '@/services/Api'
2019-11-27 10:38:41 +00:00
import axios from 'axios'
2019-05-22 12:51:57 +00:00
export default {
2019-06-20 16:04:08 +00:00
getPublicSettings (params) {
2019-05-22 12:51:57 +00:00
return Api().get('/v1/server/settings')
2019-11-22 11:06:33 +00:00
},
2019-11-22 15:13:51 +00:00
getAllSettings () {
return Api().get('/v1/server/settings?all=1')
},
2019-11-22 11:06:33 +00:00
getStatus () {
return Api().get("/v1/status/check")
2019-11-27 10:38:41 +00:00
},
getAPIUrl () {
return new Promise((resolve, reject) => {
axios.get('/apiurl')
.then(function (response) {
// handle success
localStorage.setItem("apiURL", response+`api/`)
resolve();
})
.catch(function (error) {
if(error.response.status) {
localStorage.setItem("apiURL", process.env.VUE_APP_API_URL+`api/`)
resolve();
}
});
})
2019-05-22 12:51:57 +00:00
}
2019-11-22 11:06:33 +00:00
}