项目作者: IvanAquino

项目描述 :
Starter of AdonisJs framework with Vue SPA and Auth prebuilt
高级语言: JavaScript
项目地址: git://github.com/IvanAquino/adonis-vuetify-starter.git
创建时间: 2018-04-15T23:45:38Z
项目社区:https://github.com/IvanAquino/adonis-vuetify-starter

开源协议:

下载


Adonis Vuetify starter with prebuilt auth pages

Features

  • Single Page Application
  • Vue and Vue router configured with Auth restricted pages
  • Two Dashboard page examples
  • Prebuilt auth with JWT
  • UI with Vuetify
  • Powered by AdonisJS

Installation

adonis new myapp —blueprint=IvanAquino/adonis-vuetify-starter

Vue App

Vue app it’s in the folder vue_app/, you can modify the different components and compile

Watch changes on components

  1. npm run watch

Compile production version

  1. npm run production

Vue Router History Mode

Modify myapp/vue_app/router/index.js

  1. let router = new VueRouter({
  2. mode: 'history',
  3. ....

And next modify myapp/start/routes.js

  1. // Route.on('/').render('frontend')
  2. // At the end of the file
  3. Route.any('*', ({ view }) => view.render('frontend'))

AdonisJS documentation - Routing for SPAs

Run adonis serve dev mode

  1. adonis serve --dev

Http Request

You can use this.$http to access all methos of Axios

Headers on authorized routes

Use this.$auth.getToken() to access Bearer Token

  1. let headers = { 'Authorization': this.$auth.getToken() }
  2. this.$http.get(`${window.basePath}/auth/user`, {headers})