Skip to content

Commit 354177f

Browse files
Update some file names and imports for consistency with default vue template
1 parent f0d29fa commit 354177f

4 files changed

Lines changed: 95 additions & 7 deletions

File tree

File renamed without changes.

generator/templates/Default/src/API.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import axios from 'axios';
33
import router from './router';
44
import qs from 'qs';
55
<%_ if (options.useAuthorisation) { _%>
6-
import store from './store/store.js'
6+
import store from './store';
77
<%_ } _%>
88
/**
99
* Instantiate promise based HTTP client for the browser and node.js

generator/templates/Default/src/newmain.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import {vuetify} from './plugins';
55
<%_ if (options.useCrud) { _%>
66
import VuetifyResource from '@kingscode/vuetify-resource';
77
<%_ } _%>
8-
import App from './App.vue'
9-
import router from './router'
8+
import App from './App.vue';
9+
import router from './router';
1010
<%_ if (options.useAuthorisation) { _%>
11-
import store from './store/store.js'
11+
import store from './store';
1212
<%_ } _%>
13-
import './registerServiceWorker'
13+
import './registerServiceWorker';
1414

1515
Vue.prototype.$http = API;
1616
window.$http = API;
@@ -21,7 +21,7 @@ Vue.prototype.$store = store;
2121
Vue.use(VuetifyResource);
2222
<%_ } _%>
2323

24-
Vue.config.productionTip = false
24+
Vue.config.productionTip = false;
2525

2626
new Vue({
2727
router,
@@ -30,4 +30,4 @@ new Vue({
3030
store,
3131
<%_ } _%>
3232
render: h => h(App)
33-
}).$mount('#app')
33+
}).$mount('#app');
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
import Vue from 'vue';
2+
import Router from 'vue-router';
3+
<%_ if (options.useAuthorisation) { _%>
4+
import AuthorisationGuard from './guards/AuthorisationGuard';
5+
<%_ } _%>
6+
7+
Vue.use(Router);
8+
9+
export default new Router({
10+
mode: 'history',
11+
base: process.env.BASE_URL,
12+
routes: [
13+
{
14+
path: '',
15+
redirect: {name: 'home'},
16+
},
17+
<%_ if (options.useAuthorisation) { _%>
18+
{
19+
path: '',
20+
component: () => import('@/templates/Authorisation'),
21+
children: [
22+
{
23+
path: '/login',
24+
name: 'login',
25+
component: () => import('@/views/Login'),
26+
},
27+
{
28+
path: '/auth/callback',
29+
name: 'auth.callback',
30+
component: () => import('@/views/AuthorisationCallback'),
31+
},
32+
{
33+
path: '/password/forgotten',
34+
name: 'password.forgotten',
35+
component: () => import('./views/PasswordForgotten.vue'),
36+
},
37+
{
38+
path: '/password/reset/:token',
39+
name: 'password.reset',
40+
component: () => import('./views/PasswordReset.vue'),
41+
},
42+
{
43+
path: '/invitation/accept/:token',
44+
name: 'invitation.accept',
45+
component: () => import('./views/InvitationAccept.vue'),
46+
},
47+
]
48+
},
49+
<%_ } _%>
50+
{
51+
path: '',
52+
<%_ if (options.useAuthorisation) { _%>
53+
beforeEnter: AuthorisationGuard,
54+
<%_ } _%>
55+
component: () => import('@/templates/Default'),
56+
children: [
57+
{
58+
path: '/',
59+
name: 'home',
60+
component: () => import('@/views/Home'),
61+
},
62+
<%_ if (options.useCrud) { _%>
63+
{
64+
path: '/users',
65+
name: 'users',
66+
component: () => import('./views/UserResource.vue')
67+
},
68+
<%_ } _%>
69+
{
70+
path: '/404',
71+
name: '404',
72+
component: () => import('./views/PageNotFound.vue'),
73+
},
74+
{
75+
path: '/403',
76+
name: '403',
77+
component: () => import('./views/PageForbidden.vue'),
78+
},
79+
{
80+
path: '*',
81+
redirect: '/404'
82+
},
83+
],
84+
},
85+
86+
87+
],
88+
});

0 commit comments

Comments
 (0)