@ -0,0 +1,12 @@
|
||||
{
|
||||
"presets": [
|
||||
["env", {
|
||||
"modules": false,
|
||||
"targets": {
|
||||
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
|
||||
}
|
||||
}],
|
||||
"stage-2"
|
||||
],
|
||||
"plugins": ["transform-vue-jsx", "transform-runtime"]
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
@ -0,0 +1,14 @@
|
||||
.DS_Store
|
||||
node_modules/
|
||||
/dist/
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
@ -0,0 +1,10 @@
|
||||
// https://github.com/michael-ciniawsky/postcss-load-config
|
||||
|
||||
module.exports = {
|
||||
"plugins": {
|
||||
"postcss-import": {},
|
||||
"postcss-url": {},
|
||||
// to edit target browsers: use "browserslist" field in package.json
|
||||
"autoprefixer": {}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<video controls
|
||||
src="D://2b5c2178-cb21-4f03-8aa0-bb5307e45e95.mkv"></video>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 lidonghui
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@ -0,0 +1,41 @@
|
||||
'use strict'
|
||||
require('./check-versions')()
|
||||
|
||||
process.env.NODE_ENV = 'production'
|
||||
|
||||
const ora = require('ora')
|
||||
const rm = require('rimraf')
|
||||
const path = require('path')
|
||||
const chalk = require('chalk')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const webpackConfig = require('./webpack.prod.conf')
|
||||
|
||||
const spinner = ora('building for production...')
|
||||
spinner.start()
|
||||
|
||||
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
|
||||
if (err) throw err
|
||||
webpack(webpackConfig, (err, stats) => {
|
||||
spinner.stop()
|
||||
if (err) throw err
|
||||
process.stdout.write(stats.toString({
|
||||
colors: true,
|
||||
modules: false,
|
||||
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
|
||||
chunks: false,
|
||||
chunkModules: false
|
||||
}) + '\n\n')
|
||||
|
||||
if (stats.hasErrors()) {
|
||||
console.log(chalk.red(' Build failed with errors.\n'))
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
console.log(chalk.cyan(' Build complete.\n'))
|
||||
console.log(chalk.yellow(
|
||||
' Tip: built files are meant to be served over an HTTP server.\n' +
|
||||
' Opening index.html over file:// won\'t work.\n'
|
||||
))
|
||||
})
|
||||
})
|
||||
@ -0,0 +1,54 @@
|
||||
'use strict'
|
||||
const chalk = require('chalk')
|
||||
const semver = require('semver')
|
||||
const packageConfig = require('../package.json')
|
||||
const shell = require('shelljs')
|
||||
|
||||
function exec (cmd) {
|
||||
return require('child_process').execSync(cmd).toString().trim()
|
||||
}
|
||||
|
||||
const versionRequirements = [
|
||||
{
|
||||
name: 'node',
|
||||
currentVersion: semver.clean(process.version),
|
||||
versionRequirement: packageConfig.engines.node
|
||||
}
|
||||
]
|
||||
|
||||
if (shell.which('npm')) {
|
||||
versionRequirements.push({
|
||||
name: 'npm',
|
||||
currentVersion: exec('npm --version'),
|
||||
versionRequirement: packageConfig.engines.npm
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = function () {
|
||||
const warnings = []
|
||||
|
||||
for (let i = 0; i < versionRequirements.length; i++) {
|
||||
const mod = versionRequirements[i]
|
||||
|
||||
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
|
||||
warnings.push(mod.name + ': ' +
|
||||
chalk.red(mod.currentVersion) + ' should be ' +
|
||||
chalk.green(mod.versionRequirement)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (warnings.length) {
|
||||
console.log('')
|
||||
console.log(chalk.yellow('To use this template, you must update following to modules:'))
|
||||
console.log()
|
||||
|
||||
for (let i = 0; i < warnings.length; i++) {
|
||||
const warning = warnings[i]
|
||||
console.log(' ' + warning)
|
||||
}
|
||||
|
||||
console.log()
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const config = require('../config')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const packageConfig = require('../package.json')
|
||||
|
||||
exports.assetsPath = function(_path) {
|
||||
const assetsSubDirectory = process.env.NODE_ENV === 'production' ?
|
||||
config.build.assetsSubDirectory :
|
||||
config.dev.assetsSubDirectory
|
||||
|
||||
return path.posix.join(assetsSubDirectory, _path)
|
||||
}
|
||||
|
||||
exports.cssLoaders = function(options) {
|
||||
options = options || {}
|
||||
|
||||
const cssLoader = {
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
sourceMap: options.sourceMap
|
||||
}
|
||||
}
|
||||
|
||||
const postcssLoader = {
|
||||
loader: 'postcss-loader',
|
||||
options: {
|
||||
sourceMap: options.sourceMap
|
||||
}
|
||||
}
|
||||
|
||||
// generate loader string to be used with extract text plugin
|
||||
function generateLoaders(loader, loaderOptions) {
|
||||
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
|
||||
|
||||
if (loader) {
|
||||
loaders.push({
|
||||
loader: loader + '-loader',
|
||||
options: Object.assign({}, loaderOptions, {
|
||||
sourceMap: options.sourceMap
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// Extract CSS when that option is specified
|
||||
// (which is the case during production build)
|
||||
if (options.extract) {
|
||||
return ExtractTextPlugin.extract({
|
||||
use: loaders,
|
||||
publicPath: '../../',
|
||||
fallback: 'vue-style-loader'
|
||||
})
|
||||
} else {
|
||||
return ['vue-style-loader'].concat(loaders)
|
||||
}
|
||||
}
|
||||
|
||||
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
|
||||
return {
|
||||
css: generateLoaders(),
|
||||
postcss: generateLoaders(),
|
||||
less: generateLoaders('less'),
|
||||
sass: generateLoaders('sass', { indentedSyntax: true }),
|
||||
scss: generateLoaders('sass'),
|
||||
stylus: generateLoaders('stylus'),
|
||||
styl: generateLoaders('stylus')
|
||||
}
|
||||
}
|
||||
|
||||
// Generate loaders for standalone style files (outside of .vue)
|
||||
exports.styleLoaders = function(options) {
|
||||
const output = []
|
||||
const loaders = exports.cssLoaders(options)
|
||||
|
||||
for (const extension in loaders) {
|
||||
const loader = loaders[extension]
|
||||
output.push({
|
||||
test: new RegExp('\\.' + extension + '$'),
|
||||
use: loader
|
||||
})
|
||||
}
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
exports.createNotifierCallback = () => {
|
||||
const notifier = require('node-notifier')
|
||||
|
||||
return (severity, errors) => {
|
||||
if (severity !== 'error') return
|
||||
|
||||
const error = errors[0]
|
||||
const filename = error.file && error.file.split('!').pop()
|
||||
|
||||
notifier.notify({
|
||||
title: packageConfig.name,
|
||||
message: severity + ': ' + error.name,
|
||||
subtitle: filename || '',
|
||||
icon: path.join(__dirname, 'logo.png')
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
'use strict'
|
||||
const utils = require('./utils')
|
||||
const config = require('../config')
|
||||
const isProduction = process.env.NODE_ENV === 'production'
|
||||
const sourceMapEnabled = isProduction
|
||||
? config.build.productionSourceMap
|
||||
: config.dev.cssSourceMap
|
||||
|
||||
module.exports = {
|
||||
loaders: utils.cssLoaders({
|
||||
sourceMap: sourceMapEnabled,
|
||||
extract: isProduction
|
||||
}),
|
||||
cssSourceMap: sourceMapEnabled,
|
||||
cacheBusting: config.dev.cacheBusting,
|
||||
transformToRequire: {
|
||||
video: ['src', 'poster'],
|
||||
source: 'src',
|
||||
img: 'src',
|
||||
image: 'xlink:href'
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const utils = require('./utils')
|
||||
const config = require('../config')
|
||||
const vueLoaderConfig = require('./vue-loader.conf')
|
||||
|
||||
function resolve (dir) {
|
||||
return path.join(__dirname, '..', dir)
|
||||
}
|
||||
|
||||
|
||||
|
||||
module.exports = {
|
||||
context: path.resolve(__dirname, '../'),
|
||||
entry: {
|
||||
app: './src/main.js'
|
||||
},
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: '[name].js',
|
||||
publicPath: process.env.NODE_ENV === 'production'
|
||||
? config.build.assetsPublicPath
|
||||
: config.dev.assetsPublicPath
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.js', '.vue', '.json'],
|
||||
alias: {
|
||||
'vue$': 'vue/dist/vue.esm.js',
|
||||
'@': resolve('src'),
|
||||
}
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.vue$/,
|
||||
loader: 'vue-loader',
|
||||
options: vueLoaderConfig
|
||||
},
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader',
|
||||
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
|
||||
},
|
||||
{
|
||||
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('img/[name].[hash:7].[ext]')
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('media/[name].[hash:7].[ext]')
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
|
||||
loader: 'url-loader',
|
||||
options: {
|
||||
limit: 10000,
|
||||
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
node: {
|
||||
// prevent webpack from injecting useless setImmediate polyfill because Vue
|
||||
// source contains it (although only uses it if it's native).
|
||||
setImmediate: false,
|
||||
// prevent webpack from injecting mocks to Node native modules
|
||||
// that does not make sense for the client
|
||||
dgram: 'empty',
|
||||
fs: 'empty',
|
||||
net: 'empty',
|
||||
tls: 'empty',
|
||||
child_process: 'empty'
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,91 @@
|
||||
'use strict'
|
||||
const utils = require('./utils')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const merge = require('webpack-merge')
|
||||
const path = require('path')
|
||||
const baseWebpackConfig = require('./webpack.base.conf')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
|
||||
const portfinder = require('portfinder')
|
||||
|
||||
const HOST = process.env.HOST
|
||||
const PORT = process.env.PORT && Number(process.env.PORT)
|
||||
|
||||
const devWebpackConfig = merge(baseWebpackConfig, {
|
||||
module: {
|
||||
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
|
||||
},
|
||||
// cheap-module-eval-source-map is faster for development
|
||||
devtool: config.dev.devtool,
|
||||
|
||||
// these devServer options should be customized in /config/index.js
|
||||
devServer: {
|
||||
clientLogLevel: 'warning',
|
||||
historyApiFallback: {
|
||||
rewrites: [
|
||||
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
|
||||
],
|
||||
},
|
||||
hot: true,
|
||||
contentBase: false, // since we use CopyWebpackPlugin.
|
||||
compress: true,
|
||||
host: HOST || config.dev.host,
|
||||
port: PORT || config.dev.port,
|
||||
open: config.dev.autoOpenBrowser,
|
||||
overlay: config.dev.errorOverlay ? { warnings: false, errors: true } : false,
|
||||
publicPath: config.dev.assetsPublicPath,
|
||||
proxy: config.dev.proxyTable,
|
||||
quiet: true, // necessary for FriendlyErrorsPlugin
|
||||
watchOptions: {
|
||||
poll: config.dev.poll,
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': require('../config/dev.env')
|
||||
}),
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
|
||||
new webpack.NoEmitOnErrorsPlugin(),
|
||||
// https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: 'index.html',
|
||||
inject: true,
|
||||
favicon: './favicon.ico'
|
||||
}),
|
||||
// copy custom static assets
|
||||
new CopyWebpackPlugin([{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.dev.assetsSubDirectory,
|
||||
ignore: ['.*']
|
||||
}])
|
||||
]
|
||||
})
|
||||
|
||||
module.exports = new Promise((resolve, reject) => {
|
||||
portfinder.basePort = process.env.PORT || config.dev.port
|
||||
portfinder.getPort((err, port) => {
|
||||
if (err) {
|
||||
reject(err)
|
||||
} else {
|
||||
// publish the new Port, necessary for e2e tests
|
||||
process.env.PORT = port
|
||||
// add port to devServer config
|
||||
devWebpackConfig.devServer.port = port
|
||||
|
||||
// Add FriendlyErrorsPlugin
|
||||
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
|
||||
compilationSuccessInfo: {
|
||||
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
|
||||
},
|
||||
onErrors: config.dev.notifyOnErrors ?
|
||||
utils.createNotifierCallback() : undefined
|
||||
}))
|
||||
|
||||
resolve(devWebpackConfig)
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -0,0 +1,145 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const utils = require('./utils')
|
||||
const webpack = require('webpack')
|
||||
const config = require('../config')
|
||||
const merge = require('webpack-merge')
|
||||
const baseWebpackConfig = require('./webpack.base.conf')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||
|
||||
const env = require('../config/prod.env')
|
||||
|
||||
const webpackConfig = merge(baseWebpackConfig, {
|
||||
module: {
|
||||
rules: utils.styleLoaders({
|
||||
sourceMap: config.build.productionSourceMap,
|
||||
extract: true,
|
||||
usePostCSS: true
|
||||
})
|
||||
},
|
||||
devtool: config.build.productionSourceMap ? config.build.devtool : false,
|
||||
output: {
|
||||
path: config.build.assetsRoot,
|
||||
filename: utils.assetsPath('js/[name].[chunkhash].js'),
|
||||
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
|
||||
},
|
||||
plugins: [
|
||||
// http://vuejs.github.io/vue-loader/en/workflow/production.html
|
||||
new webpack.DefinePlugin({
|
||||
'process.env': env
|
||||
}),
|
||||
new UglifyJsPlugin({
|
||||
uglifyOptions: {
|
||||
compress: {
|
||||
warnings: false
|
||||
}
|
||||
},
|
||||
sourceMap: config.build.productionSourceMap,
|
||||
parallel: true
|
||||
}),
|
||||
// extract css into its own file
|
||||
new ExtractTextPlugin({
|
||||
filename: utils.assetsPath('css/[name].[contenthash].css'),
|
||||
// Setting the following option to `false` will not extract CSS from codesplit chunks.
|
||||
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
|
||||
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
|
||||
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
|
||||
allChunks: true,
|
||||
}),
|
||||
// Compress extracted CSS. We are using this plugin so that possible
|
||||
// duplicated CSS from different components can be deduped.
|
||||
new OptimizeCSSPlugin({
|
||||
cssProcessorOptions: config.build.productionSourceMap
|
||||
? { safe: true, map: { inline: false } }
|
||||
: { safe: true }
|
||||
}),
|
||||
// generate dist index.html with correct asset hash for caching.
|
||||
// you can customize output by editing /index.html
|
||||
// see https://github.com/ampedandwired/html-webpack-plugin
|
||||
new HtmlWebpackPlugin({
|
||||
filename: config.build.index,
|
||||
template: 'index.html',
|
||||
inject: true,
|
||||
minify: {
|
||||
removeComments: true,
|
||||
collapseWhitespace: true,
|
||||
removeAttributeQuotes: true
|
||||
// more options:
|
||||
// https://github.com/kangax/html-minifier#options-quick-reference
|
||||
},
|
||||
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
|
||||
chunksSortMode: 'dependency'
|
||||
}),
|
||||
// keep module.id stable when vendor modules does not change
|
||||
new webpack.HashedModuleIdsPlugin(),
|
||||
// enable scope hoisting
|
||||
new webpack.optimize.ModuleConcatenationPlugin(),
|
||||
// split vendor js into its own file
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'vendor',
|
||||
minChunks (module) {
|
||||
// any required modules inside node_modules are extracted to vendor
|
||||
return (
|
||||
module.resource &&
|
||||
/\.js$/.test(module.resource) &&
|
||||
module.resource.indexOf(
|
||||
path.join(__dirname, '../node_modules')
|
||||
) === 0
|
||||
)
|
||||
}
|
||||
}),
|
||||
// extract webpack runtime and module manifest to its own file in order to
|
||||
// prevent vendor hash from being updated whenever app bundle is updated
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'manifest',
|
||||
minChunks: Infinity
|
||||
}),
|
||||
// This instance extracts shared chunks from code splitted chunks and bundles them
|
||||
// in a separate chunk, similar to the vendor chunk
|
||||
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
|
||||
new webpack.optimize.CommonsChunkPlugin({
|
||||
name: 'app',
|
||||
async: 'vendor-async',
|
||||
children: true,
|
||||
minChunks: 3
|
||||
}),
|
||||
|
||||
// copy custom static assets
|
||||
new CopyWebpackPlugin([
|
||||
{
|
||||
from: path.resolve(__dirname, '../static'),
|
||||
to: config.build.assetsSubDirectory,
|
||||
ignore: ['.*']
|
||||
}
|
||||
])
|
||||
]
|
||||
})
|
||||
|
||||
if (config.build.productionGzip) {
|
||||
const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
||||
|
||||
webpackConfig.plugins.push(
|
||||
new CompressionWebpackPlugin({
|
||||
asset: '[path].gz[query]',
|
||||
algorithm: 'gzip',
|
||||
test: new RegExp(
|
||||
'\\.(' +
|
||||
config.build.productionGzipExtensions.join('|') +
|
||||
')$'
|
||||
),
|
||||
threshold: 10240,
|
||||
minRatio: 0.8
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
if (config.build.bundleAnalyzerReport) {
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
||||
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
|
||||
}
|
||||
|
||||
module.exports = webpackConfig
|
||||
@ -0,0 +1,7 @@
|
||||
'use strict'
|
||||
const merge = require('webpack-merge')
|
||||
const prodEnv = require('./prod.env')
|
||||
|
||||
module.exports = merge(prodEnv, {
|
||||
NODE_ENV: '"development"'
|
||||
})
|
||||
@ -0,0 +1,4 @@
|
||||
'use strict'
|
||||
module.exports = {
|
||||
NODE_ENV: '"production"'
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
{
|
||||
"editor.tabSize": 2,
|
||||
"files.associations": {
|
||||
"*.vue": "vue"
|
||||
},
|
||||
"eslint.autoFixOnSave": true,
|
||||
"eslint.options": {
|
||||
"extensions": [
|
||||
".js",
|
||||
".vue"
|
||||
]
|
||||
},
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"vue",
|
||||
"vue-html"
|
||||
],
|
||||
"search.exclude": {
|
||||
"**/node_modules": true,
|
||||
"**/bower_components": true,
|
||||
"**/dist": true
|
||||
},
|
||||
"emmet.syntaxProfiles": {
|
||||
"javascript": "jsx",
|
||||
"vue": "html",
|
||||
"vue-html": "html"
|
||||
},
|
||||
"git.confirmSync": false,
|
||||
"window.zoomLevel": 0,
|
||||
"vsicons.projectDetection.autoReload": true,
|
||||
"typescript.check.tscVersion": false,
|
||||
"editor.renderWhitespace": "boundary",
|
||||
"editor.cursorBlinking": "smooth",
|
||||
"workbench.colorTheme": "Solarized Light",
|
||||
"workbench.iconTheme": "vscode-great-icons",
|
||||
"editor.minimap.enabled": true,
|
||||
"editor.minimap.renderCharacters": false,
|
||||
"tslint.autoFixOnSave": true,
|
||||
"editor.fontFamily": "'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
|
||||
"beautify.tabSize": 2,
|
||||
"window.title": "${dirty}${activeEditorMedium}${separator}${rootName}",
|
||||
"typescript.extension.sortImports.maxNamedImportsInSingleLine": 5,
|
||||
"typescript.extension.sortImports.omitSemicolon": true,
|
||||
"editor.codeLens": true,
|
||||
"editor.snippetSuggestions": "top",
|
||||
"react-native-storybooks.port": 6006
|
||||
}
|
||||
|
After Width: | Height: | Size: 946 B |
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<!-- 页面增加icon图标 -->
|
||||
<link rel="shortcut icon" type="image/x-icon" href="./favicon.ico" rel="external nofollow" />
|
||||
<title>后端管理平台</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- built files will be auto injected -->
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -0,0 +1,69 @@
|
||||
{
|
||||
"name": "vue-ele-project",
|
||||
"version": "1.0.0",
|
||||
"description": "vue-ele-project",
|
||||
"author": "lidonghui",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
|
||||
"serve": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
|
||||
"start": "npm run dev",
|
||||
"build": "node build/build.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"echarts": "^4.2.0-rc.2",
|
||||
"element-ui": "^2.3.2",
|
||||
"http-proxy-middleware": "^0.18.0",
|
||||
"js-md5": "^0.7.3",
|
||||
"vue": "^2.5.2",
|
||||
"vue-router": "^3.0.1",
|
||||
"vuex": "^3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^7.1.2",
|
||||
"axios": "^0.18.0",
|
||||
"babel-core": "^6.22.1",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
||||
"babel-loader": "^7.1.1",
|
||||
"babel-plugin-syntax-jsx": "^6.18.0",
|
||||
"babel-plugin-transform-runtime": "^6.22.0",
|
||||
"babel-plugin-transform-vue-jsx": "^3.5.0",
|
||||
"babel-preset-env": "^1.3.2",
|
||||
"babel-preset-stage-2": "^6.22.0",
|
||||
"chalk": "^2.0.1",
|
||||
"copy-webpack-plugin": "^4.0.1",
|
||||
"css-loader": "^0.28.0",
|
||||
"extract-text-webpack-plugin": "^3.0.0",
|
||||
"file-loader": "^1.1.4",
|
||||
"friendly-errors-webpack-plugin": "^1.6.1",
|
||||
"html-webpack-plugin": "^2.30.1",
|
||||
"node-notifier": "^5.1.2",
|
||||
"optimize-css-assets-webpack-plugin": "^3.2.0",
|
||||
"ora": "^1.2.0",
|
||||
"portfinder": "^1.0.13",
|
||||
"postcss-import": "^11.0.0",
|
||||
"postcss-loader": "^2.0.8",
|
||||
"postcss-url": "^7.2.1",
|
||||
"rimraf": "^2.6.0",
|
||||
"semver": "^5.3.0",
|
||||
"shelljs": "^0.7.6",
|
||||
"uglifyjs-webpack-plugin": "^1.1.1",
|
||||
"url-loader": "^0.5.8",
|
||||
"vue-loader": "^13.3.0",
|
||||
"vue-style-loader": "^3.0.1",
|
||||
"vue-template-compiler": "^2.5.2",
|
||||
"webpack": "^3.6.0",
|
||||
"webpack-bundle-analyzer": "^2.9.0",
|
||||
"webpack-dev-server": "^2.9.1",
|
||||
"webpack-merge": "^4.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.0.0",
|
||||
"npm": ">= 3.0.0"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not ie <= 8"
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html><html><head><meta charset=utf-8>
|
||||
<meta name=viewport content="width=device-width,initial-scale=1">
|
||||
<link rel="shortcut icon" type=image/x-icon href=./favicon.ico rel="external nofollow">
|
||||
<title>后端管理平台</title><link href=./static/css/app.f7de60d9ec9c07c112d0b94c59208a0e.css rel=stylesheet>
|
||||
</head>
|
||||
<body>
|
||||
<div id=app></div>
|
||||
<script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script>
|
||||
<script type=text/javascript src=./static/js/vendor.e37fbe972401a2962be8.js></script>
|
||||
<script type=text/javascript src=./static/js/app.656e0752769862c0c376.js></script>
|
||||
|
||||
</body></html>
|
||||
|
After Width: | Height: | Size: 79 KiB |
@ -0,0 +1,2 @@
|
||||
!function(r){var n=window.webpackJsonp;window.webpackJsonp=function(e,u,c){for(var f,i,p,a=0,l=[];a<e.length;a++)i=e[a],o[i]&&l.push(o[i][0]),o[i]=0;for(f in u)Object.prototype.hasOwnProperty.call(u,f)&&(r[f]=u[f]);for(n&&n(e,u,c);l.length;)l.shift()();if(c)for(a=0;a<c.length;a++)p=t(t.s=c[a]);return p};var e={},o={2:0};function t(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=r,t.c=e,t.d=function(r,n,e){t.o(r,n)||Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:e})},t.n=function(r){var n=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(n,"a",n),n},t.o=function(r,n){return Object.prototype.hasOwnProperty.call(r,n)},t.p="./",t.oe=function(r){throw console.error(r),r}}([]);
|
||||
//# sourceMappingURL=manifest.3ad1d5771e9b13dbdad2.js.map
|
||||
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["webpack:///webpack/bootstrap 2339051ff345deb5e9a9"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,KAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.3ad1d5771e9b13dbdad2.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 2339051ff345deb5e9a9"],"sourceRoot":""}
|
||||
@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<router-view/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "App"
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
#app {
|
||||
font-family: "Avenir", Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
color: #2c3e50;
|
||||
widows: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,58 @@
|
||||
import axios from 'axios';
|
||||
|
||||
// 登录请求方法
|
||||
const loginreq = (method, url, params) => {
|
||||
return axios({
|
||||
method: method,
|
||||
url: url,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
data: params,
|
||||
traditional: true,
|
||||
transformRequest: [
|
||||
function(data) {
|
||||
let ret = ''
|
||||
for (let it in data) {
|
||||
ret +=
|
||||
encodeURIComponent(it) +
|
||||
'=' +
|
||||
encodeURIComponent(data[it]) +
|
||||
'&'
|
||||
}
|
||||
return ret
|
||||
}
|
||||
]
|
||||
}).then(res => res.data);
|
||||
};
|
||||
// 通用公用方法
|
||||
const req = (method, url, params) => {
|
||||
return axios({
|
||||
method: method,
|
||||
url: 'http://localhost:9011'+url,
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin':'*',
|
||||
'Content-Type':'application/json;charset=UTF-8'
|
||||
},
|
||||
data: params,
|
||||
traditional: true,
|
||||
// transformRequest: [
|
||||
// function(data) {
|
||||
// let ret = ''
|
||||
// for (let it in data) {
|
||||
// ret +=
|
||||
// encodeURIComponent(it) +
|
||||
// '=' +
|
||||
// encodeURIComponent(data[it]) +
|
||||
// '&'
|
||||
// }
|
||||
// return ret
|
||||
// }
|
||||
// ]
|
||||
}).then(res => res.data);
|
||||
};
|
||||
|
||||
export {
|
||||
loginreq,
|
||||
req
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
import axios from 'axios';
|
||||
import { req } from './axiosFun';
|
||||
|
||||
/**
|
||||
* 商品管理
|
||||
**/
|
||||
// 商品管理-获取商品管理列表
|
||||
export const GoodsList = (params) => { return req("post", "/api/Goods/list", params) };
|
||||
// 商品管理-保存商品管理
|
||||
export const GoodsSave = (params) => { return req("post", "/api/Goods/save", params) };
|
||||
// 商品管理-删除商品管理
|
||||
export const GoodsDelete = (params) => { return axios.delete("/api/Goods/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
|
||||
|
||||
/**
|
||||
* 机器信息管理
|
||||
**/
|
||||
// 机器信息管理-获取机器信息管理列表
|
||||
export const MachineList = (params) => { return req("post", "/api/Machine/list", params) };
|
||||
// 机器信息管理-保存机器信息管理
|
||||
export const MachineSave = (params) => { return req("post", "/api/Machine/save", params) };
|
||||
// 机器信息管理-删除机器信息管理
|
||||
export const MachineDelete = (params) => { return axios.delete("/api/Machine/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
|
||||
|
||||
/**
|
||||
* 货道信息管理
|
||||
**/
|
||||
// 货道信息管理-获取获取货道信息管理列表
|
||||
export const MachineAisleList = (params) => { return req("post", "/api/MachineAisle/list", params) };
|
||||
// 货道信息管理-删除货道信息管理
|
||||
export const MachineAisleDelete = (params) => { return axios.delete("/api/MachineAisle/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
|
||||
// 货道信息管理-保存货道信息管理
|
||||
export const MachineAisleRsave = (params) => { return req("post", "/api/MachineAisle/save", params) };
|
||||
@ -0,0 +1,32 @@
|
||||
import axios from 'axios';
|
||||
import { req } from './axiosFun';
|
||||
|
||||
/**
|
||||
* 支付配置信息
|
||||
**/
|
||||
// 支付配置信息-获取支付配置信息列表
|
||||
export const MachineConfigList = (params) => { return req("post", "/api/MachineConfig/list", params) };
|
||||
// 支付配置信息-保存支付配置信息
|
||||
export const MachineConfigSave = (params) => { return req("post", "/api/MachineConfig/save", params) };
|
||||
// 支付配置信息-删除支付配置信息
|
||||
export const MachineConfigDelete = (params) => { return axios.delete("/api/MachineConfig/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
|
||||
|
||||
/**
|
||||
* 支付配置
|
||||
**/
|
||||
// 支付配置-获取支付配置列表
|
||||
export const ConfigList = (params) => { return req("post", "/api/Config/list", params) };
|
||||
// 支付配置-保存支付配置
|
||||
export const ConfigSave = (params) => { return req("post", "/api/Config/save", params) };
|
||||
// 支付配置-删除支付配置
|
||||
export const ConfigDelete = (params) => { return axios.delete("/api/Config/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
|
||||
|
||||
/**
|
||||
* 订单管理-交易订单
|
||||
**/
|
||||
// 交易订单-获取交易订单列表
|
||||
export const OrderList = (params) => { return req("post", "/api/Order/list", params) };
|
||||
// 交易订单-s删除交易订单
|
||||
export const OrderDelete = (params) => { return axios.delete("/api/Order/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
|
||||
// 交易订单-交易订单退款
|
||||
export const OrderRefund = (params) => { return req("post", "/api/Order/refund", params) };
|
||||
@ -0,0 +1,122 @@
|
||||
import axios from 'axios';
|
||||
import { loginreq, req } from './axiosFun';
|
||||
|
||||
// 登录接口
|
||||
export const login = (params) => { return loginreq("post", "/api/login", params) };
|
||||
// 获取用户菜单
|
||||
export const menu = (params) => { return axios.get("/api/menu?&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
|
||||
// 退出接口
|
||||
export const loginout = () => { return axios.delete("/api/login?&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
|
||||
|
||||
/**
|
||||
* 用户管理
|
||||
**/
|
||||
// 用户管理-获取用户列表
|
||||
export const userList = (params) => { return req("post", "/api/User/list", params) };
|
||||
// 用户管理-保存(添加编辑)
|
||||
export const userSave = (params) => { return req("post", "/api/User/save", params) };
|
||||
// 用户管理-删除用户
|
||||
export const userDelete = (params) => { return req("post", "/pm2-api/app/delete" , params ) };
|
||||
// 用户管理-重置密码
|
||||
export const userPwd = (params) => { return req("post", "/api/User/pwd", params) };
|
||||
// 用户管理-修改状态
|
||||
export const userLock = (params) => { return axios.get("/api/User/lock?userId=" + params.userId + "&lock=" + params.lock + "&token=" + localStorage.getItem('logintoken')) };
|
||||
// 用户管理-数据权限
|
||||
export const UserDeptTree = (params) => { return axios.get("/api/UserDept/tree/" + params + "?token=" + localStorage.getItem('logintoken')) };
|
||||
// 用户管理-数据权限保存
|
||||
export const UserDeptSave = (params) => { return req("post", "/api/UserDept/save", params) };
|
||||
// 用户管理-获取部门设置
|
||||
export const UserDeptdeptTree = (params) => { return axios.get("/api/UserDept/deptTree/" + params + "?token=" + localStorage.getItem('logintoken')) };
|
||||
// 用户管理-保存部门设置
|
||||
export const UserChangeDept = (params) => { return req("post", "/api/User/change/dept", params) };
|
||||
// 用户管理-用户下线
|
||||
export const userExpireToken = (params) => { return req("get", "/api/User/expireToken/" + params, {}) };
|
||||
// 用户管理-刷新缓存
|
||||
export const userFlashCache = (params) => { return req("get", "/api/User/flashCache/" + params, {}) };
|
||||
|
||||
|
||||
/**
|
||||
* app管理
|
||||
**/
|
||||
// app管理-获取app列表
|
||||
export const selectApp = (params) => { return req("post", "/pm2-api/app/select", params) };
|
||||
// app管理-保存(添加编辑)
|
||||
export const saveApp = (params) => { return req("post", "/pm2-api/app/installOrUpdateApp", params) };
|
||||
// app管理-删除app
|
||||
export const deleteApp = (params) => { return req("post", "/pm2-api/app/delete" , params ) };
|
||||
// app管理-搜索
|
||||
export const searchApp = (params) => { return req("post", "/pm2-api/app/search", params) };
|
||||
|
||||
|
||||
/**
|
||||
* 服务管理
|
||||
**/
|
||||
// 服务管理-启动服务
|
||||
export const startServer = (params) => { return req("post", "/pm2-api/AppCenterController/start", params) };
|
||||
// 服务管理-停止服务
|
||||
export const stopServer = (params) => { return req("post", "/pm2-api/AppCenterController/stop", params) };
|
||||
// 服务管理-重启服务
|
||||
export const restartServer = (params) => { return req("post", "/pm2-api/AppCenterController/restart" , params ) };
|
||||
|
||||
|
||||
/**
|
||||
* 菜单管理
|
||||
**/
|
||||
// 菜单管理-获取菜单Module/list
|
||||
export const ModuleList = () => { return req("post", "/api/Module/list") };
|
||||
// 菜单管理-根据菜单获取数据
|
||||
export const ModuleGet = (params) => { return axios.get("/api/Module/get/" + params + "?token=" + localStorage.getItem('logintoken')) };
|
||||
// 菜单管理-获取父级菜单Module/nodes
|
||||
export const ModuleNodes = (params) => { return req("post", "/api/Module/nodes", params) };
|
||||
// 菜单管理-修改菜单
|
||||
export const ModuleSave = (params) => { return req("post", "/api/Module/save", params) };
|
||||
// 菜单管理-删除菜单
|
||||
export const ModuleDelete = (params) => { return axios.delete("/api/Module/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
|
||||
|
||||
/**
|
||||
* 角色管理
|
||||
**/
|
||||
// 角色管理-获取角色列表
|
||||
export const roleList = (params) => { return req("post", "/api/Role/list", params) };
|
||||
// 角色管理-保存(添加编辑)
|
||||
export const roleSave = (params) => { return req("post", "/api/Role/save", params) };
|
||||
// 角色管理-删除角色
|
||||
export const roleDelete = (params) => { return axios.delete("/api/Role/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
|
||||
// 角色管理-菜单权限(获取)
|
||||
export const RoleRightTree = (params) => { return axios.get("/api/RoleRight/tree/" + params + "?token=" + localStorage.getItem('logintoken')) };
|
||||
// 角色管理-菜单权限(保存)
|
||||
export const RoleRightSave = (params) => { return req("post", "/api/RoleRight/save", params) };
|
||||
|
||||
/**
|
||||
* 公司管理
|
||||
**/
|
||||
// 公司管理-获取公司列表
|
||||
export const deptList = (params) => { return req("post", "/api/Dept/list", params) };
|
||||
// 公司管理-保存(添加编辑)
|
||||
export const deptSave = (params) => { return req("post", "/api/Dept/save", params) };
|
||||
// 公司管理-删除公司
|
||||
export const deptDelete = (params) => { return axios.get("/api/Dept/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
|
||||
|
||||
/**
|
||||
* 系统环境变量
|
||||
**/
|
||||
// 系统环境变量-获取系统环境变量列表
|
||||
export const variableList = (params) => { return req("post", "/api/Variable/list", params) };
|
||||
// 系统环境变量-保存(添加编辑)
|
||||
export const variableSave = (params) => { return req("post", "/api/Variable/save", params) };
|
||||
// 系统环境变量-删除系统环境变量
|
||||
export const variableDelete = (params) => { return axios.delete("/api/Variable/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
|
||||
|
||||
/**
|
||||
* 权限管理
|
||||
**/
|
||||
// 权限管理-获取权限列表
|
||||
export const permissionList = (params) => { return req("post", "/api/Permission/list", params) };
|
||||
// 权限管理-保存权限
|
||||
export const ermissionSave = (params) => { return req("post", "/api/Permission/save", params) };
|
||||
// 权限管理-删除权限
|
||||
export const ermissionDelete = (params) => { return axios.delete("/api/Permission/delete?ids=" + params + "&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
|
||||
// 权限管理-获取权限
|
||||
export const roleDropDown = () => { return axios.get("/api/Role/dropDown/all?&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
|
||||
// 权限管理-配置权限
|
||||
export const RolePermission = (params) => { return req("post", "/api/RolePermission/save", params) };
|
||||
|
After Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 196 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 312 B |
|
After Width: | Height: | Size: 300 B |
@ -0,0 +1,48 @@
|
||||
/**
|
||||
* 分页组件
|
||||
*/
|
||||
<template>
|
||||
<el-pagination class="page-box" @size-change="handleSizeChange" @current-change="handleCurrentChange" background :current-page="childMsg.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="childMsg.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="childMsg.total">
|
||||
</el-pagination>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'Pagination',
|
||||
props: ['childMsg'],
|
||||
data() {
|
||||
return {
|
||||
pageparm: {
|
||||
currentPage: this.childMsg.currentPage,
|
||||
pageSize: this.childMsg.pageSize
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
handleSizeChange(val) {
|
||||
/**
|
||||
* 子传父
|
||||
* 参数1 父元素方法
|
||||
* 参数2 数据
|
||||
*/
|
||||
this.pageparm.pageSize = val
|
||||
this.$emit('callFather', this.pageparm)
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
/**
|
||||
* 子传父
|
||||
* 参数1 父元素方法
|
||||
* 参数2 数据
|
||||
*/
|
||||
this.pageparm.currentPage = val
|
||||
this.$emit('callFather', this.pageparm)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.page-box {
|
||||
margin: 10px auto;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* 404
|
||||
*/
|
||||
<template>
|
||||
<div class="page-404">
|
||||
<h1>404!</h1>
|
||||
<h2>Sorry, page not found</h2>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.page-404 {
|
||||
text-align: center;
|
||||
}
|
||||
.page-404 h1 {
|
||||
font-size: 98px;
|
||||
font-weight: 700;
|
||||
line-height: 150px;
|
||||
text-shadow: rgba(61, 61, 61, 0.3) 1px 1px, rgba(61, 61, 61, 0.2) 2px 2px,
|
||||
rgba(61, 61, 61, 0.3) 3px 3px;
|
||||
}
|
||||
.page-404 h2 {
|
||||
line-height: 30px;
|
||||
font-size: 30px;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,45 @@
|
||||
// 导入组件
|
||||
import Router from 'vue-router';
|
||||
import Vue from 'vue';
|
||||
// 首页
|
||||
import index from '@/views/index';
|
||||
|
||||
/**
|
||||
* 系统管理
|
||||
*/
|
||||
// 用户管理
|
||||
import user from '@/views/system/user';
|
||||
|
||||
|
||||
// 启用路由
|
||||
Vue.use(Router);
|
||||
|
||||
// 导出路由
|
||||
export default new Router({
|
||||
routes: [ {
|
||||
path: '/',
|
||||
name: '',
|
||||
component: user,
|
||||
redirect:"/system/user",
|
||||
hidden: true,
|
||||
meta: {
|
||||
requireAuth: false
|
||||
}
|
||||
}, {
|
||||
path: '/index',
|
||||
name: '首页',
|
||||
component: index,
|
||||
iconCls: 'el-icon-tickets',
|
||||
children: [{
|
||||
|
||||
path: '/system/user',
|
||||
name: '服务管理',
|
||||
component: user,
|
||||
meta: {
|
||||
requireAuth: true
|
||||
}
|
||||
|
||||
}
|
||||
]
|
||||
}]
|
||||
})
|
||||
@ -0,0 +1,82 @@
|
||||
<template>
|
||||
|
||||
<el-container class="index-con">
|
||||
<el-aside :class="showclass">
|
||||
<leftnav></leftnav>
|
||||
</el-aside>
|
||||
<el-container class="main-con">
|
||||
<el-header class="index-header">
|
||||
<navcon></navcon>
|
||||
</el-header>
|
||||
<el-main clss="index-main">
|
||||
<router-view></router-view>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
// 导入组件
|
||||
import navcon from '../components/navcon.vue'
|
||||
import leftnav from '../components/leftnav.vue'
|
||||
export default {
|
||||
name: 'index',
|
||||
data() {
|
||||
return {
|
||||
showclass: 'asideshow',
|
||||
showtype: false
|
||||
}
|
||||
},
|
||||
// 注册组件
|
||||
components: {
|
||||
navcon,
|
||||
leftnav
|
||||
},
|
||||
methods: {},
|
||||
created() {
|
||||
// 监听
|
||||
this.$root.Bus.$on('toggle', value => {
|
||||
if (value) {
|
||||
this.showclass = 'asideshow'
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.showclass = 'aside'
|
||||
}, 300)
|
||||
}
|
||||
})
|
||||
},
|
||||
beforeUpdate() {},
|
||||
// 挂载前状态(里面是操作)
|
||||
beforeMount() {
|
||||
// 弹出登录成功
|
||||
this.$message({
|
||||
message: '登录成功',
|
||||
type: 'success'
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style >
|
||||
.index-con {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.aside {
|
||||
width: 64px !important;
|
||||
height: 100%;
|
||||
background-color: #334157;
|
||||
margin: 0px;
|
||||
}
|
||||
.asideshow {
|
||||
width: 240px !important;
|
||||
height: 100%;
|
||||
background-color: #334157;
|
||||
margin: 0px;
|
||||
}
|
||||
.index-header,
|
||||
.index-main {
|
||||
padding: 0px;
|
||||
border-left: 2px solid #333;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,22 @@
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
|
||||
Vue.use(Vuex);
|
||||
// 登录验证
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
user: false
|
||||
},
|
||||
mutations: {
|
||||
// 登录
|
||||
login(state, user) {
|
||||
state.user = user;
|
||||
localStorage.setItem("userInfo", user);
|
||||
},
|
||||
// 退出
|
||||
logout(state, user) {
|
||||
state.user = "";
|
||||
localStorage.setItem("userInfo", "");
|
||||
}
|
||||
}
|
||||
})
|
||||