mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-28 19:10:40 +00:00
- route 401 redirection
- guest & user view consolidation
This commit is contained in:
@@ -110,7 +110,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'isLogged', 'isGuest', 'config', 'fileQueue'
|
||||
'config', 'fileQueue'
|
||||
]),
|
||||
isGuestLayout() {
|
||||
return (includes([
|
||||
@@ -122,7 +122,7 @@ export default {
|
||||
'CreateNewPassword',
|
||||
'EnvironmentSetup',
|
||||
'VerifyByPassword',
|
||||
'SaaSLandingPage',
|
||||
'Homepage',
|
||||
'BillingsDetail',
|
||||
'NotFoundShared',
|
||||
'AdminAccount',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<nav class="main-navigation">
|
||||
<router-link :to="{name: 'SaaSLandingPage'}" tag="div" class="logo">
|
||||
<router-link :to="{name: 'Homepage'}" tag="div" class="logo">
|
||||
<img v-if="config.app_logo_horizontal" :src="$getImage(config.app_logo_horizontal)" :alt="config.app_name">
|
||||
<b v-if="! config.app_logo_horizontal" class="logo-text">{{ config.app_name }}</b>
|
||||
</router-link>
|
||||
@@ -17,7 +17,7 @@
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="navigation-links">
|
||||
<ul v-if="! config.isAuthenticated" class="navigation-links">
|
||||
<li>
|
||||
<router-link :to="{name: 'SignIn'}">
|
||||
{{ $t('page_index.menu.log_in') }}
|
||||
@@ -29,6 +29,13 @@
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
<ul v-if="config.isAuthenticated" class="navigation-links">
|
||||
<li v-if="config.userRegistration">
|
||||
<router-link class="cta-button" :to="{name: 'Files'}">
|
||||
Go to Files <!--todo: preklad-->
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<router-link class="cta-button log-in" :to="{name: 'SignIn'}">
|
||||
{{ $t('page_index.menu.log_in') }}
|
||||
@@ -77,7 +84,7 @@
|
||||
|
||||
.navigation-links {
|
||||
display: inline-block;
|
||||
margin-left: 50px;
|
||||
margin-left: 25px;
|
||||
|
||||
&:first-child {
|
||||
margin-left: 0;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<footer class="page-wrapper medium">
|
||||
<router-link :to="{name: 'SaaSLandingPage'}" tag="div" class="logo">
|
||||
<router-link :to="{name: 'Homepage'}" tag="div" class="logo">
|
||||
<img v-if="config.app_logo_horizontal" :src="$getImage(config.app_logo_horizontal)" :alt="config.app_name">
|
||||
<b v-if="! config.app_logo_horizontal" class="logo-text">{{ config.app_name }}</b>
|
||||
</router-link>
|
||||
|
||||
@@ -3,26 +3,29 @@
|
||||
<PageTitle
|
||||
:title="index.header_title"
|
||||
:description="index.header_description"
|
||||
></PageTitle>
|
||||
/>
|
||||
|
||||
<!--User registration button-->
|
||||
<router-link v-if="config.userRegistration" class="sign-up-button" :to="{name: 'SignUp'}">
|
||||
<AuthButton class="button" icon="chevron-right" :text="$t('page_index.sign_up_button')" />
|
||||
</router-link>
|
||||
<div v-if="! config.isAuthenticated">
|
||||
|
||||
<!--User login button-->
|
||||
<router-link v-if="! config.userRegistration" class="sign-up-button" :to="{name: 'SignIn'}">
|
||||
<AuthButton class="button" icon="chevron-right" :text="$t('page_index.menu.log_in')" />
|
||||
</router-link>
|
||||
<!--User registration button-->
|
||||
<router-link v-if="config.userRegistration" class="sign-up-button" :to="{name: 'SignUp'}">
|
||||
<AuthButton class="button" icon="chevron-right" :text="$t('page_index.sign_up_button')" />
|
||||
</router-link>
|
||||
|
||||
<div class="features" v-if="config.isSaaS">
|
||||
<div class="feature">
|
||||
<credit-card-icon size="19" class="feature-icon"></credit-card-icon>
|
||||
<b class="feature-title">{{ $t('page_index.sign_feature_1') }}</b>
|
||||
</div>
|
||||
<div class="feature">
|
||||
<hard-drive-icon size="19" class="feature-icon"></hard-drive-icon>
|
||||
<b class="feature-title">{{ $t('page_index.sign_feature_2', {defaultSpace: config.storageDefaultSpaceFormatted}) }}</b>
|
||||
<!--User login button-->
|
||||
<router-link v-if="! config.userRegistration" class="sign-up-button" :to="{name: 'SignIn'}">
|
||||
<AuthButton class="button" icon="chevron-right" :text="$t('page_index.menu.log_in')" />
|
||||
</router-link>
|
||||
|
||||
<div class="features" v-if="config.isSaaS">
|
||||
<div class="feature">
|
||||
<credit-card-icon size="19" class="feature-icon"></credit-card-icon>
|
||||
<b class="feature-title">{{ $t('page_index.sign_feature_1') }}</b>
|
||||
</div>
|
||||
<div class="feature">
|
||||
<hard-drive-icon size="19" class="feature-icon"></hard-drive-icon>
|
||||
<b class="feature-title">{{ $t('page_index.sign_feature_2', {defaultSpace: config.storageDefaultSpaceFormatted}) }}</b>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
Vendored
+11
-6
@@ -1,9 +1,11 @@
|
||||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
import i18n from '@/i18n/index'
|
||||
import store from './store/index'
|
||||
|
||||
import AdminMobileMenu from './views/Mobile/AdminMobileMenu'
|
||||
import UserProfileMobileMenu from './views/Mobile/UserProfileMobileMenu'
|
||||
import {mapGetters} from "vuex";
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
@@ -589,10 +591,10 @@ const routesMaintenance = [
|
||||
]
|
||||
const routesIndex = [
|
||||
{
|
||||
name: 'SaaSLandingPage',
|
||||
name: 'Homepage',
|
||||
path: '/',
|
||||
component: () =>
|
||||
import(/* webpackChunkName: "chunks/landing-page" */ './views/Index/SaaSLandingPage'),
|
||||
import(/* webpackChunkName: "chunks/homepage" */ './views/Frontpage/Homepage'),
|
||||
meta: {
|
||||
requiresAuth: false
|
||||
},
|
||||
@@ -601,7 +603,7 @@ const routesIndex = [
|
||||
name: 'DynamicPage',
|
||||
path: '/page/:slug',
|
||||
component: () =>
|
||||
import(/* webpackChunkName: "chunks/dynamic-page" */ './views/Index/DynamicPage'),
|
||||
import(/* webpackChunkName: "chunks/dynamic-page" */ './views/Frontpage/DynamicPage'),
|
||||
meta: {
|
||||
requiresAuth: false
|
||||
},
|
||||
@@ -610,7 +612,7 @@ const routesIndex = [
|
||||
name: 'ContactUs',
|
||||
path: '/contact-us',
|
||||
component: () =>
|
||||
import(/* webpackChunkName: "chunks/contact-us" */ './views/Index/ContactUs'),
|
||||
import(/* webpackChunkName: "chunks/contact-us" */ './views/Frontpage/ContactUs'),
|
||||
meta: {
|
||||
requiresAuth: false
|
||||
},
|
||||
@@ -642,8 +644,11 @@ router.beforeEach((to, from, next) => {
|
||||
// this route requires auth, check if logged in
|
||||
// if not, redirect to login page.
|
||||
|
||||
//if ( ! store.getters.isLogged) {
|
||||
if (false) {
|
||||
let isAuthenticated = store.getters.config
|
||||
? store.getters.config.isAuthenticated
|
||||
: config.isAuthenticated;
|
||||
|
||||
if ( ! isAuthenticated) {
|
||||
next({
|
||||
name: 'SignIn',
|
||||
query: {redirect: to.fullPath}
|
||||
|
||||
+1
-7
@@ -1,11 +1,8 @@
|
||||
import axios from 'axios'
|
||||
import {events} from '@/bus'
|
||||
import i18n from '@/i18n/index.js'
|
||||
import router from '@/router'
|
||||
import Vue from 'vue'
|
||||
|
||||
const defaultState = {
|
||||
authorized: undefined,
|
||||
permission: 'master', // master | editor | visitor
|
||||
user: undefined,
|
||||
}
|
||||
@@ -48,7 +45,7 @@ const actions = {
|
||||
}, 300)
|
||||
|
||||
axios
|
||||
.get(getters.api + '/user/logout')
|
||||
.post('/logout')
|
||||
.then(() => {
|
||||
clearTimeout(popup)
|
||||
commit('DESTROY_DATA')
|
||||
@@ -123,7 +120,6 @@ const mutations = {
|
||||
state.permission = role
|
||||
},
|
||||
DESTROY_DATA(state) {
|
||||
state.authorized = false
|
||||
state.app = undefined
|
||||
},
|
||||
ADD_TO_FAVOURITES(state, folder) {
|
||||
@@ -155,8 +151,6 @@ const mutations = {
|
||||
|
||||
const getters = {
|
||||
permission: state => state.permission,
|
||||
isGuest: state => !state.authorized,
|
||||
isLogged: state => state.authorized,
|
||||
user: state => state.user,
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
name: 'SaaSLandingPage',
|
||||
name: 'Homepage',
|
||||
components: {
|
||||
HeroScreenshot,
|
||||
PricingTables,
|
||||
Reference in New Issue
Block a user