├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .postcssrc.js ├── .stylintrc ├── LICENSE ├── README.md ├── package-lock.json ├── package.json ├── quasar.conf.js └── src ├── App.vue ├── assets ├── quasar-logo-full.svg └── sad.svg ├── components └── .gitkeep ├── css ├── app.styl └── themes │ ├── common.variables.styl │ ├── variables.ios.styl │ └── variables.mat.styl ├── index.template.html ├── layouts └── default.vue ├── pages ├── 404.vue ├── account.vue ├── index.vue └── login.vue ├── plugins ├── .gitkeep └── axios.js ├── router ├── index.js └── routes.js ├── statics ├── icons │ ├── apple-icon-152x152.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── icon-128x128.png │ ├── icon-192x192.png │ ├── icon-256x256.png │ ├── icon-384x384.png │ ├── icon-512x512.png │ └── ms-icon-144x144.png └── quasar-logo.png └── store ├── auth ├── actions.js ├── getters.js ├── index.js ├── mutations.js └── state.js └── index.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/preset-env", { 5 | "modules": false, 6 | "loose": false, 7 | "useBuiltIns": "usage" 8 | } 9 | ], 10 | [ 11 | "@babel/preset-stage-2", { 12 | "modules": false, 13 | "loose": false, 14 | "useBuiltIns": true, 15 | "decoratorsLegacy": true 16 | } 17 | ] 18 | ], 19 | "plugins": [ 20 | [ 21 | "@babel/transform-runtime", { 22 | "polyfill": false, 23 | "regenerator": false 24 | } 25 | ] 26 | ], 27 | "comments": false 28 | } 29 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | /dist 2 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parserOptions: { 4 | parser: 'babel-eslint', 5 | sourceType: 'module' 6 | }, 7 | env: { 8 | browser: true 9 | }, 10 | extends: [ 11 | // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention 12 | // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules. 13 | 'plugin:vue/essential', 14 | // https://github.com/standard/standard/blob/master/docs/RULES-en.md 15 | 'standard' 16 | ], 17 | // required to lint *.vue files 18 | plugins: [ 19 | 'vue' 20 | ], 21 | globals: { 22 | 'ga': true, // Google Analytics 23 | 'cordova': true, 24 | '__statics': true 25 | }, 26 | // add your custom rules here 27 | 'rules': { 28 | // allow async-await 29 | 'generator-star-spacing': 'off', 30 | 31 | // allow paren-less arrow functions 32 | 'arrow-parens': 0, 33 | 'one-var': 0, 34 | 35 | 'import/first': 0, 36 | 'import/named': 2, 37 | 'import/namespace': 2, 38 | 'import/default': 2, 39 | 'import/export': 2, 40 | 'import/extensions': 0, 41 | 'import/no-unresolved': 0, 42 | 'import/no-extraneous-dependencies': 0, 43 | 44 | // allow debugger during development 45 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .quasar 2 | .DS_Store 3 | .thumbs.db 4 | node_modules 5 | /dist 6 | /src-cordova/platforms 7 | /src-cordova/plugins 8 | /src-cordova/www 9 | npm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | 13 | # Editor directories and files 14 | .idea 15 | .vscode 16 | *.suo 17 | *.ntvs* 18 | *.njsproj 19 | *.sln 20 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | plugins: [ 5 | // to edit target browsers: use "browserslist" field in package.json 6 | require('autoprefixer') 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /.stylintrc: -------------------------------------------------------------------------------- 1 | { 2 | "blocks": "never", 3 | "brackets": "never", 4 | "colons": "never", 5 | "colors": "always", 6 | "commaSpace": "always", 7 | "commentSpace": "always", 8 | "cssLiteral": "never", 9 | "depthLimit": false, 10 | "duplicates": true, 11 | "efficient": "always", 12 | "extendPref": false, 13 | "globalDupe": true, 14 | "indentPref": 2, 15 | "leadingZero": "never", 16 | "maxErrors": false, 17 | "maxWarnings": false, 18 | "mixed": false, 19 | "namingConvention": false, 20 | "namingConventionStrict": false, 21 | "none": "never", 22 | "noImportant": false, 23 | "parenSpace": "never", 24 | "placeholder": false, 25 | "prefixVarsWithDollar": "always", 26 | "quotePref": "single", 27 | "semicolons": "never", 28 | "sortOrder": false, 29 | "stackedProperties": "never", 30 | "trailingWhitespace": "never", 31 | "universal": "never", 32 | "valid": true, 33 | "zeroUnits": "never", 34 | "zIndexNormalize": false 35 | } 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Campus Cloud 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Quasar Framework logo](https://cdn.rawgit.com/quasarframework/quasar-art/863c14bd/dist/svg/quasar-logo-full-inline.svg) 2 | 3 | # Quasar Framework JWT Starter Kit 4 | > Starter Kit for a Quasar Project with JWT Authentication. 5 | 6 | ## Usage 7 | 8 | First, make sure you have Node >= 8 and NPM >= 5. 9 | 10 | ``` bash 11 | # install Quasar CLI beta version: 12 | $ npm install -g quasar-cli 13 | 14 | # install Vue CLI if you don't have it already 15 | $ npm install -g vue-cli 16 | 17 | # clone Quasar-JWT Starter Kit 18 | $ git clone https://github.com/neatpro/Quasar-JWT.git 19 | 20 | $ cd Quasar-JWT 21 | $ npm install 22 | 23 | $ quasar dev 24 | ``` 25 | 26 | > Backend using Laravel Framework https://github.com/neatpro/Laravel-JWT -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "quasar-jwt", 3 | "version": "1.0.0", 4 | "description": "JWT authentication for Quasar Framework", 5 | "productName": "Quasar JWT", 6 | "cordovaId": "org.cordova.quasar.app", 7 | "author": "Sasa Skoko", 8 | "private": true, 9 | "scripts": { 10 | "lint": "eslint --ext .js,.vue src", 11 | "test": "echo \"No test specified\" && exit 0" 12 | }, 13 | "dependencies": { 14 | "@websanova/vue-auth": "2.21.14-beta", 15 | "axios": "^0.18.0", 16 | "vue-axios": "^2.0.2", 17 | "vuex-router-sync": "^5.0.0" 18 | }, 19 | "devDependencies": { 20 | "babel-eslint": "10.0.1", 21 | "eslint": "5.6.1", 22 | "eslint-config-standard": "12.0.0", 23 | "eslint-friendly-formatter": "4.0.1", 24 | "eslint-loader": "2.1.1", 25 | "eslint-plugin-import": "2.14.0", 26 | "eslint-plugin-node": "7.0.1", 27 | "eslint-plugin-promise": "4.0.1", 28 | "eslint-plugin-standard": "4.0.0", 29 | "eslint-plugin-vue": "4.7.1", 30 | "quasar-cli": "^0.17.20", 31 | "strip-ansi": "^3.0.1" 32 | }, 33 | "engines": { 34 | "node": ">= 8.9.0", 35 | "npm": ">= 5.6.0" 36 | }, 37 | "browserslist": [ 38 | "> 1%", 39 | "last 2 versions", 40 | "not ie <= 10" 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /quasar.conf.js: -------------------------------------------------------------------------------- 1 | // Configuration for your app 2 | 3 | module.exports = function (ctx) { 4 | return { 5 | // app plugins (/src/plugins) 6 | plugins: [ 7 | 'axios' 8 | ], 9 | css: [ 10 | 'app.styl' 11 | ], 12 | extras: [ 13 | ctx.theme.mat ? 'roboto-font' : null, 14 | 'material-icons' 15 | // 'ionicons', 16 | // 'mdi', 17 | // 'fontawesome' 18 | ], 19 | supportIE: false, 20 | vendor: { 21 | add: [], 22 | remove: [] 23 | }, 24 | build: { 25 | scopeHoisting: true, 26 | vueRouterMode: 'history', 27 | // gzip: true, 28 | // analyze: true, 29 | // extractCSS: false, 30 | // useNotifier: false, 31 | extendWebpack (cfg) { 32 | cfg.module.rules.push({ 33 | enforce: 'pre', 34 | test: /\.(js|vue)$/, 35 | loader: 'eslint-loader', 36 | exclude: /(node_modules|quasar)/ 37 | }) 38 | } 39 | }, 40 | devServer: { 41 | https: true, 42 | proxy: { 43 | "/backend/api": { 44 | target: "http://127.0.0.1:8000", 45 | pathRewrite: {"^/backend/api" : "api"} 46 | } 47 | } 48 | // https: true, 49 | // port: 8080, 50 | // open: true // opens browser window automatically 51 | }, 52 | // framework: 'all' --- includes everything; for dev only! 53 | framework: { 54 | components: [ 55 | 'QLayout', 56 | 'QLayoutHeader', 57 | 'QLayoutDrawer', 58 | 'QPageContainer', 59 | 'QPage', 60 | 'QToolbar', 61 | 'QToolbarTitle', 62 | 'QTabs', 63 | 'QTab', 64 | 'QRouteTab', 65 | 'QBtn', 66 | 'QIcon', 67 | 'QList', 68 | 'QListHeader', 69 | 'QItem', 70 | 'QItemMain', 71 | 'QItemSide', 72 | 'QAjaxBar', 73 | 'QCard', 74 | 'QCardSeparator', 75 | 'QCardActions', 76 | 'QInput', 77 | 'QPopover', 78 | 'QSelect', 79 | 'QOptionGroup' 80 | ], 81 | directives: [ 82 | 'Ripple', 83 | 'CloseOverlay' 84 | ], 85 | // Quasar plugins 86 | plugins: [ 87 | 'Notify' 88 | ] 89 | }, 90 | // animations: 'all' --- includes all animations 91 | animations: [ 92 | ], 93 | pwa: { 94 | cacheExt: 'js,html,css,ttf,eot,otf,woff,woff2,json,svg,gif,jpg,jpeg,png,wav,ogg,webm,flac,aac,mp4,mp3', 95 | manifest: { 96 | // name: 'Quasar App', 97 | // short_name: 'Quasar-PWA', 98 | // description: 'Best PWA App in town!', 99 | display: 'standalone', 100 | orientation: 'portrait', 101 | background_color: '#ffffff', 102 | theme_color: '#027be3', 103 | icons: [ 104 | { 105 | 'src': 'statics/icons/icon-128x128.png', 106 | 'sizes': '128x128', 107 | 'type': 'image/png' 108 | }, 109 | { 110 | 'src': 'statics/icons/icon-192x192.png', 111 | 'sizes': '192x192', 112 | 'type': 'image/png' 113 | }, 114 | { 115 | 'src': 'statics/icons/icon-256x256.png', 116 | 'sizes': '256x256', 117 | 'type': 'image/png' 118 | }, 119 | { 120 | 'src': 'statics/icons/icon-384x384.png', 121 | 'sizes': '384x384', 122 | 'type': 'image/png' 123 | }, 124 | { 125 | 'src': 'statics/icons/icon-512x512.png', 126 | 'sizes': '512x512', 127 | 'type': 'image/png' 128 | } 129 | ] 130 | } 131 | }, 132 | cordova: { 133 | // id: 'org.cordova.quasar.app' 134 | }, 135 | electron: { 136 | extendWebpack (cfg) { 137 | // do something with cfg 138 | }, 139 | packager: { 140 | // OS X / Mac App Store 141 | // appBundleId: '', 142 | // appCategoryType: '', 143 | // osxSign: '', 144 | // protocol: 'myapp://path', 145 | 146 | // Window only 147 | // win32metadata: { ... } 148 | } 149 | }, 150 | 151 | // leave this here for Quasar CLI 152 | starterKit: '1.0.0' 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 14 | 15 | 17 | -------------------------------------------------------------------------------- /src/assets/quasar-logo-full.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 43 | 45 | 46 | 48 | image/svg+xml 49 | 51 | 52 | 53 | 54 | 55 | 60 | 63 | 66 | 69 | 75 | 79 | 83 | 87 | 91 | 95 | 99 | 103 | 104 | 105 | 106 | 107 | 113 | 118 | 126 | 133 | 142 | 151 | 160 | 169 | 178 | 187 | 188 | 189 | 190 | 191 | 192 | -------------------------------------------------------------------------------- /src/assets/sad.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neatpro/Quasar-JWT/de3c8d9868768bf2aa8c994ce8ae403162f70bd5/src/components/.gitkeep -------------------------------------------------------------------------------- /src/css/app.styl: -------------------------------------------------------------------------------- 1 | // app global css 2 | -------------------------------------------------------------------------------- /src/css/themes/common.variables.styl: -------------------------------------------------------------------------------- 1 | // App Shared Variables 2 | // -------------------------------------------------- 3 | // To customize the look and feel of this app, you can override 4 | // the Stylus variables found in Quasar's source Stylus files. Setting 5 | // variables before Quasar's Stylus will use these variables rather than 6 | // Quasar's default Stylus variable values. Stylus variables specific 7 | // to the themes belong in either the variables.ios.styl or variables.mat.styl files. 8 | 9 | // Check documentation for full list of Quasar variables 10 | 11 | 12 | // App Shared Color Variables 13 | // -------------------------------------------------- 14 | // It's highly recommended to change the default colors 15 | // to match your app's branding. 16 | 17 | $primary = #027be3 18 | $secondary = #26A69A 19 | $tertiary = #555 20 | 21 | $neutral = #E0E1E2 22 | $positive = #21BA45 23 | $negative = #DB2828 24 | $info = #31CCEC 25 | $warning = #F2C037 26 | -------------------------------------------------------------------------------- /src/css/themes/variables.ios.styl: -------------------------------------------------------------------------------- 1 | // App Shared Variables 2 | // -------------------------------------------------- 3 | // Shared Stylus variables go in the common.variables.styl file 4 | @import 'common.variables' 5 | 6 | // iOS only Quasar variables overwrites 7 | // ----------------------------------------- 8 | -------------------------------------------------------------------------------- /src/css/themes/variables.mat.styl: -------------------------------------------------------------------------------- 1 | // App Shared Variables 2 | // -------------------------------------------------- 3 | // Shared Stylus variables go in the common.variables.styl file 4 | @import 'common.variables' 5 | 6 | // Material only Quasar variables overwrites 7 | // ----------------------------------------- 8 | -------------------------------------------------------------------------------- /src/index.template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.productName %> 9 | 10 | 11 | 12 | 13 | 14 | 15 | <% if (!htmlWebpackPlugin.options.ctx.mode.electron) { %> 16 | 19 | <% } %> 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/layouts/default.vue: -------------------------------------------------------------------------------- 1 | 60 | 61 | 100 | 101 | 103 | -------------------------------------------------------------------------------- /src/pages/404.vue: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /src/pages/account.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 25 | 26 | 52 | -------------------------------------------------------------------------------- /src/pages/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 9 | 10 | 18 | -------------------------------------------------------------------------------- /src/pages/login.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 21 | 22 | 49 | -------------------------------------------------------------------------------- /src/plugins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neatpro/Quasar-JWT/de3c8d9868768bf2aa8c994ce8ae403162f70bd5/src/plugins/.gitkeep -------------------------------------------------------------------------------- /src/plugins/axios.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | 3 | export default ({ Vue }) => { 4 | Vue.prototype.$axios = axios 5 | } 6 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | import store from './../store/index' 4 | import { sync } from 'vuex-router-sync' 5 | import routes from './routes' 6 | 7 | Vue.use(VueRouter) 8 | 9 | Vue.router = new VueRouter({ 10 | /* 11 | * NOTE! Change Vue Router mode from quasar.conf.js -> build.env.VUE_ROUTER_MODE 12 | * 13 | * If you decide to go with "history" mode, please also set "build.publicPath" 14 | * to something other than an empty string. 15 | * Example: '/' instead of '' 16 | */ 17 | 18 | // Leave as is and change from quasar.conf.js instead! 19 | mode: process.env.VUE_ROUTER_MODE, 20 | base: process.env.VUE_ROUTER_BASE, 21 | scrollBehavior: () => ({ y: 0 }), 22 | routes 23 | }) 24 | 25 | // Sync Vuex and vue-router; 26 | sync(store, Vue.router) 27 | 28 | import axios from 'axios' 29 | import VueAxios from 'vue-axios' 30 | Vue.use(VueAxios, axios) 31 | Vue.axios.defaults.baseURL = '/backend/api' 32 | 33 | import auth from '@websanova/vue-auth' 34 | 35 | Vue.use(auth, { 36 | auth: require('@websanova/vue-auth/drivers/auth/bearer.js'), 37 | http: require('@websanova/vue-auth/drivers/http/axios.1.x.js'), 38 | router: require('@websanova/vue-auth/drivers/router/vue-router.2.x.js'), 39 | rolesVar: 'role' 40 | }) 41 | 42 | export default Vue.router 43 | -------------------------------------------------------------------------------- /src/router/routes.js: -------------------------------------------------------------------------------- 1 | 2 | export default [ 3 | { 4 | path: '/login', 5 | name: 'login', 6 | component: () => import('pages/login') 7 | }, 8 | { 9 | path: '/', 10 | component: () => import('layouts/default'), 11 | meta: { auth: true }, 12 | children: [ 13 | { path: '', component: () => import('pages/index') }, 14 | { path: '/account', name: 'account', component: () => import('pages/account') } 15 | ] 16 | }, 17 | 18 | { // Always leave this as last one 19 | path: '*', 20 | component: () => import('pages/404') 21 | } 22 | ] 23 | -------------------------------------------------------------------------------- /src/statics/icons/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neatpro/Quasar-JWT/de3c8d9868768bf2aa8c994ce8ae403162f70bd5/src/statics/icons/apple-icon-152x152.png -------------------------------------------------------------------------------- /src/statics/icons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neatpro/Quasar-JWT/de3c8d9868768bf2aa8c994ce8ae403162f70bd5/src/statics/icons/favicon-16x16.png -------------------------------------------------------------------------------- /src/statics/icons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neatpro/Quasar-JWT/de3c8d9868768bf2aa8c994ce8ae403162f70bd5/src/statics/icons/favicon-32x32.png -------------------------------------------------------------------------------- /src/statics/icons/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neatpro/Quasar-JWT/de3c8d9868768bf2aa8c994ce8ae403162f70bd5/src/statics/icons/icon-128x128.png -------------------------------------------------------------------------------- /src/statics/icons/icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neatpro/Quasar-JWT/de3c8d9868768bf2aa8c994ce8ae403162f70bd5/src/statics/icons/icon-192x192.png -------------------------------------------------------------------------------- /src/statics/icons/icon-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neatpro/Quasar-JWT/de3c8d9868768bf2aa8c994ce8ae403162f70bd5/src/statics/icons/icon-256x256.png -------------------------------------------------------------------------------- /src/statics/icons/icon-384x384.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neatpro/Quasar-JWT/de3c8d9868768bf2aa8c994ce8ae403162f70bd5/src/statics/icons/icon-384x384.png -------------------------------------------------------------------------------- /src/statics/icons/icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neatpro/Quasar-JWT/de3c8d9868768bf2aa8c994ce8ae403162f70bd5/src/statics/icons/icon-512x512.png -------------------------------------------------------------------------------- /src/statics/icons/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neatpro/Quasar-JWT/de3c8d9868768bf2aa8c994ce8ae403162f70bd5/src/statics/icons/ms-icon-144x144.png -------------------------------------------------------------------------------- /src/statics/quasar-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neatpro/Quasar-JWT/de3c8d9868768bf2aa8c994ce8ae403162f70bd5/src/statics/quasar-logo.png -------------------------------------------------------------------------------- /src/store/auth/actions.js: -------------------------------------------------------------------------------- 1 | export const login = ({ commit, dispatch }, form) => { 2 | commit('LOGIN_OK', form) 3 | } 4 | -------------------------------------------------------------------------------- /src/store/auth/getters.js: -------------------------------------------------------------------------------- 1 | /* 2 | export const someGetter = (state) => { 3 | } 4 | */ 5 | -------------------------------------------------------------------------------- /src/store/auth/index.js: -------------------------------------------------------------------------------- 1 | import state from './state' 2 | import * as getters from './getters' 3 | import * as mutations from './mutations' 4 | import * as actions from './actions' 5 | 6 | export default { 7 | namespaced: true, 8 | state, 9 | getters, 10 | mutations, 11 | actions 12 | } 13 | -------------------------------------------------------------------------------- /src/store/auth/mutations.js: -------------------------------------------------------------------------------- 1 | export const LOGIN_OK = (state, user) => { 2 | state.User.firstName = user.data.first_name 3 | state.User.lastName = user.data.last_name 4 | state.User.ID = user.data.id 5 | state.User.userName = user.data.username 6 | state.User.email = user.data.email 7 | state.loggedIn = true 8 | } 9 | -------------------------------------------------------------------------------- /src/store/auth/state.js: -------------------------------------------------------------------------------- 1 | export default { 2 | User: {}, 3 | loggedIn: false 4 | } 5 | -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | import auth from './auth' 5 | 6 | Vue.use(Vuex) 7 | 8 | const store = new Vuex.Store({ 9 | modules: { 10 | auth 11 | } 12 | }) 13 | 14 | export default store 15 | --------------------------------------------------------------------------------