From 7b86fc1e1d390ad397e7ea73ebac11657771e24c Mon Sep 17 00:00:00 2001 From: Aicirou <2643053021@qq.com> Date: Sat, 2 May 2020 13:00:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dependencies-cdn.js | 1 + public/index.html | 1 + src/assets/style/theme/acrou/index.scss | 16 ++++ src/main.js | 2 +- src/router/routes.js | 6 +- src/utils/AcrouUtil.js | 37 ++++++++ src/views/common/BreadCrumb.vue | 1 + src/views/common/Navbar.vue | 12 ++- src/views/page/GoImg.vue | 2 + src/views/page/GoList.vue | 118 ++++++++++++------------ src/views/page/GoVideo.vue | 74 +++++++++------ 11 files changed, 177 insertions(+), 93 deletions(-) diff --git a/dependencies-cdn.js b/dependencies-cdn.js index ee26e3b..8d83a44 100644 --- a/dependencies-cdn.js +++ b/dependencies-cdn.js @@ -1,5 +1,6 @@ module.exports = [ { name: 'vue', library: 'Vue', js: 'https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js', css: '' }, + // { name: 'vue-i18n', library: 'VueI18n', js: 'https://cdn.jsdelivr.net/npm/vue-i18n@8.17.4/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: 'brace', library: 'ace', js: 'https://cdn.jsdelivr.net/npm/brace@0.11.1/index.min.js', css: '' }, diff --git a/public/index.html b/public/index.html index 3614ece..c05452f 100644 --- a/public/index.html +++ b/public/index.html @@ -33,6 +33,7 @@ window.gds = JSON.parse( JSON.stringify(authConfig.roots.map((it) => it.name)) ); + window.current_drive_order = 0; // window.MODEL = { q: "the" }; diff --git a/src/assets/style/theme/acrou/index.scss b/src/assets/style/theme/acrou/index.scss index 34a60ca..eff87fc 100644 --- a/src/assets/style/theme/acrou/index.scss +++ b/src/assets/style/theme/acrou/index.scss @@ -63,6 +63,22 @@ body { margin-top: 20px; } +.video-content{ + width: 100%; + background: #000; + position: relative; + padding-bottom: 56.25%; + height: 0; + iframe{ + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } + } + + .golist { min-height: 240px; position: relative; diff --git a/src/main.js b/src/main.js index 666ba5a..348863f 100644 --- a/src/main.js +++ b/src/main.js @@ -10,7 +10,7 @@ var styles = [ '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://cdn.jsdelivr.net/npm/bulma-pageloader@0.3.0/dist/css/bulma-pageloader.min.css' + // 'https://cdn.jsdelivr.net/npm/bulma-pageloader@0.3.0/dist/css/bulma-pageloader.min.css' ] styles.forEach(item=>{ document.write(``); diff --git a/src/router/routes.js b/src/router/routes.js index d4b06fe..2ec5355 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -3,9 +3,9 @@ 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)\\?a=view', component: _import('page/GoVideo') }, - { path: '/:id:/*.(bmp|jpg|jpeg|png|gif)\\?a=view', component: _import('page/GoImg') }, - { path: '/:id::cmd?(/??.*)', component: _import('page/GoList') }, + { 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') }, ] export default frameIn diff --git a/src/utils/AcrouUtil.js b/src/utils/AcrouUtil.js index ba8fd0a..24840ac 100644 --- a/src/utils/AcrouUtil.js +++ b/src/utils/AcrouUtil.js @@ -1,5 +1,42 @@ import axios from "@utils/axios"; +const exts = [ + "html", + "php", + "css", + "go", + "java", + "js", + "json", + "py", + "txt", + "sh", + "md", + "mp4", + "webm", + "mkv", + "bmp", + "jpg", + "jpeg", + "png", + "gif", +]; + +export const checkoutPath = (path, file) => { + // 解决/css这种也会匹配的问题 + 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; +}; + export const getQueryString = (path, param) => { if (!path) { return ""; diff --git a/src/views/common/BreadCrumb.vue b/src/views/common/BreadCrumb.vue index 0258631..c63cd8a 100644 --- a/src/views/common/BreadCrumb.vue +++ b/src/views/common/BreadCrumb.vue @@ -39,6 +39,7 @@ export default { let path = window.location.pathname; // 如果是搜索不进行渲染 if (path.match("/[0-9]+:search")) { + this.navs = []; return; } var arr = path.trim("/").split("/"); diff --git a/src/views/common/Navbar.vue b/src/views/common/Navbar.vue index 1f93c1c..64bd90f 100644 --- a/src/views/common/Navbar.vue +++ b/src/views/common/Navbar.vue @@ -53,6 +53,16 @@

+ +
@@ -7,6 +8,7 @@ Loading...
+
diff --git a/src/views/page/GoList.vue b/src/views/page/GoList.vue index 48555c2..4c168e8 100644 --- a/src/views/page/GoList.vue +++ b/src/views/page/GoList.vue @@ -1,5 +1,6 @@ \ No newline at end of file