diff --git a/src/App.vue b/src/App.vue index ba1a0937c..b4c26ef8e 100755 --- a/src/App.vue +++ b/src/App.vue @@ -3,9 +3,6 @@
-
@@ -16,37 +13,40 @@ export default { name: 'app', created () { - if (this.$cookies.get('gdd_is_auth') == 'true') { + if (this.$cookies.get('gdd_is_auth') == 'true' && this.$store.state.is_auth == true) { this.$store.state.user.email = this.$cookies.get('gdd_email') - this.$router.push('/KontoOverview') + + // if ( this.$store.state.is_auth == false && this.$store.state.is_admin == false) { + // this.$router.push("/Landing") + // } else { + this.$router.push('/KontoOverview') + // } }else { this.$router.push("/Landing") } - //if ( this.$store.state.is_auth == false && this.$store.state.is_admin == false) { - // this.$router.push("/Landing") - //} + //var user = { id:1, name:'Journal',session:'25j_7Sl6xDq2Kc3ym0fmrSSk2xV2XkUkX' }; //this.$cookies.set('user',user); //// print user name - console.log("APP.vue START created get cookie is_auth=>",this.$cookies.get('gdd_is_auth')) + //console.log("APP.vue START created get cookie is_auth=>",this.$cookies.get('gdd_is_auth')) }, methods: { /* login() { - console.log("app.vue user login() : " + this.$store.state.is_auth) + //console.log("app.vue user login() : " + this.$store.state.is_auth) this.$store.commit('login') //this.$router.push('/KontoOverview') }, loginAsAdmin () { - console.log("app.vue admin login(): " + this.$store.state.is_admin) + // console.log("app.vue admin login(): " + this.$store.state.is_admin) this.$store.state.modals = true //this.$store.commit('loginAsAdmin') //this.$router.push('/AdminOverview') }, logout(){ - console.log("app.vue user logout() : ") + // console.log("app.vue user logout() : ") this.$store.commit('logout') } */ diff --git a/src/routes/router.js b/src/routes/router.js index f0b1807a5..497d323b2 100644 --- a/src/routes/router.js +++ b/src/routes/router.js @@ -28,9 +28,9 @@ router.beforeEach((to, from, next) => { } //console.log("----------------") - console.log("ROUTER.js to", to) - console.log("ROUTER.js store.state.is_auth", store.state.is_auth) - console.log("ROUTER.js store.commit('isActive')", store.commit('isActive')) + //("ROUTER.js to", to) + //console.log("ROUTER.js store.state.is_auth", store.state.is_auth) + //console.log("ROUTER.js store.commit('isActive')", store.commit('isActive')) //if (store.commit('isActive') ) { // next() diff --git a/src/store/store.js b/src/store/store.js index 792d8f4fd..68bc9a7d2 100644 --- a/src/store/store.js +++ b/src/store/store.js @@ -57,13 +57,14 @@ export const store = new Vuex.Store({ //} // console.log("STORE login() to " + state.is_auth) }, - creatUser( formdata) { + creatUser( state, formdata) { //console.log("Im Store creatUser() start " ) axios.post("http://localhost/login_api/createUser", formdata).then((ldata) => { - //console.log("Im Store creatUser() axios then ", ldata); - // this.ldata = ldata.data; - //return true + console.log("Im Store creatUser() axios then ", ldata); + // this.ldata = ldata.data; + return true + }, (error) => { console.log(error); }); diff --git a/src/views/Starter/SampleLayout.vue b/src/views/Starter/SampleLayout.vue index ca60f375e..f0faaaa55 100755 --- a/src/views/Starter/SampleLayout.vue +++ b/src/views/Starter/SampleLayout.vue @@ -52,6 +52,7 @@ import DashboardContent from '../Layout/Content.vue'; import { FadeTransition } from 'vue2-transitions'; export default { + props: [], components: { DashboardNavbar, ContentFooter,