diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index 26c173ef6..000000000
--- a/.babelrc
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "presets": [
- ["env", {
- "modules": false,
- "targets": {
- "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
- }
- }],
- "stage-2"
- ],
- "plugins":["transform-vue-jsx", "transform-runtime"],
- "env": {
- "development":{
- "plugins": ["dynamic-import-node"]
- }
- }
-}
diff --git a/.editorconfig b/.editorconfig
index ea6e20f5b..3454886e3 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,4 +1,4 @@
-# http://editorconfig.org
+# https://editorconfig.org
root = true
[*]
diff --git a/.env.development b/.env.development
new file mode 100644
index 000000000..d9a21321c
--- /dev/null
+++ b/.env.development
@@ -0,0 +1,8 @@
+ENV = 'development'
+
+# 接口地址
+VUE_APP_BASE_API = 'http://localhost:8000'
+VUE_APP_WS_API = 'ws://localhost:8000'
+
+# 是否启用 babel-plugin-dynamic-import-node插件
+VUE_CLI_BABEL_TRANSPILE_MODULES = true
diff --git a/.env.production b/.env.production
new file mode 100644
index 000000000..baec654b9
--- /dev/null
+++ b/.env.production
@@ -0,0 +1,6 @@
+ENV = 'production'
+
+# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
+VUE_APP_BASE_API = 'https://api.auauz.net'
+# 如果接口是 http 形式, wss 需要改为 ws
+VUE_APP_WS_API = 'wss://api.auauz.net'
diff --git a/.eslintignore b/.eslintignore
index e3a4037e4..e6529fc09 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,3 +1,4 @@
build/*.js
-config/*.js
src/assets
+public
+dist
diff --git a/.eslintrc.js b/.eslintrc.js
index 0e5c28a5f..c97750547 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -21,7 +21,10 @@ module.exports = {
"allowFirstLine": false
}
}],
+ "vue/singleline-html-element-content-newline": "off",
+ "vue/multiline-html-element-content-newline":"off",
"vue/name-property-casing": ["error", "PascalCase"],
+ "vue/no-v-html": "off",
'accessor-pairs': 2,
'arrow-spacing': [2, {
'before': true,
@@ -44,7 +47,7 @@ module.exports = {
'curly': [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
- 'eqeqeq': [2, 'allow-null'],
+ 'eqeqeq': ["error", "always", {"null": "ignore"}],
'generator-star-spacing': [2, {
'before': true,
'after': true
@@ -73,7 +76,7 @@ module.exports = {
'no-class-assign': 2,
'no-cond-assign': 2,
'no-const-assign': 2,
- 'no-control-regex': 2,
+ 'no-control-regex': 0,
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
@@ -193,4 +196,3 @@ module.exports = {
'array-bracket-spacing': [2, 'never']
}
}
-
diff --git a/.gitignore b/.gitignore
index 571f0a6ea..78a752d87 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,8 +4,11 @@ dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
-package-lock.json
-yarn.lock
+**/*.log
+
+tests/**/coverage/
+tests/e2e/reports
+selenium-debug.log
# Editor directories and files
.idea
@@ -14,3 +17,7 @@ yarn.lock
*.ntvs*
*.njsproj
*.sln
+*.local
+
+package-lock.json
+yarn.lock
diff --git a/.postcssrc.js b/.postcssrc.js
deleted file mode 100644
index eee3e92d7..000000000
--- a/.postcssrc.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// 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": {}
- }
-}
diff --git a/.travis.yml b/.travis.yml
index 16574d97a..f4be7a085 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,5 +1,5 @@
language: node_js
-node_js: stable
+node_js: 10
script: npm run test
notifications:
email: false
diff --git a/LICENSE b/LICENSE
index 91e3c252c..78a36cb2b 100644
--- a/LICENSE
+++ b/LICENSE
@@ -176,7 +176,7 @@ recommend that a file or class name and description of purpose be included on
the same "printed page" as the copyright notice for easier identification within
third-party archives.
- Copyright 2018 Elune
+ Copyright 2019 Zheng Jie
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -188,4 +188,4 @@ third-party archives.
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
- limitations under the License.
\ No newline at end of file
+ limitations under the License.
diff --git a/README.md b/README.md
index 6f12df0fd..ebcd9ba1b 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,28 @@
-# eladmin-qt
+# ELADMIN-WEB
-eladmin 前端源码
+ELADMIN 前端源码
-#### 后端源码
-- 码云: [https://gitee.com/elunez/eladmin](https://gitee.com/elunez/eladmin)
-- github: [https://github.com/elunez/eladmin](https://github.com/elunez/eladmin)
+#### 项目源码
-#### eladmin开发文档
-[http://docs.auauz.net/#/](http://docs.auauz.net/#/)
+| | 后端源码 | 前端源码 |
+|--- |--- | --- |
+| github | https://github.com/elunez/eladmin | https://github.com/elunez/eladmin-web |
+| 码云 | https://gitee.com/elunez/eladmin | https://gitee.com/elunez/eladmin-web |
-## Build Setup
+#### 开发文档
+[https://el-admin.vip](https://el-admin.vip)
+
+#### 前端模板
+
+初始模板基于: [https://github.com/PanJiaChen/vue-element-admin](https://github.com/PanJiaChen/vue-element-admin)
+
+模板文档: [https://panjiachen.github.io/vue-element-admin-site/zh/guide/](https://panjiachen.github.io/vue-element-admin-site/zh/guide/)
+
+#### Build Setup
``` bash
+# 配置镜像加速
+https://www.ydyno.com/archives/1219.html
+
# 安装依赖
npm install
@@ -18,11 +30,37 @@ npm install
npm run dev
# 构建生产环境
-npm run build
+npm run build:prod
```
-#### 反馈交流
+#### 常见问题
+
+1、linux 系统在安装依赖的时候会出现 node-sass 无法安装的问题
+
+解决方案:
+```
+1. 单独安装:npm install --unsafe-perm node-sass
+2. 直接使用:npm install --unsafe-perm
+```
-- QQ交流群:
+2、加速node-sass安装
+
+https://www.ydyno.com/archives/1219.html
+
+#### 特别鸣谢
+
+- 感谢 [JetBrains](https://www.jetbrains.com/) 提供的非商业开源软件开发授权
+
+- 感谢 [PanJiaChen](https://github.com/PanJiaChen/vue-element-admin) 大佬提供的前端模板
+
+- 感谢 [Moxun](https://github.com/moxun1639) 大佬提供的前端 Curd 通用组件
+
+- 感谢 [zhy6599](https://gitee.com/zhy6599) 大佬提供的后端运维管理相关功能
+
+- 感谢 [j.yao.SUSE](https://github.com/everhopingandwaiting) 大佬提供的匿名接口与Redis限流等功能
+
+- 感谢 [d15801543974](https://github.com/d15801543974) 大佬提供的基于注解的通用查询方式
+
+#### 反馈交流
-- 作者邮箱:elunez@qq.com
\ No newline at end of file
+- QQ交流群:891137268
\ No newline at end of file
diff --git a/babel.config.js b/babel.config.js
new file mode 100644
index 000000000..804632a06
--- /dev/null
+++ b/babel.config.js
@@ -0,0 +1,11 @@
+const plugins = ['@vue/babel-plugin-transform-vue-jsx']
+// 生产环境移除console
+if (process.env.NODE_ENV === 'production') {
+ plugins.push('transform-remove-console')
+}
+module.exports = {
+ plugins: plugins,
+ presets: [
+ '@vue/app'
+ ]
+}
diff --git a/build/build.js b/build/build.js
deleted file mode 100644
index 34c71a554..000000000
--- a/build/build.js
+++ /dev/null
@@ -1,67 +0,0 @@
-'use strict'
-require('./check-versions')()
-
-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')
-var connect = require('connect')
-var serveStatic = require('serve-static')
-
-const spinner = ora(
- 'building for ' + process.env.env_config + ' environment...'
-)
-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,
- 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"
- )
- )
-
- if (process.env.npm_config_preview) {
- const port = 9526
- const host = 'http://localhost:' + port
- const basePath = config.build.assetsPublicPath
- const app = connect()
-
- app.use(
- basePath,
- serveStatic('./dist', {
- index: ['index.html', '/']
- })
- )
-
- app.listen(port, function() {
- console.log(
- chalk.green(`> Listening at http://localhost:${port}${basePath}`)
- )
- })
- }
- })
-})
diff --git a/build/check-versions.js b/build/check-versions.js
deleted file mode 100644
index c29c7e7a9..000000000
--- a/build/check-versions.js
+++ /dev/null
@@ -1,62 +0,0 @@
-'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:'
- )
- )
-
- for (let i = 0; i < warnings.length; i++) {
- const warning = warnings[i]
- console.log(' ' + warning)
- }
-
- process.exit(1)
- }
-}
diff --git a/build/logo.png b/build/logo.png
deleted file mode 100644
index f3d2503fc..000000000
Binary files a/build/logo.png and /dev/null differ
diff --git a/build/utils.js b/build/utils.js
deleted file mode 100644
index c96d09364..000000000
--- a/build/utils.js
+++ /dev/null
@@ -1,108 +0,0 @@
-'use strict'
-const path = require('path')
-const config = require('../config')
-const MiniCssExtractPlugin = require('mini-css-extract-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 = []
-
- // Extract CSS when that option is specified
- // (which is the case during production build)
- if (options.extract) {
- loaders.push(MiniCssExtractPlugin.loader)
- } else {
- loaders.push('vue-style-loader')
- }
-
- loaders.push(cssLoader)
-
- if (options.usePostCSS) {
- loaders.push(postcssLoader)
- }
-
- if (loader) {
- loaders.push({
- loader: loader + '-loader',
- options: Object.assign({}, loaderOptions, {
- sourceMap: options.sourceMap
- })
- })
- }
-
- return 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')
- })
- }
-}
diff --git a/build/vue-loader.conf.js b/build/vue-loader.conf.js
deleted file mode 100644
index 5496c9317..000000000
--- a/build/vue-loader.conf.js
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict'
-
-module.exports = {
- //You can set the vue-loader configuration by yourself.
-}
diff --git a/build/webpack.base.conf.js b/build/webpack.base.conf.js
deleted file mode 100644
index 3b946b4b2..000000000
--- a/build/webpack.base.conf.js
+++ /dev/null
@@ -1,107 +0,0 @@
-'use strict'
-const path = require('path')
-const utils = require('./utils')
-const config = require('../config')
-const { VueLoaderPlugin } = require('vue-loader')
-const vueLoaderConfig = require('./vue-loader.conf')
-
-function resolve(dir) {
- return path.join(__dirname, '..', dir)
-}
-
-const createLintingRule = () => ({
- test: /\.(js|vue)$/,
- loader: 'eslint-loader',
- enforce: 'pre',
- include: [resolve('src'), resolve('test')],
- options: {
- formatter: require('eslint-friendly-formatter'),
- emitWarning: !config.dev.showEslintErrorsInOverlay
- }
-})
-
-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: {
- '@': resolve('src')
- }
- },
- module: {
- rules: [
- ...(config.dev.useEslint ? [createLintingRule()] : []),
- {
- test: /\.vue$/,
- loader: 'vue-loader',
- options: vueLoaderConfig
- },
- {
- test: /\.js$/,
- loader: 'babel-loader?cacheDirectory',
- include: [
- resolve('src'),
- resolve('test'),
- resolve('node_modules/webpack-dev-server/client')
- ]
- },
- {
- test: /\.svg$/,
- loader: 'svg-sprite-loader',
- include: [resolve('src/icons')],
- options: {
- symbolId: 'icon-[name]'
- }
- },
- {
- test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
- loader: 'url-loader',
- exclude: [resolve('src/icons')],
- 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]')
- }
- }
- ]
- },
- plugins: [new VueLoaderPlugin()],
- 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'
- }
-}
diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js
deleted file mode 100644
index 26a5584a8..000000000
--- a/build/webpack.dev.conf.js
+++ /dev/null
@@ -1,98 +0,0 @@
-'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 HtmlWebpackPlugin = require('html-webpack-plugin')
-const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
-const portfinder = require('portfinder')
-
-function resolve(dir) {
- return path.join(__dirname, '..', dir)
-}
-
-const HOST = process.env.HOST
-const PORT = process.env.PORT && Number(process.env.PORT)
-
-const devWebpackConfig = merge(baseWebpackConfig, {
- mode: 'development',
- 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: true,
- hot: true,
- 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(),
- // https://github.com/ampedandwired/html-webpack-plugin
- new HtmlWebpackPlugin({
- filename: 'index.html',
- template: 'index.html',
- inject: true,
- favicon: resolve('favicon.ico'),
- title: 'vue-element-admin',
- templateParameters: {
- BASE_URL: config.dev.assetsPublicPath + config.dev.assetsSubDirectory,
- },
- }),
- ]
-})
-
-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)
- }
- })
-})
diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js
deleted file mode 100644
index 946a134a5..000000000
--- a/build/webpack.prod.conf.js
+++ /dev/null
@@ -1,188 +0,0 @@
-'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 ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
-const MiniCssExtractPlugin = require('mini-css-extract-plugin')
-const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
-const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
-
-function resolve(dir) {
- return path.join(__dirname, '..', dir)
-}
-
-const env = require('../config/' + process.env.env_config + '.env')
-
-// For NamedChunksPlugin
-const seen = new Set()
-const nameLength = 4
-
-const webpackConfig = merge(baseWebpackConfig, {
- mode: 'production',
- 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:8].js'),
- chunkFilename: utils.assetsPath('js/[name].[chunkhash:8].js')
- },
- plugins: [
- // http://vuejs.github.io/vue-loader/en/workflow/production.html
- new webpack.DefinePlugin({
- 'process.env': env
- }),
- // extract css into its own file
- new MiniCssExtractPlugin({
- filename: utils.assetsPath('css/[name].[contenthash:8].css'),
- chunkFilename: utils.assetsPath('css/[name].[contenthash:8].css')
- }),
- // 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,
- favicon: resolve('favicon.ico'),
- title: 'vue-element-admin',
- templateParameters: {
- BASE_URL: config.build.assetsPublicPath + config.build.assetsSubDirectory,
- },
- minify: {
- removeComments: true,
- collapseWhitespace: true,
- removeAttributeQuotes: true
- // more options:
- // https://github.com/kangax/html-minifier#options-quick-reference
- }
- // default sort mode uses toposort which cannot handle cyclic deps
- // in certain cases, and in webpack 4, chunk order in HTML doesn't
- // matter anyway
- }),
- new ScriptExtHtmlWebpackPlugin({
- //`runtime` must same as runtimeChunk name. default is `runtime`
- inline: /runtime\..*\.js$/
- }),
- // keep chunk.id stable when chunk has no name
- new webpack.NamedChunksPlugin(chunk => {
- if (chunk.name) {
- return chunk.name
- }
- const modules = Array.from(chunk.modulesIterable)
- if (modules.length > 1) {
- const hash = require('hash-sum')
- const joinedHash = hash(modules.map(m => m.id).join('_'))
- let len = nameLength
- while (seen.has(joinedHash.substr(0, len))) len++
- seen.add(joinedHash.substr(0, len))
- return `chunk-${joinedHash.substr(0, len)}`
- } else {
- return modules[0].id
- }
- }),
- // keep module.id stable when vender modules does not change
- new webpack.HashedModuleIdsPlugin(),
- // copy custom static assets
- new CopyWebpackPlugin([
- {
- from: path.resolve(__dirname, '../static'),
- to: config.build.assetsSubDirectory,
- ignore: ['.*']
- }
- ])
- ],
- optimization: {
- splitChunks: {
- chunks: 'all',
- cacheGroups: {
- libs: {
- name: 'chunk-libs',
- test: /[\\/]node_modules[\\/]/,
- priority: 10,
- chunks: 'initial' // 只打包初始时依赖的第三方
- },
- elementUI: {
- name: 'chunk-elementUI', // 单独将 elementUI 拆包
- priority: 20, // 权重要大于 libs 和 app 不然会被打包进 libs 或者 app
- test: /[\\/]node_modules[\\/]element-ui[\\/]/
- },
- commons: {
- name: 'chunk-commons',
- test: resolve('src/components'), // 可自定义拓展你的规则
- minChunks: 3, // 最小公用次数
- priority: 5,
- reuseExistingChunk: true
- }
- }
- },
- runtimeChunk: 'single',
- minimizer: [
- new UglifyJsPlugin({
- uglifyOptions: {
- mangle: {
- safari10: true
- }
- },
- sourceMap: config.build.productionSourceMap,
- cache: true,
- parallel: true
- }),
- // Compress extracted CSS. We are using this plugin so that possible
- // duplicated CSS from different components can be deduped.
- new OptimizeCSSAssetsPlugin()
- ]
- }
-})
-
-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.generateAnalyzerReport || config.build.bundleAnalyzerReport) {
- const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
- .BundleAnalyzerPlugin
-
- if (config.build.bundleAnalyzerReport) {
- webpackConfig.plugins.push(
- new BundleAnalyzerPlugin({
- analyzerPort: 8080,
- generateStatsFile: false
- })
- )
- }
-
- if (config.build.generateAnalyzerReport) {
- webpackConfig.plugins.push(
- new BundleAnalyzerPlugin({
- analyzerMode: 'static',
- reportFilename: 'bundle-report.html',
- openAnalyzer: false
- })
- )
- }
-}
-
-module.exports = webpackConfig
diff --git a/config/dev.env.js b/config/dev.env.js
deleted file mode 100644
index 031402a8d..000000000
--- a/config/dev.env.js
+++ /dev/null
@@ -1,8 +0,0 @@
-'use strict'
-const merge = require('webpack-merge')
-const prodEnv = require('./prod.env')
-
-module.exports = merge(prodEnv, {
- NODE_ENV: '"development"',
- BASE_API: '"http://localhost:8000"'
-})
diff --git a/config/index.js b/config/index.js
deleted file mode 100644
index f70a9d500..000000000
--- a/config/index.js
+++ /dev/null
@@ -1,86 +0,0 @@
-'use strict'
-// Template version: 1.2.6
-// see http://vuejs-templates.github.io/webpack for documentation.
-
-const path = require('path')
-
-module.exports = {
- dev: {
- // Paths
- assetsSubDirectory: 'static',
- assetsPublicPath: '/',
- proxyTable: {},
-
- // Various Dev Server settings
- host: 'localhost', // can be overwritten by process.env.HOST
- port: 8013, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
- autoOpenBrowser: true,
- errorOverlay: true,
- notifyOnErrors: false,
- poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
-
- // Use Eslint Loader?
- // If true, your code will be linted during bundling and
- // linting errors and warnings will be shown in the console.
- useEslint: true,
- // If true, eslint errors and warnings will also be shown in the error overlay
- // in the browser.
- showEslintErrorsInOverlay: false,
-
- /**
- * Source Maps
- */
-
- // https://webpack.js.org/configuration/devtool/#development
- devtool: 'cheap-source-map',
-
- // CSS Sourcemaps off by default because relative paths are "buggy"
- // with this option, according to the CSS-Loader README
- // (https://github.com/webpack/css-loader#sourcemaps)
- // In our experience, they generally work as expected,
- // just be aware of this issue when enabling this option.
- cssSourceMap: false
- },
-
- build: {
- // Template for index.html
- index: path.resolve(__dirname, '../dist/index.html'),
-
- // Paths
- assetsRoot: path.resolve(__dirname, '../dist'),
- assetsSubDirectory: 'static',
-
- /**
- * You can set by youself according to actual condition
- * You will need to set this if you plan to deploy your site under a sub path,
- * for example GitHub pages. If you plan to deploy your site to https://foo.github.io/bar/,
- * then assetsPublicPath should be set to "/bar/".
- * In most cases please use '/' !!!
- */
- assetsPublicPath: '/',
-
- /**
- * Source Maps
- */
-
- productionSourceMap: false,
- // https://webpack.js.org/configuration/devtool/#production
- devtool: 'source-map',
-
- // Gzip off by default as many popular static hosts such as
- // Surge or Netlify already gzip all static assets for you.
- // Before setting to `true`, make sure to:
- // npm install --save-dev compression-webpack-plugin
- productionGzip: false,
- productionGzipExtensions: ['js', 'css'],
-
- // Run the build command with an extra argument to
- // View the bundle analyzer report after build finishes:
- // `npm run build --report`
- // Set to `true` or `false` to always turn it on or off
- bundleAnalyzerReport: process.env.npm_config_report || false,
-
- // `npm run build:prod --generate_report`
- generateAnalyzerReport: process.env.npm_config_generate_report || false
- }
-}
diff --git a/config/prod.env.js b/config/prod.env.js
deleted file mode 100644
index 73e8fe159..000000000
--- a/config/prod.env.js
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict'
-module.exports = {
- NODE_ENV: '"production"',
- BASE_API: '"https://api.auauz.net"'
-}
diff --git a/favicon.ico b/favicon.ico
deleted file mode 100644
index 34b63ac63..000000000
Binary files a/favicon.ico and /dev/null differ
diff --git a/index.html b/index.html
deleted file mode 100644
index 9d960478b..000000000
--- a/index.html
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
{{ msg }}
+1.7版本更新说明-