From 0513d69838a70a53ce534cd6a8db6d0b5a3a2468 Mon Sep 17 00:00:00 2001 From: Aicirou <2643053021@qq.com> Date: Wed, 6 May 2020 20:45:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildAppJSPlugin.js | 86 +++++++++++++++ dependencies-cdn.js | 3 + {public => nginx}/nginx.conf | 0 package-lock.json | 135 ++---------------------- package.json | 3 +- public/app.js | 36 ------- public/favicon.ico | Bin 4286 -> 67646 bytes public/index.html | 15 ++- src/assets/style/theme/acrou/index.scss | 25 +---- src/locales/en.json | 3 + src/locales/zh-chs.json | 3 + src/locales/zh-cht.json | 3 + src/main.js | 8 -- src/plugin/buildapp/index.js | 29 +++++ src/router/index.js | 58 +++++----- src/router/routes.js | 8 +- src/utils/AcrouUtil.js | 10 +- src/views/Layout.vue | 4 +- src/views/common/BreadCrumb.vue | 14 ++- src/views/common/Navbar.vue | 3 +- src/views/page/GoImg.vue | 23 ++-- src/views/page/GoList.vue | 79 +++++--------- src/views/page/GoPdf.vue | 22 ++++ src/views/page/GoRouter.vue | 11 -- src/views/page/GoText.vue | 49 +++------ src/views/page/GoVideo.vue | 20 ++-- vue.config.js | 5 +- 27 files changed, 287 insertions(+), 368 deletions(-) create mode 100644 buildAppJSPlugin.js rename {public => nginx}/nginx.conf (100%) delete mode 100644 public/app.js create mode 100644 src/plugin/buildapp/index.js create mode 100644 src/views/page/GoPdf.vue delete mode 100644 src/views/page/GoRouter.vue diff --git a/buildAppJSPlugin.js b/buildAppJSPlugin.js new file mode 100644 index 0000000..794db82 --- /dev/null +++ b/buildAppJSPlugin.js @@ -0,0 +1,86 @@ +const cdnDependencies = require("./dependencies-cdn"); + +// 引入文件的 cdn 链接 +const cdn = { + css: cdnDependencies.map((e) => e.css).filter((e) => e), + js: cdnDependencies.map((e) => e.js).filter((e) => e), +}; + +class BuildAppJSPlugin { + apply(compiler) { + // emit 是异步 hook,使用 tapAsync 触及它,还可以使用 tapPromise/tap(同步) + compiler.hooks.emit.tapAsync( + "BuildAppJSPlugin", + (compilation, callback) => { + let cssarr = []; + let jsarr = []; + // 遍历所有编译过的资源文件, + // 对于每个文件名称,都添加一行内容。 + for (let filename in compilation.assets) { + if (process.env.NODE_ENV === "production") { + filename = (process.env.VUE_APP_PUBLIC_PATH || "/") + filename; + } else { + filename = "/" + filename; + } + // filename = "/" + filename; + + if (filename.match(".*\\.js$")) { + jsarr.push(filename); + } + if (filename.match(".*\\.css$")) { + cssarr.push(filename); + } + } + cssarr = cssarr.sort(function(a) { + return a.indexOf("app."); + }); + var cdnjs = '' + if (process.env.NODE_ENV === "production") { + cssarr = cdn.css.concat(cssarr); + cdnjs = `var cdnjs = ${JSON.stringify(cdn.js)}; + cdnjs.forEach((item) => { + document.write(''); + });` + } else { + cssarr = cssarr.concat(cdnDependencies + .filter((e) => e.name === "") + .map((e) => e.css)); + } + let content = ` + var styles = ${JSON.stringify(cssarr)}; + var scripts = ${JSON.stringify(jsarr)}; + ${cdnjs} + document.write('
'); + var title = document.getElementsByTagName('title') + styles.forEach((item) => { + let link = document.createElement('link'); + link.href=item; + link.rel = 'preload'; + link.as = 'style'; + title[0].parentNode.insertBefore(link,title[0]) + link = document.createElement('link'); + link.href=item; + link.rel = 'stylesheet'; + title[0].parentNode.insertBefore(link,title[0]) + }); + scripts.forEach((item) => { + document.write(''); + }); + `; + // 将这个列表作为一个新的文件资源,插入到 webpack 构建中: + compilation.assets["app.js"] = { + source: function() { + return content; + }, + size: function() { + return cssarr.length + jsarr.length; + }, + }; + + callback(); + } + ); + } +} + +module.exports = BuildAppJSPlugin; diff --git a/dependencies-cdn.js b/dependencies-cdn.js index 200a8d4..d46e4d6 100644 --- a/dependencies-cdn.js +++ b/dependencies-cdn.js @@ -3,6 +3,8 @@ module.exports = [ { name: 'vue-i18n', library: 'VueI18n', js: 'https://cdn.jsdelivr.net/npm/vue-i18n@8.17.3/dist/vue-i18n.min.js', css: '' }, { name: 'vue-router', library: 'VueRouter', js: 'https://cdn.jsdelivr.net/npm/vue-router@3.1.6/dist/vue-router.min.js', css: '' }, { name: 'axios', library: 'axios', js: 'https://cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js', css: '' }, + // { name: 'element-ui', library: 'ELEMENT', js: 'https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/index.js', css: 'https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/theme-chalk/index.css' }, + { name: 'js-cookie', library: 'Cookies', js: 'https://cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js', css: '' }, // { name: 'brace', library: 'ace', js: 'https://cdn.jsdelivr.net/npm/brace@0.11.1/index.min.js', css: '' }, // { name: 'brace/ext/language_tools', library: 'language_tools', js: ' https://cdn.jsdelivr.net/npm/brace@0.11.1/ext/language_tools.js', css: '' }, // { name: 'brace/mode/html', library: 'html', js: ' https://cdn.jsdelivr.net/npm/brace@0.11.1/mode/html.js', css: '' }, @@ -15,4 +17,5 @@ module.exports = [ { name: '', library: '', js: '', css: 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css' }, { name: '', library: '', js: '', css: 'https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css' }, { name: '', library: '', js: '', css: 'https://cdn.jsdelivr.net/npm/font-awesome-animation@0.2.1/dist/font-awesome-animation.min.css' }, + { name: '', library: '', js: '', css: 'https://cdn.jsdelivr.net/npm/bulma-pageloader@0.3.0/dist/css/bulma-pageloader.min.css' }, ] \ No newline at end of file diff --git a/public/nginx.conf b/nginx/nginx.conf similarity index 100% rename from public/nginx.conf rename to nginx/nginx.conf diff --git a/package-lock.json b/package-lock.json index 0e76542..ca3750b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2143,14 +2143,6 @@ "integrity": "sha1-3TeelPDbgxCwgpH51kwyCXZmF/0=", "dev": true }, - "async-validator": { - "version": "1.8.5", - "resolved": "https://registry.npm.taobao.org/async-validator/download/async-validator-1.8.5.tgz", - "integrity": "sha1-3D4I7B/Q3dtn5ghC8CwM0c7G1/A=", - "requires": { - "babel-runtime": "6.x" - } - }, "asynckit": { "version": "0.4.0", "resolved": "http://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz", @@ -2232,11 +2224,6 @@ "resolve": "^1.12.0" } }, - "babel-helper-vue-jsx-merge-props": { - "version": "2.0.3", - "resolved": "https://registry.npm.taobao.org/babel-helper-vue-jsx-merge-props/download/babel-helper-vue-jsx-merge-props-2.0.3.tgz", - "integrity": "sha1-Iq69OzOQIyjlEyk6jkmSs4T58bY=" - }, "babel-loader": { "version": "8.1.0", "resolved": "https://registry.npm.taobao.org/babel-loader/download/babel-loader-8.1.0.tgz?cache=0&sync_timestamp=1584717315701&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbabel-loader%2Fdownload%2Fbabel-loader-8.1.0.tgz", @@ -2291,27 +2278,6 @@ "object.assign": "^4.1.0" } }, - "babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - }, - "dependencies": { - "core-js": { - "version": "2.6.11", - "resolved": "https://registry.npm.taobao.org/core-js/download/core-js-2.6.11.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-2.6.11.tgz", - "integrity": "sha1-OIMUafmSK97Y7iHJ3EaYXgOZMIw=" - }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.11.1.tgz?cache=0&sync_timestamp=1584052392667&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fregenerator-runtime%2Fdownload%2Fregenerator-runtime-0.11.1.tgz", - "integrity": "sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk=" - } - } - }, "balanced-match": { "version": "1.0.0", "resolved": "http://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz", @@ -2384,11 +2350,6 @@ "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", "dev": true }, - "batch-processor": { - "version": "1.0.0", - "resolved": "https://registry.npm.taobao.org/batch-processor/download/batch-processor-1.0.0.tgz", - "integrity": "sha1-dclcMrdI4IUNEMKxaPa9vpiRrOg=" - }, "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "http://registry.npm.taobao.org/bcrypt-pbkdf/download/bcrypt-pbkdf-1.0.2.tgz", @@ -3185,6 +3146,11 @@ "integrity": "sha1-sEM9C06chH7xiGik7xb9X8gnHEg=", "dev": true }, + "clipboard-polyfill": { + "version": "2.8.6", + "resolved": "https://registry.npm.taobao.org/clipboard-polyfill/download/clipboard-polyfill-2.8.6.tgz", + "integrity": "sha1-GdJyg/EfKTO7GHNyY7mLjJW1oPc=" + }, "clipboardy": { "version": "2.3.0", "resolved": "https://registry.npm.taobao.org/clipboardy/download/clipboardy-2.3.0.tgz", @@ -3952,7 +3918,8 @@ "deepmerge": { "version": "1.5.2", "resolved": "https://registry.npm.taobao.org/deepmerge/download/deepmerge-1.5.2.tgz", - "integrity": "sha1-EEmdhohEza1P7ghC34x/bwyVp1M=" + "integrity": "sha1-EEmdhohEza1P7ghC34x/bwyVp1M=", + "dev": true }, "default-gateway": { "version": "5.0.5", @@ -4404,27 +4371,6 @@ "integrity": "sha1-nQqS3v79p8wc+IlQWLiSeV3da0E=", "dev": true }, - "element-resize-detector": { - "version": "1.2.1", - "resolved": "https://registry.npm.taobao.org/element-resize-detector/download/element-resize-detector-1.2.1.tgz", - "integrity": "sha1-sDBRlER6SGMVXljxMyOgrvMIUdE=", - "requires": { - "batch-processor": "1.0.0" - } - }, - "element-ui": { - "version": "2.13.1", - "resolved": "https://registry.npm.taobao.org/element-ui/download/element-ui-2.13.1.tgz", - "integrity": "sha1-DLGkXPJ6phxgHe++GSdArFy533w=", - "requires": { - "async-validator": "~1.8.1", - "babel-helper-vue-jsx-merge-props": "^2.0.0", - "deepmerge": "^1.2.0", - "normalize-wheel": "^1.0.1", - "resize-observer-polyfill": "^1.5.0", - "throttle-debounce": "^1.0.1" - } - }, "elliptic": { "version": "6.5.2", "resolved": "https://registry.npm.taobao.org/elliptic/download/elliptic-6.5.2.tgz", @@ -7147,33 +7093,6 @@ "resolved": "http://registry.npm.taobao.org/isstream/download/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, - "iview": { - "version": "3.5.4", - "resolved": "https://registry.npm.taobao.org/iview/download/iview-3.5.4.tgz?cache=0&sync_timestamp=1575428499080&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fiview%2Fdownload%2Fiview-3.5.4.tgz", - "integrity": "sha1-1Ra5LnO2F/Lcf0WDH5kFnWmTL4I=", - "requires": { - "async-validator": "^1.12.2", - "deepmerge": "^2.2.1", - "element-resize-detector": "^1.2.0", - "js-calendar": "^1.2.3", - "lodash.throttle": "^4.1.1", - "popper.js": "^1.14.6", - "tinycolor2": "^1.4.1", - "v-click-outside-x": "^4.0.19" - }, - "dependencies": { - "async-validator": { - "version": "1.12.2", - "resolved": "https://registry.npm.taobao.org/async-validator/download/async-validator-1.12.2.tgz", - "integrity": "sha1-vq5nHnF00pOLe0tp0vt+cit/1yw=" - }, - "deepmerge": { - "version": "2.2.1", - "resolved": "https://registry.npm.taobao.org/deepmerge/download/deepmerge-2.2.1.tgz", - "integrity": "sha1-XT/yKgHAD2RUBaL7wX0HeKGAEXA=" - } - } - }, "javascript-stringify": { "version": "2.0.1", "resolved": "https://registry.npm.taobao.org/javascript-stringify/download/javascript-stringify-2.0.1.tgz", @@ -7212,11 +7131,6 @@ "resolved": "https://registry.npm.taobao.org/js-base64/download/js-base64-2.5.2.tgz", "integrity": "sha1-MTtidN2nGPcU0AszMLuubjjpAgk=" }, - "js-calendar": { - "version": "1.2.3", - "resolved": "https://registry.npm.taobao.org/js-calendar/download/js-calendar-1.2.3.tgz", - "integrity": "sha1-pYOwZEtOaVujlPNE0QPbzHp6fT4=" - }, "js-cookie": { "version": "2.2.1", "resolved": "https://registry.npm.taobao.org/js-cookie/download/js-cookie-2.2.1.tgz", @@ -7547,11 +7461,6 @@ "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", "dev": true }, - "lodash.throttle": { - "version": "4.1.1", - "resolved": "https://registry.npm.taobao.org/lodash.throttle/download/lodash.throttle-4.1.1.tgz", - "integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=" - }, "lodash.transform": { "version": "4.6.0", "resolved": "http://registry.npm.taobao.org/lodash.transform/download/lodash.transform-4.6.0.tgz", @@ -8305,11 +8214,6 @@ "integrity": "sha1-suHE3E98bVd0PfczpPWXjRhlBVk=", "dev": true }, - "normalize-wheel": { - "version": "1.0.1", - "resolved": "https://registry.npm.taobao.org/normalize-wheel/download/normalize-wheel-1.0.1.tgz", - "integrity": "sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU=" - }, "npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npm.taobao.org/npm-run-path/download/npm-run-path-2.0.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnpm-run-path%2Fdownload%2Fnpm-run-path-2.0.2.tgz", @@ -8945,11 +8849,6 @@ "ts-pnp": "^1.1.6" } }, - "popper.js": { - "version": "1.16.1", - "resolved": "https://registry.npm.taobao.org/popper.js/download/popper.js-1.16.1.tgz", - "integrity": "sha1-KiI8s9x7YhPXQOQDcr5A3kPmWxs=" - }, "portfinder": { "version": "1.0.25", "resolved": "https://registry.npm.taobao.org/portfinder/download/portfinder-1.0.25.tgz", @@ -10139,11 +10038,6 @@ "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", "dev": true }, - "resize-observer-polyfill": { - "version": "1.5.1", - "resolved": "https://registry.npm.taobao.org/resize-observer-polyfill/download/resize-observer-polyfill-1.5.1.tgz", - "integrity": "sha1-DpAg3T0hAkRY1OvSfiPkAmmBBGQ=" - }, "resolve": { "version": "1.17.0", "resolved": "https://registry.npm.taobao.org/resolve/download/resolve-1.17.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fresolve%2Fdownload%2Fresolve-1.17.0.tgz", @@ -11484,11 +11378,6 @@ "neo-async": "^2.6.0" } }, - "throttle-debounce": { - "version": "1.1.0", - "resolved": "https://registry.npm.taobao.org/throttle-debounce/download/throttle-debounce-1.1.0.tgz", - "integrity": "sha1-UYU9o3vmihVctugns1FKPEIuic0=" - }, "through": { "version": "2.3.8", "resolved": "http://registry.npm.taobao.org/through/download/through-2.3.8.tgz", @@ -11526,11 +11415,6 @@ "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", "dev": true }, - "tinycolor2": { - "version": "1.4.1", - "resolved": "https://registry.npm.taobao.org/tinycolor2/download/tinycolor2-1.4.1.tgz", - "integrity": "sha1-9PrTM0R7wLB9TcjpIJ2POaisd+g=" - }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npm.taobao.org/tmp/download/tmp-0.0.33.tgz", @@ -11975,11 +11859,6 @@ "resolved": "https://registry.npm.taobao.org/uuid/download/uuid-3.4.0.tgz?cache=0&sync_timestamp=1585683718911&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fuuid%2Fdownload%2Fuuid-3.4.0.tgz", "integrity": "sha1-sj5DWK+oogL+ehAK8fX4g/AgB+4=" }, - "v-click-outside-x": { - "version": "4.1.0", - "resolved": "https://registry.npm.taobao.org/v-click-outside-x/download/v-click-outside-x-4.1.0.tgz", - "integrity": "sha1-voJmgOLSVmaooYUzKSnUYkSqJEc=" - }, "v8-compile-cache": { "version": "2.1.0", "resolved": "https://registry.npm.taobao.org/v8-compile-cache/download/v8-compile-cache-2.1.0.tgz", diff --git a/package.json b/package.json index c247be0..a903cdc 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,8 @@ "dependencies": { "axios": "^0.19.2", "bulma": "^0.8.2", + "clipboard-polyfill": "^2.8.6", "core-js": "^3.6.4", - "element-ui": "^2.13.1", - "iview": "^3.5.4", "js-cookie": "^2.2.1", "markdown-it": "^10.0.0", "node-sass": "^4.14.0", diff --git a/public/app.js b/public/app.js deleted file mode 100644 index d5dd9bf..0000000 --- a/public/app.js +++ /dev/null @@ -1,36 +0,0 @@ -var styles = [ - 'https://cdn.jsdelivr.net/npm/bulma@0.8.2/css/bulma.min.css', - 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css', - 'https://cdn.jsdelivr.net/npm/font-awesome@latest/css/font-awesome.min.css', - 'https://cdn.jsdelivr.net/npm/font-awesome-animation@0.2.1/dist/font-awesome-animation.min.css', - 'https://cloud.jsonpop.cn/go2index/vue/dist/css/app.15d37280.css', -]; -var scripts = [ - "https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js", - "https://cdn.jsdelivr.net/npm/vue-i18n@8.17.3/dist/vue-i18n.min.js", - "https://cdn.jsdelivr.net/npm/vue-router@3.1.6/dist/vue-router.min.js", - "https://cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js", - // 'https://cdn.jsdelivr.net/npm/brace@0.11.1/index.min.js', - // 'https://cdn.jsdelivr.net/npm/brace@0.11.1/ext/language_tools.js', - // 'https://cdn.jsdelivr.net/npm/brace@0.11.1/mode/html.js', - // 'https://cdn.jsdelivr.net/npm/brace@0.11.1/mode/javascript.js', - // 'https://cdn.jsdelivr.net/npm/brace@0.11.1/mode/less.js', - // 'https://cdn.jsdelivr.net/npm/brace@0.11.1/theme/chrome.js', - // 'https://cdn.jsdelivr.net/npm/brace@0.11.1/snippets/javascript.js', - "https://cdn.jsdelivr.net/npm/markdown-it@10.0.0/dist/markdown-it.min.js", - 'https://cloud.jsonpop.cn/go2index/vue/dist/js/chunk-1ed22f12.64aeb3d6.js', - 'https://cloud.jsonpop.cn/go2index/vue/dist/js/chunk-vendors.1a3ef683.js', - 'https://cloud.jsonpop.cn/go2index/vue/dist/js/chunk-4850b756.160c2c8c.js', - 'https://cloud.jsonpop.cn/go2index/vue/dist/js/app.f314926a.js', - 'https://cloud.jsonpop.cn/go2index/vue/dist/js/chunk-56b11c46.cc8e90e1.js', - 'https://cloud.jsonpop.cn/go2index/vue/dist/js/chunk-6a24b24e.b8a4da9e.js', - 'https://cloud.jsonpop.cn/go2index/vue/dist/js/chunk-2d0aed92.7e4c9d1b.js', - 'https://cloud.jsonpop.cn/go2index/vue/dist/js/chunk-2d2137a3.5bc616b8.js', -]; - -styles.forEach((item) => { - document.write(``); -}); -scripts.forEach((item) => { - document.write(``); -}); diff --git a/public/favicon.ico b/public/favicon.ico index df36fcfb72584e00488330b560ebcf34a41c64c2..bf516e85adce2db5e04142c4f68b266888a19da9 100644 GIT binary patch literal 67646 zcmeI5349bq_Q!h&2pBnB6g)`g$N`ApssaD{N4XUwArK&(B8MQ#A>b{-^du~@Kp+VO zMUYD*2!?9~bx}ZF5Ag4z5)sjrEMDAXdS;T4tNy>&Gd-D1X2KlZ$qb*4pJ#XV^if^k zSFh^Tt7VT>Pst%|+pz46C1F8VT>Pst%|+5QaLS0` z;Um9hj$wahjx2m*QFeTBRx+nES)x$BTOp+(QqIIYSH}x^A(EeJ`qwq%JvMrG6x*@3 z7h_9?vZAbk%oc`nV(Iw2qNRx(%D6dXM~Id6N#rLV5>oYF&zsrgE#27UojNvkYXUow zJ)E(nLzp!T`IF8TWIU39GS)zh5CKw6*XuD|uIH@<_4s^`<ax_HBocNy&k-V@`8%KNOPyK*#yQ0}Mx%ad4nZsH6vO(e64iv9llpP0~ z`xeT)ECkA(?0-n~|GF;ur$_dZ4WRAt-8!~;%|KSMBsFaP!J@3>RXUSxI@n(b5&mS0 z>ec_#o6Ky&<_Bx#Pc~o@{K08k?`9{KlRuaeo;DzJV8x2Xs|KUY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p}sG5x0U*z<8U;Ij*hB9z?ei z@g6Xq-pDoPl=MANPiR7%172VA%r)kevtV-_5H*QJKFmd;8yA$98zCxBZYXTNZ#QFk2(TX0;Y2dt&WitL#$96|gJY=3xX zpCoi|YNzgO3R`f@IiEeSmKrPSf#h#Qd<$%Ej^RIeeYfsxhPMOG`S`Pz8q``=511zm zAm)MX5AV^5xIWPyEu7u>qYs?pn$I4nL9J!=K=SGlKLXpE<5x+2cDTXq?brj?n6sp= zphe9;_JHf40^9~}9i08r{XM$7HB!`{Ys~TK0kx<}ZQng`UPvH*11|q7&l9?@FQz;8 zx!=3<4seY*%=OlbCbcae?5^V_}*K>Uo6ZWV8mTyE^B=DKy7-sdLYkR5Z?paTgK-zyIkKjIcpyO z{+uIt&YSa_$QnN_@t~L014dyK(fOOo+W*MIxbA6Ndgr=Y!f#Tokqv}n<7-9qfHkc3 z=>a|HWqcX8fzQCT=dqVbogRq!-S>H%yA{1w#2Pn;=e>JiEj7Hl;zdt-2f+j2%DeVD zsW0Ab)ZK@0cIW%W7z}H{&~yGhn~D;aiP4=;m-HCo`BEI+Kd6 z={Xwx{TKxD#iCLfl2vQGDitKtN>z|-AdCN|$jTFDg0m3O`WLD4_s#$S diff --git a/public/index.html b/public/index.html index c05452f..826b528 100644 --- a/public/index.html +++ b/public/index.html @@ -10,10 +10,6 @@ <% } %> - - <% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %> - - <% } %> <%= htmlWebpackPlugin.options.title %> + + <% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %> + + <% } %> + -
- - <% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %> - - <% } %> + diff --git a/src/assets/style/theme/acrou/index.scss b/src/assets/style/theme/acrou/index.scss index bb2e8ee..22410da 100644 --- a/src/assets/style/theme/acrou/index.scss +++ b/src/assets/style/theme/acrou/index.scss @@ -94,6 +94,7 @@ body { padding-top: 0; background: hsla(0, 0%, 100%, 0.6); will-change: initial; + z-index: 1; .title { color: hsl(0, 0%, 4%); @@ -136,28 +137,4 @@ body { border: 5px solid transparent; position: absolute; left: 7px; -} - -.el-table table, -tbody, -thead { - width: 100% !important; -} -.el-table colgroup { -// position: absolute; - width: 100% !important; - display: flex; -} -.el-table col { - flex: 1; - text-align: center; -} -.el-table td, .el-table th.is-leaf{ - // width: 100%; - border-bottom: initial; -} -.el-table td{ - &:hover{ - cursor: pointer; - } } \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index 6d57f3b..bd6f300 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1,7 +1,9 @@ { "_name": "English", "languages": "Languages", + "index": "Index", "list": { + "auth": "Directory encryption, please enter password", "title": { "file": "File", "moditime": "Modified Time", @@ -10,6 +12,7 @@ }, "loading": "Loading...", "opt": { + "copy": "Copy link", "newTab": "Open a new tab", "download": "Download" } diff --git a/src/locales/zh-chs.json b/src/locales/zh-chs.json index b301907..d56b8bd 100644 --- a/src/locales/zh-chs.json +++ b/src/locales/zh-chs.json @@ -1,7 +1,9 @@ { "_name": "简体中文", "languages": "选择语言", + "index": "首页", "list": { + "auth": "目录加密,请输入密码", "title": { "file": "文件", "moditime": "修改时间", @@ -10,6 +12,7 @@ }, "loading": "加载中...", "opt": { + "copy": "复制链接", "newTab": "打开新的标签页", "download": "下载" } diff --git a/src/locales/zh-cht.json b/src/locales/zh-cht.json index 0194be6..fdaae38 100644 --- a/src/locales/zh-cht.json +++ b/src/locales/zh-cht.json @@ -1,7 +1,9 @@ { "_name": "繁体中文", "languages": "選擇語言", + "index": "首頁", "list": { + "auth": "目錄加密,請輸入密碼", "title": { "file": "文件", "moditime": "修改時間", @@ -10,6 +12,7 @@ }, "loading": "加載中...", "opt": { + "copy": "復制鏈接", "newTab": "打開新的標簽頁", "download": "下載" } diff --git a/src/main.js b/src/main.js index 1689072..ba03521 100644 --- a/src/main.js +++ b/src/main.js @@ -1,20 +1,12 @@ import Vue from 'vue' import App from './App.vue' -import ElementUI from 'element-ui' -import 'element-ui/lib/theme-chalk/index.css' -import iView from 'iview' -import 'iview/dist/styles/iview.css' import axios from '@utils/axios' import VueAxios from 'vue-axios' import router from './router' import i18n from './i18n' import "@/assets/style/theme/register.scss" -document.write('
') - Vue.config.productionTip = false -Vue.use(ElementUI) -Vue.use(iView) Vue.use(VueAxios,axios) new Vue({ diff --git a/src/plugin/buildapp/index.js b/src/plugin/buildapp/index.js new file mode 100644 index 0000000..13468e9 --- /dev/null +++ b/src/plugin/buildapp/index.js @@ -0,0 +1,29 @@ +class BuildAppJSPlugin { + apply(compiler) { + // emit 是异步 hook,使用 tapAsync 触及它,还可以使用 tapPromise/tap(同步) + compiler.hooks.emit.tapAsync("BuildAppJSPlugin", (compilation, callback) => { + // 在生成文件中,创建一个头部字符串: + var filelist = "In this build:\n\n"; + + // 遍历所有编译过的资源文件, + // 对于每个文件名称,都添加一行内容。 + for (var filename in compilation.assets) { + filelist += "- " + filename + "\n"; + } + + // 将这个列表作为一个新的文件资源,插入到 webpack 构建中: + compilation.assets["filelist.md"] = { + source: function() { + return filelist; + }, + size: function() { + return filelist.length; + }, + }; + + callback(); + }); + } +} + +module.exports = BuildAppJSPlugin; diff --git a/src/router/index.js b/src/router/index.js index 3441d50..5ae3c47 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,46 +1,42 @@ -import Vue from 'vue' -import VueRouter from 'vue-router' +import Vue from "vue"; +import VueRouter from "vue-router"; // 路由数据 -import routes from './routes' +import routes from "./routes"; // fix vue-router NavigationDuplicated -const VueRouterPush = VueRouter.prototype.push -VueRouter.prototype.push = function push (location) { - return VueRouterPush.call(this, location).catch(err => err) -} -const VueRouterReplace = VueRouter.prototype.replace -VueRouter.prototype.replace = function replace (location) { - return VueRouterReplace.call(this, location).catch(err => err) -} +const VueRouterPush = VueRouter.prototype.push; +VueRouter.prototype.push = function push(location) { + return VueRouterPush.call(this, location).catch((err) => err); +}; +const VueRouterReplace = VueRouter.prototype.replace; +VueRouter.prototype.replace = function replace(location) { + return VueRouterReplace.call(this, location).catch((err) => err); +}; -Vue.use(VueRouter) +Vue.use(VueRouter); // 导出路由 在 main.js 里使用 const router = new VueRouter({ - mode: 'history', - /* scrollBehavior(to,from,savePosition){ - if(savePosition) { - return savePosition; - }else{ - return {x:0,y:0} - } - }, */ - routes -}) + mode: "history", + scrollBehavior(to, from, savePosition) { + return { x: 0, y: 0 }; + }, + routes, +}); /** * 路由拦截 * 权限验证 */ router.beforeEach(async (to, from, next) => { - console.log("before:") - console.log(to) - next() -}) + console.log("before:"); + console.log(to); + next(); +}); -router.afterEach(to => { - console.log("after:") - console.log(to) -}) +router.afterEach((to) => { + console.log("after:"); + console.log(to); +}); -export default router +export default router; diff --git a/src/router/routes.js b/src/router/routes.js index 2ec5355..3de7bd9 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -2,10 +2,10 @@ const _import = require('@/libs/util.import.' + process.env.NODE_ENV) const frameIn = [ - { path: '/:id:/*.(html|php|css|go|java|py|js|json|txt|sh|md)', component: _import('page/GoText') }, - { path: '/:id:/*.(mp4|webm|mkv)', component: _import('page/GoVideo') }, - { path: '/:id:/*.(bmp|jpg|jpeg|png|gif)', component: _import('page/GoImg') }, - { path: '/:id::cmd?(/?/??.*)', component: _import('page/GoList') }, + { path: '/:id:(text/.*\\.)(html|php|css|go|java|py|js|json|txt|sh|md)', component: _import('page/GoText') }, + { path: '/:id:(video/.*\\.)(mp4|webm|mkv)', component: _import('page/GoVideo') }, + { path: '/:id:(image/.*\\.)(bmp|jpg|jpeg|png|gif)', component: _import('page/GoImg') }, + { path: '/:id::cmd?(/?/??.*/)', component: _import('page/GoList') }, ] export default frameIn diff --git a/src/utils/AcrouUtil.js b/src/utils/AcrouUtil.js index 24840ac..acbfb7c 100644 --- a/src/utils/AcrouUtil.js +++ b/src/utils/AcrouUtil.js @@ -24,16 +24,16 @@ const exts = [ export const checkoutPath = (path, file) => { // 解决/css这种也会匹配的问题 - var ext = path.split(".").length > 1 ? path.split(".").pop() : ""; - if (exts.indexOf(`${ext}`) >= 0) { - path += "?a=view"; - } else { + // var ext = path.split(".").length > 1 ? path.split(".").pop() : ""; + // if (exts.indexOf(`${ext}`) >= 0) { + // path += "?a=view"; + // } else { if (file.mimeType === "application/vnd.google-apps.folder") { if (path.substr(-1) !== "/") { path += "/"; } } - } + // } return path; }; diff --git a/src/views/Layout.vue b/src/views/Layout.vue index c54e5ea..3a36d0e 100644 --- a/src/views/Layout.vue +++ b/src/views/Layout.vue @@ -4,9 +4,9 @@
- + - +
diff --git a/src/views/common/BreadCrumb.vue b/src/views/common/BreadCrumb.vue index c63cd8a..c883dbd 100644 --- a/src/views/common/BreadCrumb.vue +++ b/src/views/common/BreadCrumb.vue @@ -1,6 +1,9 @@ \ No newline at end of file diff --git a/src/views/page/GoVideo.vue b/src/views/page/GoVideo.vue index ec3e544..83d30b9 100644 --- a/src/views/page/GoVideo.vue +++ b/src/views/page/GoVideo.vue @@ -94,16 +94,20 @@ export default { }; }, methods: { - // render (path) { - // this.videourl = window.location.origin + path; - // this.apiurl = - // "https://api.jsonpop.cn/demo/blplyaer/?url=" + this.videourl; - // }, + render() { + // 便于开发环境调试 + this.videourl = window.location.origin + window.location.pathname; + this.apiurl = + "https://api.jsonpop.cn/demo/blplyaer/?url=" + this.videourl; + } }, mounted() { - // 便于开发环境调试 - this.videourl = window.location.origin + window.location.pathname; - this.apiurl = "https://api.jsonpop.cn/demo/blplyaer/?url=" + this.videourl; + this.render(); + }, + watch: { + $route(to, from) { + this.render(); + } }, computed: { getThunder() { diff --git a/vue.config.js b/vue.config.js index 4bdf3da..45f9fed 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,5 +1,6 @@ const path = require("path"); const cdnDependencies = require("./dependencies-cdn"); +const BuildAppJSPlugin = require("./buildAppJSPlugin"); function resolve(dir) { return path.join(__dirname, dir); @@ -32,6 +33,7 @@ module.exports = { }, chainWebpack: (config) => { + config.plugin("BuildAppJSPlugin").use(BuildAppJSPlugin); /** * 添加 CDN 参数到 htmlWebpackPlugin 配置中 */ @@ -40,9 +42,10 @@ module.exports = { args[0].cdn = cdn; } else { args[0].cdn = { - css: cdnDependencies.filter((e) => e.name==="").map((e) => e.css), + css: cdnDependencies.filter((e) => e.name === "").map((e) => e.css), }; } + args[0].inject = false return args; }); config.resolve.alias