diff --git a/src/App.vue b/src/App.vue index c7d7fb0..0c17788 100644 --- a/src/App.vue +++ b/src/App.vue @@ -43,10 +43,10 @@ this.$nextTick(() =>{ window.setInterval(() => { - this.$log.debug(getRemainingJwtValiditySeconds(this.$store.state.access_token)); + // this.$log.debug(getRemainingJwtValiditySeconds(this.$store.state.access_token)); this.tokenValidity = getRemainingJwtValiditySeconds(this.$store.state.access_token); this.refreshTokenValidity = getRemainingJwtValiditySeconds(this.$store.state.refresh_token); - this.$log.debug(this.$store.state); + // this.$log.debug(this.$store.state); }, 1000); }); diff --git a/src/api/Repository.js b/src/api/Repository.js index e54a020..35ceacb 100644 --- a/src/api/Repository.js +++ b/src/api/Repository.js @@ -1,12 +1,12 @@ // Repository.js -import Vue from 'vue'; +import Vue from "vue"; import axios from "axios"; +import store from "@/store"; const baseDomain = "http://localhost:5443"; const API_URL = `${baseDomain}/api/v1`; export default axios.create({ - API_URL, - headers: { headers: { Authorization: `Bearer ${jwt}` } }, + baseURL: API_URL, headers: { Authorization: `Bearer ${store.state.access_token}` }, }); diff --git a/src/api/RepositoryFactory.js b/src/api/RepositoryFactory.js new file mode 100644 index 0000000..ae7ed2d --- /dev/null +++ b/src/api/RepositoryFactory.js @@ -0,0 +1,11 @@ +// RepositoryFactory.js + +import GroupRepository from "./groupRepository"; + +const repositories = { + group: GroupRepository, +}; + +export const RepositoryFactory = { + get: name => repositories[name], +}; diff --git a/src/api/groupRepository.js b/src/api/groupRepository.js new file mode 100644 index 0000000..315bbf9 --- /dev/null +++ b/src/api/groupRepository.js @@ -0,0 +1,19 @@ +// groupRepository.js + +import Repository from "./Repository"; + +const resource = "/group"; + +export default { + get() { + return Repository.get(`${resource}`); + }, + + getGroup(groupId) { + return Repository.get(`${resource}/${groupId}`); + }, + + createGroup(groupData) { + return Repository.post(`${resource}`, groupData); + }, +}; diff --git a/src/components/Group.vue b/src/components/Group.vue index 897fae6..b3efc23 100644 --- a/src/components/Group.vue +++ b/src/components/Group.vue @@ -5,6 +5,55 @@
| {{col}} + + | +
|---|
| {{row[col]}} | +
| {{col}} + + | +
|---|
| {{row[col]}} | +
{{ errorMsg }}