├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── README.md ├── build ├── build.js ├── dev-client.js ├── dev-server.js ├── utils.js ├── webpack.base.conf.js ├── webpack.dev.conf.js └── webpack.prod.conf.js ├── config ├── dev.env.js ├── index.js └── prod.env.js ├── package.json ├── src ├── App.vue ├── api │ ├── index.js │ └── resources.js ├── assets │ ├── font │ │ ├── css │ │ │ ├── font-awesome.css │ │ │ └── font-awesome.min.css │ │ └── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ ├── img │ │ ├── avatar.png │ │ ├── avatar04.png │ │ ├── avatar2.png │ │ ├── avatar3.png │ │ ├── avatar5.png │ │ ├── boxed-bg.jpg │ │ ├── boxed-bg.png │ │ ├── credit │ │ │ ├── american-express.png │ │ │ ├── cirrus.png │ │ │ ├── mastercard.png │ │ │ ├── mestro.png │ │ │ ├── paypal.png │ │ │ ├── paypal2.png │ │ │ └── visa.png │ │ ├── default-50x50.gif │ │ ├── icons.png │ │ ├── photo1.png │ │ ├── photo2.png │ │ ├── photo3.jpg │ │ ├── photo4.jpg │ │ ├── user1-128x128.jpg │ │ ├── user2-160x160.jpg │ │ ├── user3-128x128.jpg │ │ ├── user4-128x128.jpg │ │ ├── user5-128x128.jpg │ │ ├── user6-128x128.jpg │ │ ├── user7-128x128.jpg │ │ └── user8-128x128.jpg │ ├── logo.png │ └── scss │ │ ├── style.scss │ │ └── variables.scss ├── components │ ├── NavLeft.vue │ └── NavTop.vue ├── config.js ├── index.html ├── main.js ├── routers.js ├── services │ └── auth │ │ └── index.js ├── views │ ├── Main.vue │ ├── calendar │ │ └── Calendar.vue │ ├── charts │ │ ├── Chartjs.vue │ │ ├── Flot.vue │ │ ├── Inline.vue │ │ └── Morris.vue │ ├── dashboard │ │ ├── Index.vue │ │ └── Index2.vue │ ├── elements │ │ ├── Buttons.vue │ │ ├── General.vue │ │ ├── Icons.vue │ │ ├── Modals.vue │ │ ├── Sliders.vue │ │ └── Timeline.vue │ ├── examples │ │ ├── 404.vue │ │ ├── 500.vue │ │ ├── Blank.vue │ │ ├── Invoice.vue │ │ ├── Lockscreen.vue │ │ ├── Login.vue │ │ ├── Pace.vue │ │ ├── Profile.vue │ │ └── Register.vue │ ├── forms │ │ ├── Advance.vue │ │ ├── Editors.vue │ │ └── General.vue │ ├── layout │ │ ├── Boxed.vue │ │ ├── Collapsed.vue │ │ ├── Fixed.vue │ │ └── TopNav.vue │ ├── mailbox │ │ ├── Compose.vue │ │ ├── Inbox.vue │ │ └── Read.vue │ ├── tables │ │ ├── Data.vue │ │ └── Simple.vue │ └── widgets │ │ └── Widgets.vue └── vuex │ ├── actions.js │ ├── modules │ ├── loading.js │ ├── showmsg.js │ └── wechat.js │ ├── store.js │ └── types.js └── static └── .gitkeep /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"], 3 | "plugins": ["transform-runtime"], 4 | "comments": false 5 | } 6 | -------------------------------------------------------------------------------- /.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 | build/*.js 2 | config/*.js 3 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: 'babel-eslint', 4 | parserOptions: { 5 | sourceType: 'module' 6 | }, 7 | // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style 8 | extends: 'standard', 9 | // required to lint *.vue files 10 | plugins: [ 11 | 'html' 12 | ], 13 | // add your custom rules here 14 | 'rules': { 15 | // allow paren-less arrow functions 16 | 'arrow-parens': 0, 17 | // allow async-await 18 | 'generator-star-spacing': 0, 19 | // allow debugger during development 20 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue2-admin 2 | 3 | > Admin control Panel Theme That Is Based On [Vue2](https://github.com/vuejs/vue) & [AdminLTE](https://github.com/almasaeed2010/AdminLTE) 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | npm install 10 | 11 | # serve with hot reload at localhost:8080 12 | npm run dev 13 | 14 | # build for production with minification 15 | npm run build 16 | ``` 17 | 18 | For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). 19 | -------------------------------------------------------------------------------- /build/build.js: -------------------------------------------------------------------------------- 1 | // https://github.com/shelljs/shelljs 2 | require('shelljs/global') 3 | env.NODE_ENV = 'production' 4 | 5 | var path = require('path') 6 | var config = require('../config') 7 | var ora = require('ora') 8 | var webpack = require('webpack') 9 | var webpackConfig = require('./webpack.prod.conf') 10 | 11 | console.log( 12 | ' Tip:\n' + 13 | ' Built files are meant to be served over an HTTP server.\n' + 14 | ' Opening index.html over file:// won\'t work.\n' 15 | ) 16 | 17 | var spinner = ora('building for production...') 18 | spinner.start() 19 | 20 | var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) 21 | rm('-rf', assetsPath) 22 | mkdir('-p', assetsPath) 23 | cp('-R', 'static/*', assetsPath) 24 | 25 | webpack(webpackConfig, function (err, stats) { 26 | spinner.stop() 27 | if (err) throw err 28 | process.stdout.write(stats.toString({ 29 | colors: true, 30 | modules: false, 31 | children: false, 32 | chunks: false, 33 | chunkModules: false 34 | }) + '\n') 35 | }) 36 | -------------------------------------------------------------------------------- /build/dev-client.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | require('eventsource-polyfill') 3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true') 4 | 5 | hotClient.subscribe(function (event) { 6 | if (event.action === 'reload') { 7 | window.location.reload() 8 | } 9 | }) 10 | -------------------------------------------------------------------------------- /build/dev-server.js: -------------------------------------------------------------------------------- 1 | var config = require('../config') 2 | if (!process.env.NODE_ENV) process.env.NODE_ENV = config.dev.env 3 | var path = require('path') 4 | var express = require('express') 5 | var webpack = require('webpack') 6 | var opn = require('opn') 7 | var proxyMiddleware = require('http-proxy-middleware') 8 | var webpackConfig = require('./webpack.dev.conf') 9 | 10 | // default port where dev server listens for incoming traffic 11 | var port = process.env.PORT || config.dev.port 12 | // Define HTTP proxies to your custom API backend 13 | // https://github.com/chimurai/http-proxy-middleware 14 | var proxyTable = config.dev.proxyTable 15 | 16 | var app = express() 17 | var compiler = webpack(webpackConfig) 18 | 19 | var devMiddleware = require('webpack-dev-middleware')(compiler, { 20 | publicPath: webpackConfig.output.publicPath, 21 | stats: { 22 | colors: true, 23 | chunks: false 24 | } 25 | }) 26 | 27 | var hotMiddleware = require('webpack-hot-middleware')(compiler) 28 | // force page reload when html-webpack-plugin template changes 29 | compiler.plugin('compilation', function (compilation) { 30 | compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { 31 | hotMiddleware.publish({ action: 'reload' }) 32 | cb() 33 | }) 34 | }) 35 | 36 | // proxy api requests 37 | Object.keys(proxyTable).forEach(function (context) { 38 | var options = proxyTable[context] 39 | if (typeof options === 'string') { 40 | options = { target: options } 41 | } 42 | app.use(proxyMiddleware(context, options)) 43 | }) 44 | 45 | // handle fallback for HTML5 history API 46 | app.use(require('connect-history-api-fallback')()) 47 | 48 | // serve webpack bundle output 49 | app.use(devMiddleware) 50 | 51 | // enable hot-reload and state-preserving 52 | // compilation error display 53 | app.use(hotMiddleware) 54 | 55 | // serve pure static assets 56 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory) 57 | app.use(staticPath, express.static('./static')) 58 | 59 | module.exports = app.listen(port, function (err) { 60 | if (err) { 61 | console.log(err) 62 | return 63 | } 64 | var uri = 'http://localhost:' + port 65 | console.log('Listening at ' + uri + '\n') 66 | opn(uri) 67 | }) 68 | -------------------------------------------------------------------------------- /build/utils.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 4 | 5 | exports.assetsPath = function (_path) { 6 | var assetsSubDirectory = process.env.NODE_ENV === 'production' 7 | ? config.build.assetsSubDirectory 8 | : config.dev.assetsSubDirectory 9 | return path.posix.join(assetsSubDirectory, _path) 10 | } 11 | 12 | exports.cssLoaders = function (options) { 13 | options = options || {} 14 | // generate loader string to be used with extract text plugin 15 | function generateLoaders (loaders) { 16 | var sourceLoader = loaders.map(function (loader) { 17 | var extraParamChar 18 | if (/\?/.test(loader)) { 19 | loader = loader.replace(/\?/, '-loader?') 20 | extraParamChar = '&' 21 | } else { 22 | loader = loader + '-loader' 23 | extraParamChar = '?' 24 | } 25 | return loader + (options.sourceMap ? extraParamChar + 'sourceMap' : '') 26 | }).join('!') 27 | 28 | // Extract CSS when that option is specified 29 | // (which is the case during production build) 30 | if (options.extract) { 31 | return ExtractTextPlugin.extract('vue-style-loader', sourceLoader) 32 | } else { 33 | return ['vue-style-loader', sourceLoader].join('!') 34 | } 35 | } 36 | 37 | // http://vuejs.github.io/vue-loader/configurations/extract-css.html 38 | return { 39 | css: generateLoaders(['css']), 40 | postcss: generateLoaders(['css']), 41 | less: generateLoaders(['css', 'less']), 42 | sass: generateLoaders(['css', 'sass?indentedSyntax']), 43 | scss: generateLoaders(['css', 'sass']), 44 | stylus: generateLoaders(['css', 'stylus']), 45 | styl: generateLoaders(['css', 'stylus']) 46 | } 47 | } 48 | 49 | // Generate loaders for standalone style files (outside of .vue) 50 | exports.styleLoaders = function (options) { 51 | var output = [] 52 | var loaders = exports.cssLoaders(options) 53 | for (var extension in loaders) { 54 | var loader = loaders[extension] 55 | output.push({ 56 | test: new RegExp('\\.' + extension + '$'), 57 | loader: loader 58 | }) 59 | } 60 | return output 61 | } 62 | -------------------------------------------------------------------------------- /build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var utils = require('./utils') 4 | var projectRoot = path.resolve(__dirname, '../') 5 | var webpack = require('webpack') 6 | 7 | var env = process.env.NODE_ENV 8 | // check env & config/index.js to decide weither to enable CSS Sourcemaps for the 9 | // various preprocessor loaders added to vue-loader at the end of this file 10 | var cssSourceMapDev = (env === 'development' && config.dev.cssSourceMap) 11 | var cssSourceMapProd = (env === 'production' && config.build.productionSourceMap) 12 | var useCssSourceMap = cssSourceMapDev || cssSourceMapProd 13 | 14 | module.exports = { 15 | entry: { 16 | app: './src/main.js' 17 | }, 18 | output: { 19 | path: config.build.assetsRoot, 20 | publicPath: process.env.NODE_ENV === 'production' ? config.build.assetsPublicPath : config.dev.assetsPublicPath, 21 | filename: '[name].js' 22 | }, 23 | resolve: { 24 | extensions: ['', '.js', '.vue'], 25 | fallback: [path.join(__dirname, '../node_modules')], 26 | alias: { 27 | 'vue$': 'vue/dist/vue', 28 | 'src': path.resolve(__dirname, '../src'), 29 | 'assets': path.resolve(__dirname, '../src/assets'), 30 | 'components': path.resolve(__dirname, '../src/components') 31 | } 32 | }, 33 | resolveLoader: { 34 | fallback: [path.join(__dirname, '../node_modules')] 35 | }, 36 | module: { 37 | // preLoaders: [ 38 | // { 39 | // test: /\.vue$/, 40 | // loader: 'eslint', 41 | // include: projectRoot, 42 | // exclude: /node_modules/ 43 | // }, 44 | // { 45 | // test: /\.js$/, 46 | // loader: 'eslint', 47 | // include: projectRoot, 48 | // exclude: /node_modules/ 49 | // } 50 | // ], 51 | loaders: [ 52 | { 53 | test: /\.vue$/, 54 | loader: 'vue' 55 | }, 56 | { 57 | test: /\.js$/, 58 | loader: 'babel', 59 | include: projectRoot, 60 | exclude: /node_modules/ 61 | }, 62 | { 63 | test: /\.json$/, 64 | loader: 'json' 65 | }, 66 | { 67 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 68 | loader: 'url', 69 | query: { 70 | limit: 10000, 71 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 72 | } 73 | }, 74 | { 75 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 76 | loader: 'url', 77 | query: { 78 | limit: 10000, 79 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 80 | } 81 | } 82 | ] 83 | }, 84 | // eslint: { 85 | // formatter: require('eslint-friendly-formatter') 86 | // }, 87 | vue: { 88 | loaders: utils.cssLoaders({ sourceMap: useCssSourceMap }), 89 | postcss: [ 90 | require('autoprefixer')({ 91 | browsers: ['last 2 versions'] 92 | }) 93 | ] 94 | }, 95 | plugins: [ 96 | new webpack.ProvidePlugin({ 97 | $: "jquery", 98 | jQuery: "jquery" 99 | }) 100 | ], 101 | } 102 | -------------------------------------------------------------------------------- /build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | var config = require('../config') 2 | var webpack = require('webpack') 3 | var merge = require('webpack-merge') 4 | var utils = require('./utils') 5 | var baseWebpackConfig = require('./webpack.base.conf') 6 | var HtmlWebpackPlugin = require('html-webpack-plugin') 7 | 8 | // add hot-reload related code to entry chunks 9 | Object.keys(baseWebpackConfig.entry).forEach(function (name) { 10 | baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]) 11 | }) 12 | 13 | module.exports = merge(baseWebpackConfig, { 14 | module: { 15 | loaders: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap }) 16 | }, 17 | // eval-source-map is faster for development 18 | devtool: '#eval-source-map', 19 | plugins: [ 20 | new webpack.DefinePlugin({ 21 | 'process.env': config.dev.env 22 | }), 23 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage 24 | new webpack.optimize.OccurenceOrderPlugin(), 25 | new webpack.HotModuleReplacementPlugin(), 26 | new webpack.NoErrorsPlugin(), 27 | // https://github.com/ampedandwired/html-webpack-plugin 28 | new HtmlWebpackPlugin({ 29 | filename: 'index.html', 30 | template: 'src/index.html', 31 | inject: true 32 | }) 33 | ] 34 | }) 35 | -------------------------------------------------------------------------------- /build/webpack.prod.conf.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var config = require('../config') 3 | var utils = require('./utils') 4 | var webpack = require('webpack') 5 | var merge = require('webpack-merge') 6 | var baseWebpackConfig = require('./webpack.base.conf') 7 | var ExtractTextPlugin = require('extract-text-webpack-plugin') 8 | var HtmlWebpackPlugin = require('html-webpack-plugin') 9 | var env = config.build.env 10 | 11 | var webpackConfig = merge(baseWebpackConfig, { 12 | module: { 13 | loaders: utils.styleLoaders({ sourceMap: config.build.productionSourceMap, extract: true }) 14 | }, 15 | devtool: config.build.productionSourceMap ? '#source-map' : false, 16 | output: { 17 | path: config.build.assetsRoot, 18 | filename: utils.assetsPath('js/[name].[chunkhash].js'), 19 | chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 20 | }, 21 | vue: { 22 | loaders: utils.cssLoaders({ 23 | sourceMap: config.build.productionSourceMap, 24 | extract: true 25 | }) 26 | }, 27 | plugins: [ 28 | // http://vuejs.github.io/vue-loader/workflow/production.html 29 | new webpack.DefinePlugin({ 30 | 'process.env': env 31 | }), 32 | new webpack.optimize.UglifyJsPlugin({ 33 | compress: { 34 | warnings: false 35 | } 36 | }), 37 | new webpack.optimize.OccurenceOrderPlugin(), 38 | // extract css into its own file 39 | new ExtractTextPlugin(utils.assetsPath('css/[name].[contenthash].css')), 40 | // generate dist index.html with correct asset hash for caching. 41 | // you can customize output by editing /index.html 42 | // see https://github.com/ampedandwired/html-webpack-plugin 43 | new HtmlWebpackPlugin({ 44 | filename: config.build.index, 45 | template: 'src/index.html', 46 | inject: true, 47 | minify: { 48 | removeComments: true, 49 | collapseWhitespace: true, 50 | removeAttributeQuotes: true 51 | // more options: 52 | // https://github.com/kangax/html-minifier#options-quick-reference 53 | }, 54 | // necessary to consistently work with multiple chunks via CommonsChunkPlugin 55 | chunksSortMode: 'dependency' 56 | }), 57 | // split vendor js into its own file 58 | new webpack.optimize.CommonsChunkPlugin({ 59 | name: 'vendor', 60 | minChunks: function (module, count) { 61 | // any required modules inside node_modules are extracted to vendor 62 | return ( 63 | module.resource && 64 | /\.js$/.test(module.resource) && 65 | module.resource.indexOf( 66 | path.join(__dirname, '../node_modules') 67 | ) === 0 68 | ) 69 | } 70 | }), 71 | // extract webpack runtime and module manifest to its own file in order to 72 | // prevent vendor hash from being updated whenever app bundle is updated 73 | new webpack.optimize.CommonsChunkPlugin({ 74 | name: 'manifest', 75 | chunks: ['vendor'] 76 | }) 77 | ] 78 | }) 79 | 80 | if (config.build.productionGzip) { 81 | var CompressionWebpackPlugin = require('compression-webpack-plugin') 82 | 83 | webpackConfig.plugins.push( 84 | new CompressionWebpackPlugin({ 85 | asset: '[path].gz[query]', 86 | algorithm: 'gzip', 87 | test: new RegExp( 88 | '\\.(' + 89 | config.build.productionGzipExtensions.join('|') + 90 | ')$' 91 | ), 92 | threshold: 10240, 93 | minRatio: 0.8 94 | }) 95 | ) 96 | } 97 | 98 | module.exports = webpackConfig 99 | -------------------------------------------------------------------------------- /config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /config/index.js: -------------------------------------------------------------------------------- 1 | // see http://vuejs-templates.github.io/webpack for documentation. 2 | var path = require('path') 3 | 4 | module.exports = { 5 | build: { 6 | env: require('./prod.env'), 7 | index: path.resolve(__dirname, '../dist/index.html'), 8 | assetsRoot: path.resolve(__dirname, '../dist'), 9 | assetsSubDirectory: 'static', 10 | assetsPublicPath: '/', 11 | productionSourceMap: true, 12 | // Gzip off by default as many popular static hosts such as 13 | // Surge or Netlify already gzip all static assets for you. 14 | // Before setting to `true`, make sure to: 15 | // npm install --save-dev compression-webpack-plugin 16 | productionGzip: false, 17 | productionGzipExtensions: ['js', 'css'] 18 | }, 19 | dev: { 20 | env: require('./dev.env'), 21 | port: 9000, 22 | assetsSubDirectory: 'static', 23 | assetsPublicPath: '/', 24 | proxyTable: {}, 25 | // CSS Sourcemaps off by default because relative paths are "buggy" 26 | // with this option, according to the CSS-Loader README 27 | // (https://github.com/webpack/css-loader#sourcemaps) 28 | // In our experience, they generally work as expected, 29 | // just be aware of this issue when enabling this option. 30 | cssSourceMap: false 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue2-admin", 3 | "version": "1.0.0", 4 | "description": "Admin control Panel Theme That Is Based On Vue2 & AdminLTE", 5 | "author": "pigeon0312@gmail.com", 6 | "private": true, 7 | "scripts": { 8 | "dev": "node build/dev-server.js", 9 | "build": "node build/build.js", 10 | "lint": "eslint --ext .js,.vue src" 11 | }, 12 | "dependencies": { 13 | "admin-lte": "^2.3.6", 14 | "animate.css": "^3.5.2", 15 | "bootstrap": "^3.3.7", 16 | "jquery": "^3.1.1", 17 | "vue": "^2.0.1", 18 | "vue-resource": "^1.0.3", 19 | "vue-router": "^2.0.0", 20 | "vuex": "^2.0.0" 21 | }, 22 | "devDependencies": { 23 | "autoprefixer": "^6.4.0", 24 | "babel-core": "^6.0.0", 25 | "babel-eslint": "^7.0.0", 26 | "babel-loader": "^6.0.0", 27 | "babel-plugin-transform-runtime": "^6.0.0", 28 | "babel-preset-es2015": "^6.0.0", 29 | "babel-preset-stage-2": "^6.0.0", 30 | "babel-register": "^6.0.0", 31 | "connect-history-api-fallback": "^1.1.0", 32 | "css-loader": "^0.25.0", 33 | "eslint": "^3.7.1", 34 | "eslint-friendly-formatter": "^2.0.5", 35 | "eslint-loader": "^1.5.0", 36 | "eslint-plugin-html": "^1.3.0", 37 | "eslint-config-standard": "^6.1.0", 38 | "eslint-plugin-promise": "^2.0.1", 39 | "eslint-plugin-standard": "^2.0.1", 40 | "eventsource-polyfill": "^0.9.6", 41 | "express": "^4.13.3", 42 | "extract-text-webpack-plugin": "^1.0.1", 43 | "file-loader": "^0.9.0", 44 | "function-bind": "^1.0.2", 45 | "html-webpack-plugin": "^2.8.1", 46 | "http-proxy-middleware": "^0.17.2", 47 | "json-loader": "^0.5.4", 48 | "node-sass": "^3.10.1", 49 | "sass-loader": "^4.0.2", 50 | "opn": "^4.0.2", 51 | "ora": "^0.3.0", 52 | "shelljs": "^0.7.4", 53 | "url-loader": "^0.5.7", 54 | "vue-loader": "^9.4.0", 55 | "vue-style-loader": "^1.0.0", 56 | "webpack": "^1.13.2", 57 | "webpack-dev-middleware": "^1.8.3", 58 | "webpack-hot-middleware": "^2.12.2", 59 | "webpack-merge": "^0.14.1" 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 15 | 16 | 23 | -------------------------------------------------------------------------------- /src/api/index.js: -------------------------------------------------------------------------------- 1 | import {Login} from './resources' 2 | import {saveStorage} from '../services/auth' 3 | 4 | // get: {method: 'GET'}, 5 | // save: {method: 'POST'}, 6 | // query: {method: 'GET'}, 7 | // update: {method: 'PUT'}, 8 | // remove: {method: 'DELETE'}, 9 | // delete: {method: 'DELETE'} 10 | 11 | export default { 12 | login(context, user){ 13 | return Login.save(user).then(response => { 14 | if(!response.ok){ 15 | return context.$message({ message: "接口访问失败", type: 'error' }); 16 | } 17 | const data = response.data; 18 | if(data.success){ 19 | let token = data.data; 20 | saveStorage("token", token); 21 | context.$router.push({name: "staffs"}); 22 | } else { 23 | context.$message({ message: data.data.error, type: 'error' }); 24 | } 25 | }, response => { 26 | 27 | }) 28 | } 29 | } -------------------------------------------------------------------------------- /src/api/resources.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueResource from 'vue-resource' 3 | import {API_ROOT} from '../config' 4 | import {getStorage} from '../services/auth' 5 | 6 | /** 7 | * vue http config 8 | */ 9 | Vue.use(VueResource) 10 | Vue.http.options.root = API_ROOT 11 | // Vue.http.options.crossOrigin = true 12 | // Vue.http.options.credentials = true 13 | // Vue.http.options.emulateJSON = true; 14 | // Vue.http.options.emulateHTTP = true; 15 | // Vue.http.headers.common['Authorization'] = 'Bearer 65fb73a5388d95f9a786f361ff205dd6'; 16 | 17 | Vue.http.interceptors.push((request, next) => { 18 | // 这里对请求体进行处理 19 | // request.headers = request.headers || {} 20 | const token = getStorage('token') 21 | Vue.http.headers.common['Authorization'] = token ? 'Bearer ' + token.accessToken : '' 22 | next((response) => { 23 | // 这里可以对响应的结果进行处理 24 | let data = response.data || {} 25 | if (data.hasOwnProperty('success')) { 26 | // response.data = data.data; 27 | if (response.data.code === 401) { 28 | // alert(response.data.error) 29 | } 30 | } 31 | }) 32 | }) 33 | 34 | export const Login = Vue.resource(API_ROOT + 'token') 35 | export const Current = Vue.resource(API_ROOT + 'current') 36 | export const Marketer = Vue.resource(API_ROOT + 'marketer{?cityId}') 37 | export const MarketerLocus = Vue.resource(API_ROOT + 'marketer_locus{/id}') 38 | export const Faults = Vue.resource(API_ROOT + 'faults{?begin?status}') 39 | export const BikeList = Vue.resource(API_ROOT + 'bike/list{/status}') -------------------------------------------------------------------------------- /src/assets/font/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/font/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /src/assets/font/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/font/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /src/assets/font/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/font/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /src/assets/font/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/font/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /src/assets/font/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/font/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /src/assets/img/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/avatar.png -------------------------------------------------------------------------------- /src/assets/img/avatar04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/avatar04.png -------------------------------------------------------------------------------- /src/assets/img/avatar2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/avatar2.png -------------------------------------------------------------------------------- /src/assets/img/avatar3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/avatar3.png -------------------------------------------------------------------------------- /src/assets/img/avatar5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/avatar5.png -------------------------------------------------------------------------------- /src/assets/img/boxed-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/boxed-bg.jpg -------------------------------------------------------------------------------- /src/assets/img/boxed-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/boxed-bg.png -------------------------------------------------------------------------------- /src/assets/img/credit/american-express.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/credit/american-express.png -------------------------------------------------------------------------------- /src/assets/img/credit/cirrus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/credit/cirrus.png -------------------------------------------------------------------------------- /src/assets/img/credit/mastercard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/credit/mastercard.png -------------------------------------------------------------------------------- /src/assets/img/credit/mestro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/credit/mestro.png -------------------------------------------------------------------------------- /src/assets/img/credit/paypal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/credit/paypal.png -------------------------------------------------------------------------------- /src/assets/img/credit/paypal2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/credit/paypal2.png -------------------------------------------------------------------------------- /src/assets/img/credit/visa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/credit/visa.png -------------------------------------------------------------------------------- /src/assets/img/default-50x50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/default-50x50.gif -------------------------------------------------------------------------------- /src/assets/img/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/icons.png -------------------------------------------------------------------------------- /src/assets/img/photo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/photo1.png -------------------------------------------------------------------------------- /src/assets/img/photo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/photo2.png -------------------------------------------------------------------------------- /src/assets/img/photo3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/photo3.jpg -------------------------------------------------------------------------------- /src/assets/img/photo4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/photo4.jpg -------------------------------------------------------------------------------- /src/assets/img/user1-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/user1-128x128.jpg -------------------------------------------------------------------------------- /src/assets/img/user2-160x160.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/user2-160x160.jpg -------------------------------------------------------------------------------- /src/assets/img/user3-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/user3-128x128.jpg -------------------------------------------------------------------------------- /src/assets/img/user4-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/user4-128x128.jpg -------------------------------------------------------------------------------- /src/assets/img/user5-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/user5-128x128.jpg -------------------------------------------------------------------------------- /src/assets/img/user6-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/user6-128x128.jpg -------------------------------------------------------------------------------- /src/assets/img/user7-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/user7-128x128.jpg -------------------------------------------------------------------------------- /src/assets/img/user8-128x128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/img/user8-128x128.jpg -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/src/assets/logo.png -------------------------------------------------------------------------------- /src/assets/scss/variables.scss: -------------------------------------------------------------------------------- 1 | $blue: #20A0FF; 2 | $tiffany-blue: #81d8d0; -------------------------------------------------------------------------------- /src/components/NavLeft.vue: -------------------------------------------------------------------------------- 1 | 275 | 276 | 280 | -------------------------------------------------------------------------------- /src/components/NavTop.vue: -------------------------------------------------------------------------------- 1 | 263 | 264 | -------------------------------------------------------------------------------- /src/config.js: -------------------------------------------------------------------------------- 1 | export const API_ROOT = '/api/v1/' 2 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 管理系统 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import router from './routers'; 5 | 6 | import App from './App' 7 | 8 | 9 | const app = new Vue({ 10 | router, 11 | ...App, 12 | }); 13 | 14 | app.$mount('#app'); 15 | -------------------------------------------------------------------------------- /src/routers.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Router from 'vue-router'; 3 | 4 | // import {isLogin} from './services/auth' 5 | 6 | import Main from './views/Main' 7 | import Index from './views/dashboard/Index' 8 | import Index2 from './views/dashboard/Index2' 9 | 10 | import Topnav from './views/layout/TopNav' 11 | import Boxed from './views/layout/Boxed' 12 | import Fixed from './views/layout/Fixed' 13 | import Collapsed from './views/layout/Collapsed' 14 | 15 | import Widgets from './views/widgets/Widgets' 16 | 17 | import Chartjs from './views/charts/Chartjs' 18 | import Morris from './views/charts/Morris' 19 | import Flot from './views/charts/Flot' 20 | import Inline from './views/charts/Inline' 21 | 22 | import General from './views/elements/General' 23 | import Icons from './views/elements/Icons' 24 | import Buttons from './views/elements/Buttons' 25 | import Sliders from './views/elements/Sliders' 26 | import Timeline from './views/elements/Timeline' 27 | import Modals from './views/elements/Modals' 28 | 29 | import Generalform from './views/forms/General' 30 | import Advance from './views/forms/Advance' 31 | import Editors from './views/forms/Editors' 32 | 33 | import SimpleTable from './views/tables/Simple' 34 | import DataTable from './views/tables/Data' 35 | 36 | import Calendar from './views/calendar/Calendar' 37 | 38 | import Inbox from './views/mailbox/Inbox' 39 | import Compose from './views/mailbox/Compose' 40 | import ReadMail from './views/mailbox/Read' 41 | 42 | import Invoice from './views/examples/Invoice' 43 | import Profile from './views/examples/Profile' 44 | import Login from './views/examples/Login' 45 | import Register from './views/examples/Register' 46 | import Lockscreen from './views/examples/Lockscreen' 47 | import Notfound from './views/examples/404' 48 | import Servererror from './views/examples/500' 49 | import Blank from './views/examples/Blank' 50 | import Pace from './views/examples/Pace' 51 | 52 | 53 | Vue.use(Router); 54 | 55 | export default new Router({ 56 | mode: 'history', 57 | routes: [ 58 | // 注册路由 - 登录 59 | { path: '/', component: Main }, 60 | { 61 | path: '/main', 62 | name: 'main', 63 | component: Main, 64 | children: [ 65 | { path: '/dashboard/index', component: Index, name: 'index' }, 66 | { path: '/dashboard/index2', component: Index2, name: 'index2' }, 67 | { path: '/layout/boxed', component: Boxed, name: 'boxed' }, 68 | { path: '/layout/fixed', component: Fixed, name: 'fixed' }, 69 | { path: '/layout/collapsed', component: Collapsed, name: 'collapsed' }, 70 | { path: '/widgets', component: Widgets, name: 'widgets' }, 71 | { path: '/charts/chartjs', component: Chartjs, name: 'chartjs' }, 72 | { path: '/charts/morris', component: Morris, name: 'morris' }, 73 | { path: '/charts/flot', component: Flot, name: 'flot' }, 74 | { path: '/charts/inline', component: Inline, name: 'inline' }, 75 | { path: '/elements/general', component: General, name: 'general' }, 76 | { path: '/elements/icons', component: Icons, name: 'icons' }, 77 | { path: '/elements/buttons', component: Buttons, name: 'buttons' }, 78 | { path: '/elements/sliders', component: Sliders, name: 'sliders' }, 79 | { path: '/elements/timeline', component: Timeline, name: 'timeline' }, 80 | { path: '/elements/modals', component: Modals, name: 'modals' }, 81 | { path: '/forms/general', component: Generalform, name: 'generalfrom' }, 82 | { path: '/forms/advance', component: Advance, name: 'advance' }, 83 | { path: '/forms/editors', component: Editors, name: 'editors' }, 84 | { path: '/tables/simple', component: SimpleTable, name: 'simpleTable' }, 85 | { path: '/tables/data', component: DataTable, name: 'dataTable' }, 86 | { path: '/calendar', component: Calendar, name: 'calendar' }, 87 | { path: '/mailbox/inbox', component: Inbox, name: 'inbox' }, 88 | { path: '/mailbox/compose', component: Compose, name: 'compose' }, 89 | { path: '/mailbox/read', component: ReadMail, name: 'readMail' }, 90 | { path: '/examples/invoice', component: Invoice, name: 'invoice' }, 91 | { path: '/examples/profile', component: Profile, name: 'profile' }, 92 | { path: '/examples/404', component: Notfound, name: '404' }, 93 | { path: '/examples/500', component: Servererror, name: '500' }, 94 | { path: '/examples/blank', component: Blank, name: 'blank' }, 95 | { path: '/examples/pace', component: Pace, name: 'pace' } 96 | ], 97 | beforeEnter: (to, from, next) => { 98 | // isLogin() ? next() : next('/'); 99 | next() 100 | } 101 | }, 102 | { path: '/layout/topnav', component: Topnav, name: 'topnav' }, 103 | { path: '/examples/login', component: Login, name: 'login' }, 104 | { path: '/examples/register', component: Register, name: 'register' }, 105 | { path: '/examples/lockscreen', component: Lockscreen, name: 'lockscreen' }, 106 | { path: '*', redirect: '/' }, 107 | ], 108 | }); -------------------------------------------------------------------------------- /src/services/auth/index.js: -------------------------------------------------------------------------------- 1 | 2 | export function saveStorage(key, value) { 3 | let v = JSON.stringify(value); 4 | sessionStorage[key] = v; 5 | } 6 | 7 | export function getStorage(key) { 8 | const v = sessionStorage[key]; 9 | return v ? JSON.parse(v) : null; 10 | } 11 | 12 | export function removeStorage(key) { 13 | sessionStorage.removeItem(key); 14 | } 15 | 16 | export function signOut() { 17 | sessionStorage.removeItem('token'); 18 | } 19 | 20 | export function isLogin() { 21 | return !!sessionStorage.getItem('token'); 22 | } -------------------------------------------------------------------------------- /src/views/Main.vue: -------------------------------------------------------------------------------- 1 | 31 | 32 | 46 | 47 | -------------------------------------------------------------------------------- /src/views/calendar/Calendar.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/charts/Chartjs.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/charts/Flot.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/charts/Inline.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/charts/Morris.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/elements/Modals.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/elements/Sliders.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/elements/Timeline.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/examples/404.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/examples/500.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/examples/Blank.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/examples/Invoice.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/examples/Lockscreen.vue: -------------------------------------------------------------------------------- 1 | 43 | 44 | -------------------------------------------------------------------------------- /src/views/examples/Login.vue: -------------------------------------------------------------------------------- 1 | 51 | 52 | -------------------------------------------------------------------------------- /src/views/examples/Pace.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | -------------------------------------------------------------------------------- /src/views/examples/Register.vue: -------------------------------------------------------------------------------- 1 | 55 | 56 | -------------------------------------------------------------------------------- /src/views/forms/Advance.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/forms/Editors.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/forms/General.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/layout/Boxed.vue: -------------------------------------------------------------------------------- 1 | 35 | 36 | -------------------------------------------------------------------------------- /src/views/layout/Collapsed.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | -------------------------------------------------------------------------------- /src/views/layout/Fixed.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | -------------------------------------------------------------------------------- /src/views/layout/TopNav.vue: -------------------------------------------------------------------------------- 1 | 247 | 248 | -------------------------------------------------------------------------------- /src/views/mailbox/Compose.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/mailbox/Inbox.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/mailbox/Read.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/views/tables/Simple.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/vuex/actions.js: -------------------------------------------------------------------------------- 1 | import api from '../api' 2 | import * as types from './types' 3 | 4 | export const showMsg = ({dispatch}, content, type='error') => { 5 | dispatch(types.SHOW_MSG, {content:content, type:type}) 6 | } 7 | 8 | export const hideMsg = ({dispatch}) => { 9 | dispatch(types.HIDE_MSG) 10 | } 11 | 12 | // for test 13 | export const welcome = (store) => { 14 | showMsg(store, 'welcome back!', 'success') 15 | } -------------------------------------------------------------------------------- /src/vuex/modules/loading.js: -------------------------------------------------------------------------------- 1 | import { 2 | UPDATE_LOADING, 3 | UPDATE_DIRECTION 4 | } from '../types' 5 | 6 | const state = { 7 | isLoading: false, 8 | direction: 'forward' 9 | } 10 | 11 | const mutations = { 12 | [UPDATE_LOADING](state, status) { 13 | state.isLoading = status 14 | }, 15 | [UPDATE_DIRECTION](state, direction) { 16 | state.direction = direction 17 | } 18 | } 19 | 20 | export default { 21 | state, 22 | mutations 23 | } -------------------------------------------------------------------------------- /src/vuex/modules/showmsg.js: -------------------------------------------------------------------------------- 1 | import { 2 | SHOW_MSG, 3 | HIDE_MSG 4 | } from '../types' 5 | 6 | const state = { 7 | message:{ 8 | type: '', 9 | content: '', 10 | title: '' 11 | } 12 | } 13 | 14 | const mutations = { 15 | [SHOW_MSG](state , action){ 16 | state.message = {...action} 17 | }, 18 | [HIDE_MSG](state, action){ 19 | state.message = { 20 | type: '', 21 | content: '', 22 | title: '' 23 | } 24 | } 25 | } 26 | 27 | export default { 28 | state, 29 | mutations 30 | } -------------------------------------------------------------------------------- /src/vuex/modules/wechat.js: -------------------------------------------------------------------------------- 1 | import { 2 | GET_AUTHORIZE 3 | } from '../types' 4 | 5 | const state = { 6 | authorize: null 7 | } 8 | 9 | const mutations = { 10 | [GET_AUTHORIZE](state, action){ 11 | state.authorize = action.authorize 12 | } 13 | } 14 | 15 | export default { 16 | state, 17 | mutations 18 | } -------------------------------------------------------------------------------- /src/vuex/store.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | import loading from './modules/loading' 5 | import showmsg from './modules/showmsg' 6 | 7 | const debug = process.env.NODE_ENV !== 'production' 8 | Vue.use(Vuex) 9 | Vue.config.debug = debug 10 | Vue.config.warnExpressionErrors = false 11 | 12 | export default new Vuex.Store({ 13 | modules: { 14 | loading, 15 | showmsg 16 | }, 17 | strict: debug, 18 | }) 19 | -------------------------------------------------------------------------------- /src/vuex/types.js: -------------------------------------------------------------------------------- 1 | export const UPDATE_LOADING = 'UPDATE_LOADING' 2 | export const UPDATE_DIRECTION = 'UPDATE_DIRECTION' 3 | 4 | export const GET_AUTHORIZE = 'GET_AUTHORIZE' 5 | 6 | export const SHOW_MSG = 'SHOW_MSG' 7 | export const HIDE_MSG = 'HIDE_MSG' -------------------------------------------------------------------------------- /static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gezii/vue2-AdminLTE/bfe21afc33c8eb51220473af97ff644656ddf5be/static/.gitkeep --------------------------------------------------------------------------------