diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index bb9330920..41b504ec1 100755
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -17,7 +17,7 @@ export default {
this.$store.state.email = this.$cookies.get('gdd_u')
this.$router.push('/KontoOverview')
}else {
- this.$router.push("/Login")
+ this.$router.push("/Login")
}
}
}
diff --git a/frontend/src/routes/routes.js b/frontend/src/routes/routes.js
index 15de73163..844b323b6 100755
--- a/frontend/src/routes/routes.js
+++ b/frontend/src/routes/routes.js
@@ -8,23 +8,23 @@ import NotFound from '@/views/NotFoundPage.vue'
const routes = [
{
path: '/',
- redirect: 'landing',
+ redirect: 'login',
component: AuthLayoutGDD,
children: [
{
path: '/login',
name: 'login',
- component: () => import(/* webpackChunkName: "demo" */ '../views/Pages/Login.vue')
+ component: () => import('../views/Pages/Login.vue')
},
{
path: '/thx',
name: 'Thanks',
- component: () => import(/* webpackChunkName: "demo" */ '../views/thx.vue')
+ component: () => import('../views/Pages/thx.vue')
},
{
path: '/register',
name: 'register',
- component: () => import(/* webpackChunkName: "demo" */ '../views/Pages/Register.vue')
+ component: () => import('../views/Pages/Register.vue')
},
]
},
@@ -36,7 +36,7 @@ const routes = [
{
path: '/KontoOverview',
name: 'Kontoübersicht',
- component: () => import(/* webpackChunkName: "demo" */ '../views/KontoOverview.vue'),
+ component: () => import('../views/KontoOverview.vue'),
meta: {
requiresAuth: true
}
@@ -44,7 +44,7 @@ const routes = [
{
path: '/profile',
name: 'profile',
- component: () => import(/* webpackChunkName: "demo" */ '../views/Pages/UserProfile.vue')
+ component: () => import('../views/Pages/UserProfile.vue')
}
]
},
@@ -57,7 +57,7 @@ const routes = [
{
path: '/AdminOverview',
name: 'Adminübersicht',
- component: () => import(/* webpackChunkName: "demo" */ '../views/AdminOverview.vue'),
+ component: () => import('../views/AdminOverview.vue'),
meta: {
requiresAuth: true
}
diff --git a/frontend/src/store/store.js b/frontend/src/store/store.js
index cb85c42c5..848ce1e4b 100644
--- a/frontend/src/store/store.js
+++ b/frontend/src/store/store.js
@@ -4,6 +4,8 @@ Vue.use(Vuex)
import router from '../routes/router.js'
import loginAPI from '../apis/loginAPI'
import communityAPI from '../apis/communityAPI'
+import axios from 'axios'
+
export const store = new Vuex.Store({
state: {
@@ -11,7 +13,8 @@ export const store = new Vuex.Store({
email: null,
user : {
name:"",
- balance: 0
+ balance: 0,
+ balance_gdt: 0
},
ajaxCreateData: {
session_id : '',
@@ -44,6 +47,10 @@ export const store = new Vuex.Store({
console.log('mutation: user_balance')
state.user.balance = balance / 10000
},
+ user_balance_gdt: (state,balance) => {
+ console.log('mutation: user_balance_gdt')
+ state.user.balance_gdt = balance / 10000
+ },
transactions: (state,transactions) => {
console.log('mutation: transactions')
state.transactions = transactions
@@ -110,14 +117,29 @@ export const store = new Vuex.Store({
}
},
ajaxListTransactions: async ({commit, dispatch, state}) => {
- console.log('action: ajaxListTransactions')
- const result = await communityAPI.transactions(state.session_id)
- console.log(result)
- if(result.success) {
- commit('transactions', result.result.data.transactions)
- } else {
- dispatch('logout')
- }
+ console.log('action: ajaxListTransactions', state.session_id)
+ // const result = await communityAPI.transactions(state.session_id)
+
+ axios.get("http://localhost/state-balances/ajaxListTransactions/"+ state.session_id).then((result) => {
+ console.log("result",result)
+ console.log("result.state",result.data.state)
+
+ console.log("result.data.state == 'success'",result.data.state == "success")
+ if(result.data.state == "success") {
+ console.log("result.count",result.data.count)
+ console.log("result.gdtSum",result.data.gdtSum)
+ console.log("result.transactions",result.data.transactions)
+ commit('transactions', result.data.transactions)
+ commit('user_balance_gdt', result.data.gdtSum)
+ } else {
+ dispatch('logout')
+ }
+
+ }, (error) => {
+ console.log(error);
+ });
+
+
},
accountBalance: async ({ commit, dispatch, state }) => {
console.log('action: accountBalance')
diff --git a/frontend/src/views/KontoOverview.vue b/frontend/src/views/KontoOverview.vue
index 4cfcddfe7..130f7e6fa 100644
--- a/frontend/src/views/KontoOverview.vue
+++ b/frontend/src/views/KontoOverview.vue
@@ -8,21 +8,18 @@
-
+
- {{this.$store.state.user}} -
-- {{this.$store.state.user.balance}} -
- -- {{this.$store.state.transactions}} -
- - -- {{userparticipation}} -
- - -