diff --git a/.gitignore b/.gitignore index a0dddc6..df79a09 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .DS_Store node_modules /dist +src/test # local env files .env.local diff --git a/dependencies-cdn.js b/dependencies-cdn.js index 1bcd3fa..5e4b59d 100644 --- a/dependencies-cdn.js +++ b/dependencies-cdn.js @@ -17,5 +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' }, + // { 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/package-lock.json b/package-lock.json index b600fc5..4b7bc3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2692,6 +2692,11 @@ "resolved": "https://registry.npm.taobao.org/bulma/download/bulma-0.8.2.tgz", "integrity": "sha1-XZKPFu1KhFScKHP5XJLDjGnGMac=" }, + "bulma-pageloader": { + "version": "0.3.0", + "resolved": "https://registry.npm.taobao.org/bulma-pageloader/download/bulma-pageloader-0.3.0.tgz", + "integrity": "sha1-lKT/fZEpy+AdvFyuTmRQjhNWPPE=" + }, "bytes": { "version": "3.1.0", "resolved": "https://registry.npm.taobao.org/bytes/download/bytes-3.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbytes%2Fdownload%2Fbytes-3.1.0.tgz", @@ -3180,10 +3185,15 @@ "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=" + "clipboard": { + "version": "2.0.6", + "resolved": "https://registry.npm.taobao.org/clipboard/download/clipboard-2.0.6.tgz?cache=0&sync_timestamp=1583389652647&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fclipboard%2Fdownload%2Fclipboard-2.0.6.tgz", + "integrity": "sha1-UpISlu7A/fd+rRdJQhshyWhkc3Y=", + "requires": { + "good-listener": "^1.2.2", + "select": "^1.1.2", + "tiny-emitter": "^2.0.0" + } }, "clipboardy": { "version": "2.3.0", @@ -4177,6 +4187,11 @@ "resolved": "http://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, + "delegate": { + "version": "3.2.0", + "resolved": "https://registry.npm.taobao.org/delegate/download/delegate-3.2.0.tgz", + "integrity": "sha1-tmtxwxWFIuirV0T3INjKDCr1kWY=" + }, "delegates": { "version": "1.0.0", "resolved": "http://registry.npm.taobao.org/delegates/download/delegates-1.0.0.tgz", @@ -6132,6 +6147,14 @@ "minimatch": "~3.0.2" } }, + "good-listener": { + "version": "1.2.2", + "resolved": "https://registry.npm.taobao.org/good-listener/download/good-listener-1.2.2.tgz", + "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=", + "requires": { + "delegate": "^3.1.2" + } + }, "graceful-fs": { "version": "4.2.3", "resolved": "https://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.2.3.tgz", @@ -10411,6 +10434,11 @@ } } }, + "select": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/select/download/select-1.1.2.tgz", + "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=" + }, "select-hose": { "version": "2.0.0", "resolved": "http://registry.npm.taobao.org/select-hose/download/select-hose-2.0.0.tgz", @@ -11476,6 +11504,11 @@ "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", "dev": true }, + "tiny-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/tiny-emitter/download/tiny-emitter-2.1.0.tgz", + "integrity": "sha1-HRpW7fxRxD6GPLtTgqcjMONVVCM=" + }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npm.taobao.org/tmp/download/tmp-0.0.33.tgz", @@ -12006,6 +12039,14 @@ } } }, + "vue-clipboard2": { + "version": "0.3.1", + "resolved": "https://registry.npm.taobao.org/vue-clipboard2/download/vue-clipboard2-0.3.1.tgz", + "integrity": "sha1-blUft704SImyiw2jsSKJ7WvKSJQ=", + "requires": { + "clipboard": "^2.0.0" + } + }, "vue-eslint-parser": { "version": "7.0.0", "resolved": "https://registry.npm.taobao.org/vue-eslint-parser/download/vue-eslint-parser-7.0.0.tgz", @@ -12327,7 +12368,7 @@ }, "webpack-bundle-analyzer": { "version": "3.7.0", - "resolved": "https://registry.npm.taobao.org/webpack-bundle-analyzer/download/webpack-bundle-analyzer-3.7.0.tgz?cache=0&sync_timestamp=1586846559504&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwebpack-bundle-analyzer%2Fdownload%2Fwebpack-bundle-analyzer-3.7.0.tgz", + "resolved": "https://registry.npm.taobao.org/webpack-bundle-analyzer/download/webpack-bundle-analyzer-3.7.0.tgz?cache=0&sync_timestamp=1586846510646&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwebpack-bundle-analyzer%2Fdownload%2Fwebpack-bundle-analyzer-3.7.0.tgz", "integrity": "sha1-hNpDTolEKJm4hNmtOORm0NsCpW8=", "dev": true, "requires": { diff --git a/package.json b/package.json index 4890874..1c4dfb6 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "dependencies": { "axios": "^0.19.2", "bulma": "^0.8.2", - "clipboard-polyfill": "^2.8.6", + "bulma-pageloader": "^0.3.0", "core-js": "^3.6.4", "element-ui": "^2.13.1", "js-base64": "^2.5.2", @@ -22,6 +22,7 @@ "sass-loader": "^8.0.2", "vue": "^2.6.11", "vue-axios": "^2.1.5", + "vue-clipboard2": "^0.3.1", "vue-i18n": "^8.17.3", "vue-router": "^3.1.6", "vue2-ace-editor": "0.0.15" diff --git a/src/assets/style/theme/acrou/index.scss b/src/assets/style/theme/acrou/index.scss index 22410da..64a538f 100644 --- a/src/assets/style/theme/acrou/index.scss +++ b/src/assets/style/theme/acrou/index.scss @@ -51,6 +51,12 @@ body { cursor: pointer; } } + td span { + vertical-align: middle; + } + td .g2-file-desc{ + font-size:12px; + } } .footer { @@ -137,4 +143,4 @@ body { border: 5px solid transparent; position: absolute; left: 7px; -} \ No newline at end of file +} diff --git a/src/assets/style/theme/register.scss b/src/assets/style/theme/register.scss index 0e7d9d7..81ba836 100644 --- a/src/assets/style/theme/register.scss +++ b/src/assets/style/theme/register.scss @@ -1,2 +1,3 @@ @import 'bulma'; +// @import 'bulma-pageloader'; @import '~@/assets/style/theme/acrou/index.scss'; \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index bd6f300..dd23c14 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -2,27 +2,40 @@ "_name": "English", "languages": "Languages", "index": "Index", + "folder": "Folder", + "notify": { + "title": "Notify" + }, + "copy": { + "success": "Copy successful", + "error": "Copy failed" + }, "list": { "auth": "Directory encryption, please enter password", "title": { - "file": "File", - "moditime": "Modified Time", - "size": "Size", - "operation": "Operation" + "file": "File", + "moditime": "Modified Time", + "size": "Size", + "operation": "Operation" }, "loading": "Loading...", "opt": { - "copy": "Copy link", - "newTab": "Open a new tab", - "download": "Download" + "copy": "Copy link", + "newTab": "Open a new tab", + "download": "Download" } }, "search": { - "placeholder": "Search or jump to…" + "placeholder": "Search or jump to…" }, "page": { - "text": { - "loading": "Loading..." - } + "video": { + "play": "Play", + "download": "Download", + "link": "Download link" + }, + "text": { + "loading": "Loading..." + } } -} \ No newline at end of file +} diff --git a/src/locales/zh-chs.json b/src/locales/zh-chs.json index d56b8bd..e8750ff 100644 --- a/src/locales/zh-chs.json +++ b/src/locales/zh-chs.json @@ -2,6 +2,14 @@ "_name": "简体中文", "languages": "选择语言", "index": "首页", + "folder": "文件夹", + "notify": { + "title": "提示" + }, + "copy": { + "success": "复制成功", + "error": "复制失败" + }, "list": { "auth": "目录加密,请输入密码", "title": { @@ -21,6 +29,11 @@ "placeholder": "搜索..." }, "page": { + "video": { + "play": "播放", + "download": "下载", + "link": "下载地址" + }, "text": { "loading": "加载中..." } diff --git a/src/locales/zh-cht.json b/src/locales/zh-cht.json index fdaae38..86babd0 100644 --- a/src/locales/zh-cht.json +++ b/src/locales/zh-cht.json @@ -2,6 +2,14 @@ "_name": "繁体中文", "languages": "選擇語言", "index": "首頁", + "folder": "文件夾", + "notify": { + "title": "提示" + }, + "copy": { + "success": "復制成功", + "error": "復制失敗" + }, "list": { "auth": "目錄加密,請輸入密碼", "title": { @@ -21,6 +29,11 @@ "placeholder": "搜索..." }, "page": { + "video": { + "play": "播放", + "download": "下載", + "link": "下載地址" + }, "text": { "loading": "加載中..." } diff --git a/src/main.js b/src/main.js index 66c5022..a68f2bd 100644 --- a/src/main.js +++ b/src/main.js @@ -4,15 +4,19 @@ import ElementUI from 'element-ui' import 'element-ui/lib/theme-chalk/color-picker.css' import 'element-ui/lib/theme-chalk/base.css' import 'element-ui/lib/theme-chalk/button.css' +import 'element-ui/lib/theme-chalk/notification.css' +import 'element-ui/lib/theme-chalk/loading.css' import axios from '@utils/axios' import VueAxios from 'vue-axios' import router from './router' import i18n from './i18n' +import VueClipboard from 'vue-clipboard2' import "@/assets/style/theme/register.scss" Vue.config.productionTip = false Vue.use(ElementUI) Vue.use(VueAxios,axios) +Vue.use(VueClipboard) new Vue({ router, diff --git a/src/router/index.js b/src/router/index.js index 979b5d8..c04f4d9 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -29,14 +29,18 @@ const router = new VueRouter({ * 权限验证 */ router.beforeEach(async (to, from, next) => { - console.log("before:"); - console.log(to,from); + if (process.env.NODE_ENV === "development") { + console.log("before:"); + console.log(to, from); + } next(); }); router.afterEach((to) => { - console.log("after:"); - console.log(to); + if (process.env.NODE_ENV === "development") { + console.log("after:"); + console.log(to); + } }); export default router; diff --git a/src/router/routes.js b/src/router/routes.js index 0d350b7..d900a64 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -6,7 +6,7 @@ const meta = { } const frameIn = [{ - path: "/:id:(text)/:path", + path: "/:id::cmd(text)/:path", component: _import("page/GoText"), meta: { ...meta, @@ -14,7 +14,7 @@ const frameIn = [{ } }, { - path: "/:id:(pdf)/:path", + path: "/:id::cmd(pdf)/:path", component: _import("page/GoPdf"), meta: { ...meta, @@ -22,7 +22,7 @@ const frameIn = [{ } }, { - path: "/:id:(video)/:path", + path: "/:id::cmd(video)/:path", component: _import("page/GoVideo"), meta: { ...meta, @@ -30,7 +30,7 @@ const frameIn = [{ } }, { - path: "/:id:(image)/:path", + path: "/:id::cmd(image)/:path", component: _import("page/GoImg"), meta: { ...meta, @@ -38,7 +38,15 @@ const frameIn = [{ } }, { - path: "/:id::cmd?(/?/??.*)", + path: "/:id::cmd(search)(/?q=)*", + component: _import("page/GoList"), + meta: { + ...meta, + view: 'list' + } + }, + { + path: "/:id:/:path*", component: _import("page/GoList"), meta: { ...meta, diff --git a/src/utils/AcrouUtil.js b/src/utils/AcrouUtil.js index fa2fc23..45088ae 100644 --- a/src/utils/AcrouUtil.js +++ b/src/utils/AcrouUtil.js @@ -38,7 +38,8 @@ export const checkView = (path) => { .split(".") .pop() .toLowerCase(); - let base64Path = Base64.encode(path); + console.log(path) + let base64Path = encode64(path); if ("|html|php|css|go|java|js|json|txt|sh|md|".indexOf(`|${ext}|`) >= 0) { path = path.replace(/\/(\d+:)\/.*/, (p1, p2) => { return `/${p2}text/${base64Path}`; @@ -88,7 +89,7 @@ export const getURLParameters = (url) => //console.log(getQueryString("/Movies/xx.mp4?a=view&y=123", "y")); export const encode64 = (str) => { - return Base64.encode(str); + return Base64.encodeURI(str); }; export const decode64 = (str) => { diff --git a/src/views/common/BreadCrumb.vue b/src/views/common/BreadCrumb.vue index ad29f0a..e529711 100644 --- a/src/views/common/BreadCrumb.vue +++ b/src/views/common/BreadCrumb.vue @@ -40,14 +40,16 @@ export default { }, render() { this.index = this.$route.params.id; - let path = this.$route.params.path - ? decode64(this.$route.params.path) - : this.$route.path; + let cmd = this.$route.params.cmd // 如果是搜索不进行渲染 - if (path.match("/[0-9]+:search")) { + if (cmd === 'search') { this.navs = []; return; } + let path = this.$route.path + if(cmd){ + path = decode64(this.$route.params.path) + } var arr = path.trim("/").split("/"); var p = "/"; if (arr.length > 0) { diff --git a/src/views/common/Markdown.vue b/src/views/common/Markdown.vue index 93aa91b..9e0acf7 100644 --- a/src/views/common/Markdown.vue +++ b/src/views/common/Markdown.vue @@ -14,6 +14,9 @@ export default { this.render(); } }, + mounted() { + this.render(); + }, data: function() { return { content: '' @@ -34,9 +37,6 @@ export default { render() { this.content = this.defaultContent const md = new MarkdownIt(); - // if (window.md == undefined) { - // window.md = window.markdownit(); - // } get_file(this.option, data => { this.content = md.render(data); }); diff --git a/src/views/common/Navbar.vue b/src/views/common/Navbar.vue index fcac841..1443b6c 100644 --- a/src/views/common/Navbar.vue +++ b/src/views/common/Navbar.vue @@ -3,11 +3,11 @@
-