From e096447c2ec941563ae78cc114c60e915f4e635f Mon Sep 17 00:00:00 2001 From: dqjdda <201507802@qq.com> Date: Wed, 20 Nov 2019 21:12:47 +0800 Subject: [PATCH] =?UTF-8?q?vue=20cli3=20=E6=94=B9=E9=80=A0=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .babelrc | 17 - .editorconfig | 2 +- .env.development | 7 + .env.production | 4 + .eslintignore | 3 +- .eslintrc.js | 8 +- .gitignore | 11 +- .postcssrc.js | 10 - .travis.yml | 2 +- LICENSE | 204 +----------- babel.config.js | 5 + build/build.js | 67 ---- build/check-versions.js | 62 ---- build/index.js | 27 ++ build/utils.js | 108 ------- build/vue-loader.conf.js | 5 - build/webpack.base.conf.js | 122 ------- build/webpack.dev.conf.js | 98 ------ build/webpack.prod.conf.js | 188 ----------- config/dev.env.js | 9 - config/index.js | 106 ------ config/prod.env.js | 5 - index.html | 22 -- jest.config.js | 24 ++ package.json | 148 ++++----- plopfile.js | 7 + postcss.config.js | 5 + favicon.ico => public/favicon.ico | Bin public/index.html | 15 + src/App.vue | 2 +- src/assets/404_images/404.png | Bin 63580 -> 98071 bytes src/assets/404_images/404_cloud.png | Bin 3054 -> 4766 bytes src/{ => assets}/icons/index.js | 4 +- src/assets/icons/svg/404.svg | 1 + src/{ => assets}/icons/svg/Steve-Jobs.svg | 0 src/{ => assets}/icons/svg/add.svg | 0 src/{ => assets}/icons/svg/alipay.svg | 0 src/{ => assets}/icons/svg/anq.svg | 0 src/assets/icons/svg/bug.svg | 1 + src/{ => assets}/icons/svg/chain.svg | 0 src/assets/icons/svg/chart.svg | 1 + src/assets/icons/svg/clipboard.svg | 1 + src/{ => assets}/icons/svg/codeConsole.svg | 0 src/assets/icons/svg/component.svg | 1 + src/assets/icons/svg/dashboard.svg | 1 + src/{ => assets}/icons/svg/date.svg | 0 src/{ => assets}/icons/svg/dept.svg | 0 src/{ => assets}/icons/svg/dev.svg | 0 src/{ => assets}/icons/svg/develop.svg | 0 src/{ => assets}/icons/svg/dictionary.svg | 0 src/assets/icons/svg/documentation.svg | 1 + src/assets/icons/svg/drag.svg | 1 + src/assets/icons/svg/edit.svg | 1 + src/assets/icons/svg/education.svg | 1 + src/{ => assets}/icons/svg/email.svg | 0 src/{ => assets}/icons/svg/error.svg | 0 src/assets/icons/svg/example.svg | 1 + src/assets/icons/svg/excel.svg | 1 + src/assets/icons/svg/exit-fullscreen.svg | 1 + src/assets/icons/svg/eye-open.svg | 1 + src/assets/icons/svg/eye.svg | 1 + src/assets/icons/svg/form.svg | 1 + src/assets/icons/svg/fullscreen.svg | 1 + src/{ => assets}/icons/svg/fwb.svg | 0 src/{ => assets}/icons/svg/github.svg | 0 src/{ => assets}/icons/svg/gonggao.svg | 0 src/assets/icons/svg/guide.svg | 1 + src/{ => assets}/icons/svg/icon.svg | 0 src/{ => assets}/icons/svg/image.svg | 0 src/{ => assets}/icons/svg/index.svg | 0 src/assets/icons/svg/international.svg | 1 + src/{ => assets}/icons/svg/ipvisits.svg | 0 src/{ => assets}/icons/svg/java.svg | 0 src/assets/icons/svg/language.svg | 1 + src/assets/icons/svg/link.svg | 1 + src/assets/icons/svg/list.svg | 1 + src/{ => assets}/icons/svg/lock.svg | 0 src/{ => assets}/icons/svg/log.svg | 0 src/{ => assets}/icons/svg/markdown.svg | 0 src/{ => assets}/icons/svg/menu.svg | 0 src/assets/icons/svg/message.svg | 1 + src/assets/icons/svg/money.svg | 1 + src/{ => assets}/icons/svg/monitor.svg | 0 src/assets/icons/svg/nested.svg | 1 + src/{ => assets}/icons/svg/password.svg | 0 src/assets/icons/svg/pdf.svg | 1 + src/assets/icons/svg/people.svg | 1 + src/{ => assets}/icons/svg/peoples.svg | 0 src/{ => assets}/icons/svg/permission.svg | 0 src/{ => assets}/icons/svg/phone.svg | 0 src/{ => assets}/icons/svg/qiniu.svg | 0 src/assets/icons/svg/qq.svg | 1 + src/{ => assets}/icons/svg/redis.svg | 0 src/{ => assets}/icons/svg/role.svg | 0 src/{ => assets}/icons/svg/run.svg | 0 src/{ => assets}/icons/svg/running.svg | 0 src/{ => assets}/icons/svg/search.svg | 0 src/assets/icons/svg/shopping.svg | 1 + src/assets/icons/svg/size.svg | 1 + src/assets/icons/svg/skill.svg | 1 + src/{ => assets}/icons/svg/sqlMonitor.svg | 0 src/assets/icons/svg/star.svg | 1 + src/{ => assets}/icons/svg/swagger.svg | 0 src/{ => assets}/icons/svg/sys-tools.svg | 0 src/{ => assets}/icons/svg/system.svg | 0 src/assets/icons/svg/tab.svg | 1 + src/assets/icons/svg/table.svg | 1 + src/assets/icons/svg/theme.svg | 1 + src/{ => assets}/icons/svg/timing.svg | 0 src/{ => assets}/icons/svg/tools.svg | 0 src/assets/icons/svg/tree-table.svg | 1 + src/assets/icons/svg/tree.svg | 1 + src/{ => assets}/icons/svg/unlock.svg | 0 src/{ => assets}/icons/svg/user.svg | 0 src/{ => assets}/icons/svg/user1.svg | 0 src/{ => assets}/icons/svg/validCode.svg | 0 src/{ => assets}/icons/svg/visits.svg | 0 src/{ => assets}/icons/svg/web.svg | 0 src/assets/icons/svg/wechat.svg | 1 + src/{ => assets}/icons/svg/weixin.svg | 0 src/assets/icons/svg/zip.svg | 1 + src/{ => assets}/icons/svg/zujian.svg | 0 src/{ => assets}/icons/svgo.yml | 0 src/assets/{avatar => images}/avatar.png | Bin src/assets/{logo => images}/logo.png | Bin src/assets/styles/btn.scss | 99 ++++++ src/assets/styles/eladmin.scss | 96 ++++++ src/assets/styles/element-ui.scss | 79 +++++ .../styles/element-variables.scss | 2 +- src/assets/styles/index.scss | 182 +++++++++++ src/assets/styles/mixin.scss | 66 ++++ src/{ => assets}/styles/sidebar.scss | 160 ++++++--- src/{ => assets}/styles/transition.scss | 10 +- src/{ => assets}/styles/variables.scss | 16 +- src/components/Breadcrumb/index.vue | 49 +-- .../Echarts}/BarChart.vue | 2 +- .../Echarts}/Category.vue | 2 +- .../Echarts}/Funnel.vue | 2 +- .../Echarts}/Gauge.vue | 2 +- .../Echarts}/Graph.vue | 2 +- .../Echarts}/HeatMap.vue | 2 +- .../Echarts}/Line3D.vue | 2 +- .../Echarts}/PieChart.vue | 2 +- .../Echarts}/Point.vue | 2 +- .../Echarts}/RadarChart.vue | 2 +- .../dashboard => components/Echarts}/Rich.vue | 2 +- .../Echarts}/Sankey.vue | 2 +- .../Echarts}/Scatter.vue | 2 +- .../Echarts}/Sunburst.vue | 2 +- .../Echarts}/ThemeRiver.vue | 2 +- src/components/Github/index.vue | 2 +- src/components/Hamburger/index.vue | 29 +- src/components/HeaderSearch/index.vue | 180 +++++++++++ src/components/IconSelect/index.vue | 2 +- src/components/IconSelect/requireIcons.js | 2 +- src/components/Iframe/index.vue | 2 +- src/components/Pagination/index.vue | 101 ++++++ src/components/PanThumb/index.vue | 2 +- src/components/RightPanel/index.vue | 132 ++++---- src/components/Screenfull/index.vue | 58 ++-- src/components/SizeSelect/index.vue | 57 ++++ src/components/SvgIcon/index.vue | 23 +- src/components/TextHoverEffect/Mallki.vue | 113 ------- src/components/ThemePicker/index.vue | 175 ++++++++++ src/components/YamlEdit/index.vue | 2 +- src/layout/components/AppMain.vue | 47 +-- src/layout/components/Navbar.vue | 174 +++++----- src/layout/components/Settings/index.vue | 58 ++-- src/layout/components/Sidebar/FixiOSBug.js | 10 +- src/layout/components/Sidebar/Link.vue | 11 +- src/layout/components/Sidebar/Logo.vue | 84 +++-- src/layout/components/Sidebar/SidebarItem.vue | 54 ++-- src/layout/components/Sidebar/index.vue | 57 +++- .../components/TagsView/ScrollPane.vue} | 35 +- .../{TagsView.vue => TagsView/index.vue} | 67 ++-- src/layout/components/index.js | 6 +- src/layout/{Layout.vue => index.vue} | 19 +- src/layout/mixin/ResizeHandler.js | 30 +- src/main.js | 32 +- src/router/index.js | 8 +- src/router/routers.js | 38 +-- src/{config/index.js => settings.js} | 43 +-- src/store/getters.js | 1 + src/store/index.js | 28 +- src/store/modules/api.js | 2 +- src/store/modules/app.js | 81 +++-- src/store/modules/permission.js | 2 +- src/store/modules/settings.js | 60 ++-- src/store/modules/tagsView.js | 303 +++++++++--------- src/styles/description.scss | 17 - src/styles/element-ui.scss | 29 -- src/styles/index.scss | 173 ---------- src/styles/mixin.scss | 27 -- src/utils/auth.js | 2 +- src/utils/clipboard.js | 4 +- src/utils/export2Excel.js | 206 ------------ src/utils/export2Zip.js | 24 -- src/utils/get-page-title.js | 10 + src/utils/index.js | 295 ++++++++++++++--- src/utils/open-window.js | 25 ++ src/utils/permission.js | 3 +- src/utils/request.js | 4 +- src/utils/scroll-to.js | 58 ++++ src/utils/validate.js | 84 ++++- src/views/components/Echarts.vue | 151 +++++++++ src/views/components/Editor.vue | 4 +- src/views/components/IconSelect.vue | 70 ---- src/views/components/MarkDown.vue | 2 +- src/views/components/YamlEdit.vue | 2 +- src/views/components/icons/element-icons.js | 74 +++++ src/views/components/icons/index.vue | 91 ++++++ src/views/components/icons/svg-icons.js | 10 + src/views/dashboard/LineChart.vue | 2 +- src/views/dashboard/PanelGroup.vue | 8 +- src/views/features/401.vue | 28 +- src/views/features/404.vue | 3 - src/views/features/redirect.vue | 2 +- src/views/generator/config.vue | 69 ++-- src/views/generator/index.vue | 13 +- src/views/home.vue | 102 +++--- src/views/login.vue | 18 +- src/views/monitor/log/errorLog.vue | 15 +- src/views/monitor/log/index.vue | 15 +- src/views/monitor/log/search.vue | 12 +- src/views/monitor/online/index.vue | 23 +- src/views/monitor/redis/index.vue | 17 +- src/views/monitor/server/form.vue | 16 +- src/views/monitor/server/index.vue | 49 +-- src/views/monitor/sql/index.vue | 2 +- src/views/nested/menu1/index.vue | 2 +- src/views/nested/menu1/menu1-1/index.vue | 4 +- src/views/nested/menu1/menu1-2/index.vue | 2 +- src/views/nested/menu2/index.vue | 2 +- src/views/system/dept/form.vue | 2 +- src/views/system/dept/index.vue | 35 +- src/views/system/dict/form.vue | 4 +- src/views/system/dict/index.vue | 31 +- src/views/system/dictDetail/form.vue | 6 +- src/views/system/dictDetail/index.vue | 26 +- src/views/system/job/form.vue | 4 +- src/views/system/job/index.vue | 38 ++- src/views/system/menu/form.vue | 19 +- src/views/system/menu/index.vue | 34 +- src/views/system/role/form.vue | 11 +- src/views/system/role/index.vue | 45 +-- src/views/system/timing/index.vue | 54 ++-- src/views/system/timing/log.vue | 31 +- src/views/system/user/center.vue | 22 +- src/views/system/user/center/updateEmail.vue | 6 +- src/views/system/user/center/updatePass.vue | 6 +- src/views/system/user/form.vue | 10 +- src/views/system/user/index.vue | 46 +-- src/views/tools/aliPay/config.vue | 12 +- src/views/tools/aliPay/index.vue | 5 +- src/views/tools/aliPay/toPay.vue | 6 +- src/views/tools/email/config.vue | 10 +- src/views/tools/email/index.vue | 5 +- src/views/tools/email/send.vue | 11 +- src/views/tools/picture/index.vue | 45 +-- src/views/tools/storage/index.vue | 5 +- src/views/tools/storage/local/form.vue | 9 +- src/views/tools/storage/local/index.vue | 58 ++-- src/views/tools/storage/qiniu/form.vue | 13 +- src/views/tools/storage/qiniu/index.vue | 43 +-- src/views/tools/swagger/index.vue | 2 +- static/.gitkeep | 0 vue.config.js | 130 ++++++++ 267 files changed, 3678 insertions(+), 3130 deletions(-) delete mode 100644 .babelrc create mode 100644 .env.development create mode 100644 .env.production delete mode 100644 .postcssrc.js create mode 100644 babel.config.js delete mode 100644 build/build.js delete mode 100644 build/check-versions.js create mode 100644 build/index.js delete mode 100644 build/utils.js delete mode 100644 build/vue-loader.conf.js delete mode 100644 build/webpack.base.conf.js delete mode 100644 build/webpack.dev.conf.js delete mode 100644 build/webpack.prod.conf.js delete mode 100644 config/dev.env.js delete mode 100644 config/index.js delete mode 100644 config/prod.env.js delete mode 100644 index.html create mode 100644 jest.config.js create mode 100644 plopfile.js create mode 100644 postcss.config.js rename favicon.ico => public/favicon.ico (100%) create mode 100644 public/index.html rename src/{ => assets}/icons/index.js (79%) create mode 100644 src/assets/icons/svg/404.svg rename src/{ => assets}/icons/svg/Steve-Jobs.svg (100%) rename src/{ => assets}/icons/svg/add.svg (100%) rename src/{ => assets}/icons/svg/alipay.svg (100%) rename src/{ => assets}/icons/svg/anq.svg (100%) create mode 100644 src/assets/icons/svg/bug.svg rename src/{ => assets}/icons/svg/chain.svg (100%) create mode 100644 src/assets/icons/svg/chart.svg create mode 100644 src/assets/icons/svg/clipboard.svg rename src/{ => assets}/icons/svg/codeConsole.svg (100%) create mode 100644 src/assets/icons/svg/component.svg create mode 100644 src/assets/icons/svg/dashboard.svg rename src/{ => assets}/icons/svg/date.svg (100%) rename src/{ => assets}/icons/svg/dept.svg (100%) rename src/{ => assets}/icons/svg/dev.svg (100%) rename src/{ => assets}/icons/svg/develop.svg (100%) rename src/{ => assets}/icons/svg/dictionary.svg (100%) create mode 100644 src/assets/icons/svg/documentation.svg create mode 100644 src/assets/icons/svg/drag.svg create mode 100644 src/assets/icons/svg/edit.svg create mode 100644 src/assets/icons/svg/education.svg rename src/{ => assets}/icons/svg/email.svg (100%) rename src/{ => assets}/icons/svg/error.svg (100%) create mode 100644 src/assets/icons/svg/example.svg create mode 100644 src/assets/icons/svg/excel.svg create mode 100644 src/assets/icons/svg/exit-fullscreen.svg create mode 100644 src/assets/icons/svg/eye-open.svg create mode 100644 src/assets/icons/svg/eye.svg create mode 100644 src/assets/icons/svg/form.svg create mode 100644 src/assets/icons/svg/fullscreen.svg rename src/{ => assets}/icons/svg/fwb.svg (100%) rename src/{ => assets}/icons/svg/github.svg (100%) rename src/{ => assets}/icons/svg/gonggao.svg (100%) create mode 100644 src/assets/icons/svg/guide.svg rename src/{ => assets}/icons/svg/icon.svg (100%) rename src/{ => assets}/icons/svg/image.svg (100%) rename src/{ => assets}/icons/svg/index.svg (100%) create mode 100644 src/assets/icons/svg/international.svg rename src/{ => assets}/icons/svg/ipvisits.svg (100%) rename src/{ => assets}/icons/svg/java.svg (100%) create mode 100644 src/assets/icons/svg/language.svg create mode 100644 src/assets/icons/svg/link.svg create mode 100644 src/assets/icons/svg/list.svg rename src/{ => assets}/icons/svg/lock.svg (100%) rename src/{ => assets}/icons/svg/log.svg (100%) rename src/{ => assets}/icons/svg/markdown.svg (100%) rename src/{ => assets}/icons/svg/menu.svg (100%) create mode 100644 src/assets/icons/svg/message.svg create mode 100644 src/assets/icons/svg/money.svg rename src/{ => assets}/icons/svg/monitor.svg (100%) create mode 100644 src/assets/icons/svg/nested.svg rename src/{ => assets}/icons/svg/password.svg (100%) create mode 100644 src/assets/icons/svg/pdf.svg create mode 100644 src/assets/icons/svg/people.svg rename src/{ => assets}/icons/svg/peoples.svg (100%) rename src/{ => assets}/icons/svg/permission.svg (100%) rename src/{ => assets}/icons/svg/phone.svg (100%) rename src/{ => assets}/icons/svg/qiniu.svg (100%) create mode 100644 src/assets/icons/svg/qq.svg rename src/{ => assets}/icons/svg/redis.svg (100%) rename src/{ => assets}/icons/svg/role.svg (100%) rename src/{ => assets}/icons/svg/run.svg (100%) rename src/{ => assets}/icons/svg/running.svg (100%) rename src/{ => assets}/icons/svg/search.svg (100%) create mode 100644 src/assets/icons/svg/shopping.svg create mode 100644 src/assets/icons/svg/size.svg create mode 100644 src/assets/icons/svg/skill.svg rename src/{ => assets}/icons/svg/sqlMonitor.svg (100%) create mode 100644 src/assets/icons/svg/star.svg rename src/{ => assets}/icons/svg/swagger.svg (100%) rename src/{ => assets}/icons/svg/sys-tools.svg (100%) rename src/{ => assets}/icons/svg/system.svg (100%) create mode 100644 src/assets/icons/svg/tab.svg create mode 100644 src/assets/icons/svg/table.svg create mode 100644 src/assets/icons/svg/theme.svg rename src/{ => assets}/icons/svg/timing.svg (100%) rename src/{ => assets}/icons/svg/tools.svg (100%) create mode 100644 src/assets/icons/svg/tree-table.svg create mode 100644 src/assets/icons/svg/tree.svg rename src/{ => assets}/icons/svg/unlock.svg (100%) rename src/{ => assets}/icons/svg/user.svg (100%) rename src/{ => assets}/icons/svg/user1.svg (100%) rename src/{ => assets}/icons/svg/validCode.svg (100%) rename src/{ => assets}/icons/svg/visits.svg (100%) rename src/{ => assets}/icons/svg/web.svg (100%) create mode 100644 src/assets/icons/svg/wechat.svg rename src/{ => assets}/icons/svg/weixin.svg (100%) create mode 100644 src/assets/icons/svg/zip.svg rename src/{ => assets}/icons/svg/zujian.svg (100%) rename src/{ => assets}/icons/svgo.yml (100%) rename src/assets/{avatar => images}/avatar.png (100%) rename src/assets/{logo => images}/logo.png (100%) create mode 100644 src/assets/styles/btn.scss create mode 100644 src/assets/styles/eladmin.scss create mode 100644 src/assets/styles/element-ui.scss rename src/{ => assets}/styles/element-variables.scss (90%) create mode 100644 src/assets/styles/index.scss create mode 100644 src/assets/styles/mixin.scss rename src/{ => assets}/styles/sidebar.scss (50%) rename src/{ => assets}/styles/transition.scss (87%) rename src/{ => assets}/styles/variables.scss (75%) rename src/{views/dashboard => components/Echarts}/BarChart.vue (97%) rename src/{views/dashboard => components/Echarts}/Category.vue (99%) rename src/{views/dashboard => components/Echarts}/Funnel.vue (97%) rename src/{views/dashboard => components/Echarts}/Gauge.vue (95%) rename src/{views/dashboard => components/Echarts}/Graph.vue (96%) rename src/{views/dashboard => components/Echarts}/HeatMap.vue (98%) rename src/{views/dashboard => components/Echarts}/Line3D.vue (96%) rename src/{views/dashboard => components/Echarts}/PieChart.vue (96%) rename src/{views/dashboard => components/Echarts}/Point.vue (97%) rename src/{views/dashboard => components/Echarts}/RadarChart.vue (97%) rename src/{views/dashboard => components/Echarts}/Rich.vue (98%) rename src/{views/dashboard => components/Echarts}/Sankey.vue (96%) rename src/{views/dashboard => components/Echarts}/Scatter.vue (98%) rename src/{views/dashboard => components/Echarts}/Sunburst.vue (96%) rename src/{views/dashboard => components/Echarts}/ThemeRiver.vue (98%) create mode 100644 src/components/HeaderSearch/index.vue create mode 100644 src/components/Pagination/index.vue create mode 100644 src/components/SizeSelect/index.vue delete mode 100644 src/components/TextHoverEffect/Mallki.vue create mode 100644 src/components/ThemePicker/index.vue rename src/{components/ScrollPane/index.vue => layout/components/TagsView/ScrollPane.vue} (73%) rename src/layout/components/{TagsView.vue => TagsView/index.vue} (81%) rename src/layout/{Layout.vue => index.vue} (85%) rename src/{config/index.js => settings.js} (81%) delete mode 100644 src/styles/description.scss delete mode 100644 src/styles/element-ui.scss delete mode 100644 src/styles/index.scss delete mode 100644 src/styles/mixin.scss delete mode 100644 src/utils/export2Excel.js delete mode 100644 src/utils/export2Zip.js create mode 100644 src/utils/get-page-title.js create mode 100644 src/utils/open-window.js create mode 100644 src/utils/scroll-to.js create mode 100644 src/views/components/Echarts.vue delete mode 100644 src/views/components/IconSelect.vue create mode 100644 src/views/components/icons/element-icons.js create mode 100644 src/views/components/icons/index.vue create mode 100644 src/views/components/icons/svg-icons.js delete mode 100644 static/.gitkeep create mode 100644 vue.config.js diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 26c173e..0000000 --- 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 ea6e20f..3454886 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 0000000..660b9bb --- /dev/null +++ b/.env.development @@ -0,0 +1,7 @@ +ENV = 'development' + +# 接口地址 +VUE_APP_BASE_API = 'http://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 0000000..bc12c75 --- /dev/null +++ b/.env.production @@ -0,0 +1,4 @@ +ENV = 'production' + +# 接口地址 +VUE_APP_BASE_API = 'https://api.auauz.net' diff --git a/.eslintignore b/.eslintignore index e3a4037..e6529fc 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 0e5c28a..c977505 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 571f0a6..78a752d 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 eee3e92..0000000 --- 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 16574d9..f4be7a0 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 91e3c25..6151575 100644 --- a/LICENSE +++ b/LICENSE @@ -1,191 +1,21 @@ -Apache License -Version 2.0, January 2004 -http://www.apache.org/licenses/ +MIT License -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +Copyright (c) 2017-present PanJiaChen -1. Definitions. +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: -"License" shall mean the terms and conditions for use, reproduction, and -distribution as defined by Sections 1 through 9 of this document. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -"Licensor" shall mean the copyright owner or entity authorized by the copyright -owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities -that control, are controlled by, or are under common control with that entity. -For the purposes of this definition, "control" means (i) the power, direct or -indirect, to cause the direction or management of such entity, whether by -contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising -permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including -but not limited to software source code, documentation source, and configuration -files. - -"Object" form shall mean any form resulting from mechanical transformation or -translation of a Source form, including but not limited to compiled object code, -generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made -available under the License, as indicated by a copyright notice that is included -in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that -is based on (or derived from) the Work and for which the editorial revisions, -annotations, elaborations, or other modifications represent, as a whole, an -original work of authorship. For the purposes of this License, Derivative Works -shall not include works that remain separable from, or merely link (or bind by -name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version -of the Work and any modifications or additions to that Work or Derivative Works -thereof, that is intentionally submitted to Licensor for inclusion in the Work -by the copyright owner or by an individual or Legal Entity authorized to submit -on behalf of the copyright owner. For the purposes of this definition, -"submitted" means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, and -issue tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding communication -that is conspicuously marked or otherwise designated in writing by the copyright -owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf -of whom a Contribution has been received by Licensor and subsequently -incorporated within the Work. - -2. Grant of Copyright License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the Work and such -Derivative Works in Source or Object form. - -3. Grant of Patent License. - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable (except as stated in this section) patent license to make, have -made, use, offer to sell, sell, import, and otherwise transfer the Work, where -such license applies only to those patent claims licensable by such Contributor -that are necessarily infringed by their Contribution(s) alone or by combination -of their Contribution(s) with the Work to which such Contribution(s) was -submitted. If You institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work or a -Contribution incorporated within the Work constitutes direct or contributory -patent infringement, then any patent licenses granted to You under this License -for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. - -You may reproduce and distribute copies of the Work or Derivative Works thereof -in any medium, with or without modifications, and in Source or Object form, -provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and -You must cause any modified files to carry prominent notices stating that You -changed the files; and -You must retain, in the Source form of any Derivative Works that You distribute, -all copyright, patent, trademark, and attribution notices from the Source form -of the Work, excluding those notices that do not pertain to any part of the -Derivative Works; and -If the Work includes a "NOTICE" text file as part of its distribution, then any -Derivative Works that You distribute must include a readable copy of the -attribution notices contained within such NOTICE file, excluding those notices -that do not pertain to any part of the Derivative Works, in at least one of the -following places: within a NOTICE text file distributed as part of the -Derivative Works; within the Source form or documentation, if provided along -with the Derivative Works; or, within a display generated by the Derivative -Works, if and wherever such third-party notices normally appear. The contents of -the NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative Works that -You distribute, alongside or as an addendum to the NOTICE text from the Work, -provided that such additional attribution notices cannot be construed as -modifying the License. -You may add Your own copyright statement to Your modifications and may provide -additional or different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works as a whole, -provided Your use, reproduction, and distribution of the Work otherwise complies -with the conditions stated in this License. - -5. Submission of Contributions. - -Unless You explicitly state otherwise, any Contribution intentionally submitted -for inclusion in the Work by You to the Licensor shall be under the terms and -conditions of this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify the terms of -any separate license agreement you may have executed with Licensor regarding -such Contributions. - -6. Trademarks. - -This License does not grant permission to use the trade names, trademarks, -service marks, or product names of the Licensor, except as required for -reasonable and customary use in describing the origin of the Work and -reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. - -Unless required by applicable law or agreed to in writing, Licensor provides the -Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, -including, without limitation, any warranties or conditions of TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are -solely responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your exercise of -permissions under this License. - -8. Limitation of Liability. - -In no event and under no legal theory, whether in tort (including negligence), -contract, or otherwise, unless required by applicable law (such as deliberate -and grossly negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, incidental, -or consequential damages of any character arising as a result of this License or -out of the use or inability to use the Work (including but not limited to -damages for loss of goodwill, work stoppage, computer failure or malfunction, or -any and all other commercial damages or losses), even if such Contributor has -been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. - -While redistributing the Work or Derivative Works thereof, You may choose to -offer, and charge a fee for, acceptance of support, warranty, indemnity, or -other liability obligations and/or rights consistent with this License. However, -in accepting such obligations, You may act only on Your own behalf and on Your -sole responsibility, not on behalf of any other Contributor, and only if You -agree to indemnify, defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason of your -accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work - -To apply the Apache License to your work, attach the following boilerplate -notice, with the fields enclosed by brackets "{}" replaced with your own -identifying information. (Don't include the brackets!) The text should be -enclosed in the appropriate comment syntax for the file format. We also -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 - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - 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 +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. diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..ba17966 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,5 @@ +module.exports = { + presets: [ + '@vue/app' + ] +} diff --git a/build/build.js b/build/build.js deleted file mode 100644 index 34c71a5..0000000 --- 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 c29c7e7..0000000 --- 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/index.js b/build/index.js new file mode 100644 index 0000000..244ff4a --- /dev/null +++ b/build/index.js @@ -0,0 +1,27 @@ +const { run } = require('runjs') +const chalk = require('chalk') +const config = require('../vue.config.js') +const rawArgv = process.argv.slice(2) +const args = rawArgv.join(' ') + +if (process.env.npm_config_preview || rawArgv.includes('--preview')) { + const report = rawArgv.includes('--report') + + run(`vue-cli-service build ${args}`) + + const publicPath = config.publicPath + + var connect = require('connect') + var serveStatic = require('serve-static') + const app = connect() + + app.use( + publicPath, + serveStatic('./dist', { + index: ['index.html', '/'] + }) + ) + +} else { + run(`vue-cli-service build ${args}`) +} diff --git a/build/utils.js b/build/utils.js deleted file mode 100644 index c96d093..0000000 --- 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 5496c93..0000000 --- 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 7e8c4fc..0000000 --- a/build/webpack.base.conf.js +++ /dev/null @@ -1,122 +0,0 @@ -'use strict' -const path = require('path') -const utils = require('./utils') -const config = require('../config') -const { VueLoaderPlugin } = require('vue-loader') - -const os = require('os'); -const HappyPack = require('happypack'); -const happThreadPool = HappyPack.ThreadPool({size: os.cpus().length}); - -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 = { - cache: true, - context: path.resolve(__dirname, '../'), - entry:["babel-polyfill","./src/main.js"], - output: { - path: config.build.assetsRoot, - filename: '[name].js', - publicPath: - process.env.NODE_ENV === 'production' - ? config.build.assetsPublicPath - : config.dev.assetsPublicPath - }, - resolve: { - modules: [path.resolve(__dirname, '../node_modules')], - extensions: ['.js', '.vue', '.json'], - alias: { - '@': resolve('src'), - api: path.resolve(__dirname, '../src/api') - } - }, - module: { - rules: [ - ...(config.dev.useEslint ? [createLintingRule()] : []), - { - test: /\.vue$/, - loader: 'vue-loader', - options: { - loaders: { - js: 'happypack/loader?id=js' // 将loader换成happypack - } - } - }, - { - test: /\.js$/, - loader: ['happypack/loader?id=js'], // 将loader换成happypack - include: [ - resolve('src') - ], // src是项目开发的目录 - exclude: [path.resolve('../node_modules')] // 不需要编译node_modules下的js - }, - { - 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(), - new HappyPack({ - id: 'js', - cache: true, - loaders: ['babel-loader?cacheDirectory=true'], - threadPool: happThreadPool - }) - ], - 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 26a5584..0000000 --- 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 946a134..0000000 --- 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 0115503..0000000 --- a/config/dev.env.js +++ /dev/null @@ -1,9 +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"' - // BASE_API: '"https://api.auauz.net"' -}) diff --git a/config/index.js b/config/index.js deleted file mode 100644 index 48350f5..0000000 --- a/config/index.js +++ /dev/null @@ -1,106 +0,0 @@ -'use strict' -// Template version: 1.2.6 -const devEnv = require('./dev.env') -// 获取接口地址 -const base_url = devEnv.BASE_API.replace(/"/g,'') -const path = require('path') -module.exports = { - dev: { - // Paths - assetsSubDirectory: 'static', - assetsPublicPath: '/', - // 配置代理 - proxyTable: { - '/auth': { - // 测试环境 - target: base_url, - secure: true, - changeOrigin: true, - pathRewrite: { - '^/auth': 'auth' - } - }, - '/api': { - // 测试环境 - target: base_url, - secure: true, - changeOrigin: true, - pathRewrite: { - '^/api': 'api' - } - } - }, - - // 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 73e8fe1..0000000 --- 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/index.html b/index.html deleted file mode 100644 index c6b6210..0000000 --- a/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - -
- - - - - -pkNS3BY71MTpI wEDLM+NPfh4|AYBOj{$^y_^1?5qJLv(Nv=P9G0`Z28{bEJ
zQI&H4{!kwkMR^RgNRPg@H}_|*XhSxzI90ybGi4;B)Sy+gCS~%|&69nQ^NHFr4UOEW
zna-mWS}?*E>O`DO+;g|ohY)kKN4AC$zQF!4(DVqs1sv%PaJw8w3IIKDb5QAY?Nen$W7}Ft-R_5$X
zW>!v6M4u^6zvIa5bzX_eUEp6`-R+Cr5#!e}*GIGo$l&AspB4c0D7?J958u+q$A>xa
z#lP%Cf~rYHV)nWl(t_9YKZqU8x;GUr4hdW`T*dlR0o9wXC9r}cPg|Gz *5>(M?zc3=Uc=a^bCUNueJ5VUypGb@WRhrZTe7wn2q4oJlcr_!@ }i+&eZJ|mPV?`zY@*&Ea~-+eA;A~
zb!(txUEYNg&SoH1H&+mIjQyMIRx!L7MT7o4{l=+1<{yjG1EF9f*x9x+
zEwZs*GBGcAUUr$zAJzr!*i#+4b#01=>-*kO^uJASsl0U`lv>98V})rXfkR+x_!C+`
z0;NCjea32@uAMO?c`tm82A=I6B)jARGzJ5{X1<*EEZ(kNUjt$x`zgEBsKxCImP`6{
zllLW-Ae$ke#p`JOm!wp_$))%pr}~!$%VmnU7d)X8VR1x`XbI;R5Z~+%Ie%$ES@r<;
z4^
V!RR1
zaFg9k`2J$qw_n~JjsoCt*VV&Ze;eZOVS#f$mrvcuij~dBTehbAvqPYIC!O8wq{3VI
z_F3srQ$@?3E+K=HTtonSiu
hQt~HH{sbPl|Ru$#^~xQp8gkHZyj>e0U^vF?jq?QMGkYpZ`6Xe3dGzfoeLn^MDlbf}mAB^S)s_4NJt
z0=PNC5WlS|0e-JY8fzPFQ~D4YB1fS4S#wpiwrOWDM~N
O6*9BRgna
zmRr^aApo{^T^u}f2cz)R6T+SRPV#KiBN$#5M06nrKfvMtx{hTI<$03Vij}#Hm?9hs
zW=NW4e@)QT6p^FVLyx_?fb7L^AmSEV@O^e;i`O5tIfD&^Hd#i1Rf7SV%{BPTFL*L9-(S$(P
zr3~}D5%I%H`Gbzzg}UehPjXLt