fixed login and register frontend

This commit is contained in:
jack
2018-05-19 12:01:26 +08:00
parent d23d1defda
commit e539e0b388
5 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -8,5 +8,5 @@ RUN composer install
COPY wait.sh /usr/local/bin/wait.sh
RUN chmod +x /usr/local/bin/wait.sh
CMD /usr/local/bin/wait.sh && php artisan migrate && php artisan db:seed && php artisan serve --host=0.0.0.0 --port=8000
CMD /usr/local/bin/wait.sh && composer dumpautoload && php artisan migrate && php artisan db:seed && php artisan serve --host=0.0.0.0 --port=8000
EXPOSE 8000
+5 -1
View File
@@ -3,7 +3,11 @@ import store from '~/store'
export default async (to, from, next) => {
if (!store.getters['auth/check']) {
next({ name: 'login' })
} else {
}
else if (store.getters['auth/user'].role == "admin"){
next({ name : 'admin.home' })
}
else {
next()
}
}
+1
View File
@@ -55,6 +55,7 @@
<script>
import Form from 'vform'
import LoginWithGithub from '~/components/LoginWithGithub'
import store from '~/store'
export default {
middleware: 'guest',
@@ -59,6 +59,7 @@
<script>
import Form from 'vform'
import LoginWithGithub from '~/components/LoginWithGithub'
import store from '~/store'
export default {
middleware: 'guest',
+1 -1
View File
@@ -6,7 +6,7 @@
<script>
export default {
middleware: ['auth', 'admin'],
middleware: ['auth'],
metaInfo () {
return { title: this.$t('home') }