From e8a64d1064a89874dd1d26a41d01aa17f2b8785b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=BD=A6=E8=B6=85?= Date: Fri, 8 Aug 2025 22:57:19 +0800 Subject: [PATCH 01/31] Update Footer.vue --- assets/Footer.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/assets/Footer.vue b/assets/Footer.vue index 4527c6b..61f8987 100644 --- a/assets/Footer.vue +++ b/assets/Footer.vue @@ -40,10 +40,10 @@ export default { name: "Footer", data() { return { - homeUrl: "https://www.sztcrs.com/", - blogUrl: "https://blog.sztcrs.com/", - githubUrl: "https://github.com/52op", - emailUrl: "mailto:admin@sztcrs.com" + homeUrl: "https://blog.liuyc.uk/about.html", + blogUrl: "https://blog.liuyc.uk/", + githubUrl: "https://github.com/marktube", + emailUrl: "mailto:liuyc@sem.tsinghua.edu.cn" }; } }; @@ -117,4 +117,4 @@ export default { .powered a:hover { color: #222; } - \ No newline at end of file + From 02eac8f5f80a96ede336c6bcf49e3e73d53502ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=BD=A6=E8=B6=85?= Date: Wed, 13 Aug 2025 13:55:20 +0800 Subject: [PATCH 02/31] Update [[path]].ts --- functions/api/children/[[path]].ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/api/children/[[path]].ts b/functions/api/children/[[path]].ts index 5483bcd..f62620a 100644 --- a/functions/api/children/[[path]].ts +++ b/functions/api/children/[[path]].ts @@ -47,8 +47,8 @@ export async function onRequestGet(context) { if(headers.get('Authorization')) { const Authorization = headers.get('Authorization').split("Basic ")[1]; const account = atob(Authorization); - if(account && context.env[account]) { - const allow = context.env[account].split(","); + if(account && (context.env[account] || context.env[account + ':r'])) { + const allow = [...context.env[account].split(","), ...context.env[account + ':r'].split(",")]; // 如果不是管理员,需要过滤内容 if (!allow.includes("*")) { From 8b687dff8fbec4042ad7868ee89afe8e7efc2b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=BD=A6=E8=B6=85?= Date: Wed, 13 Aug 2025 14:04:21 +0800 Subject: [PATCH 03/31] Update [[path]].ts fix bug in showing readonly user folders --- functions/api/children/[[path]].ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/functions/api/children/[[path]].ts b/functions/api/children/[[path]].ts index f62620a..4f1a257 100644 --- a/functions/api/children/[[path]].ts +++ b/functions/api/children/[[path]].ts @@ -48,7 +48,10 @@ export async function onRequestGet(context) { const Authorization = headers.get('Authorization').split("Basic ")[1]; const account = atob(Authorization); if(account && (context.env[account] || context.env[account + ':r'])) { - const allow = [...context.env[account].split(","), ...context.env[account + ':r'].split(",")]; + if(context.env[account]) + const allow = context.env[account].split(","); + else + const allow = context.env[account + ':r'].split(","); // 如果不是管理员,需要过滤内容 if (!allow.includes("*")) { From f1448f6422768673bc5415b5bb9143e5fcf6a1de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=BD=A6=E8=B6=85?= Date: Wed, 13 Aug 2025 14:09:24 +0800 Subject: [PATCH 04/31] Update [[path]].ts --- functions/api/children/[[path]].ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/functions/api/children/[[path]].ts b/functions/api/children/[[path]].ts index 4f1a257..0ea995c 100644 --- a/functions/api/children/[[path]].ts +++ b/functions/api/children/[[path]].ts @@ -48,10 +48,11 @@ export async function onRequestGet(context) { const Authorization = headers.get('Authorization').split("Basic ")[1]; const account = atob(Authorization); if(account && (context.env[account] || context.env[account + ':r'])) { - if(context.env[account]) + if(context.env[account]){ const allow = context.env[account].split(","); - else + }else{ const allow = context.env[account + ':r'].split(","); + } // 如果不是管理员,需要过滤内容 if (!allow.includes("*")) { From fbe139db7c6c31d15a629812b3a9721f4077182e Mon Sep 17 00:00:00 2001 From: liuyanchao Date: Wed, 13 Aug 2025 15:10:37 +0800 Subject: [PATCH 05/31] roll back --- functions/api/children/[[path]].ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/functions/api/children/[[path]].ts b/functions/api/children/[[path]].ts index 0ea995c..5483bcd 100644 --- a/functions/api/children/[[path]].ts +++ b/functions/api/children/[[path]].ts @@ -47,12 +47,8 @@ export async function onRequestGet(context) { if(headers.get('Authorization')) { const Authorization = headers.get('Authorization').split("Basic ")[1]; const account = atob(Authorization); - if(account && (context.env[account] || context.env[account + ':r'])) { - if(context.env[account]){ - const allow = context.env[account].split(","); - }else{ - const allow = context.env[account + ':r'].split(","); - } + if(account && context.env[account]) { + const allow = context.env[account].split(","); // 如果不是管理员,需要过滤内容 if (!allow.includes("*")) { From c0337e12d89ba6157e3d6a23016f1fec2855b23a Mon Sep 17 00:00:00 2001 From: liuyanchao Date: Wed, 13 Aug 2025 15:49:18 +0800 Subject: [PATCH 06/31] modify children --- functions/api/children/[[path]].ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/functions/api/children/[[path]].ts b/functions/api/children/[[path]].ts index 5483bcd..6dbb109 100644 --- a/functions/api/children/[[path]].ts +++ b/functions/api/children/[[path]].ts @@ -77,6 +77,34 @@ export async function onRequestGet(context) { return false; }); } + }else if(account && context.env[account + ':r']){ + // 处理只读用户 + const allow = context.env[account + ':r'].split(","); + + // 获取游客权限,已登录用户也应该能访问游客目录 + const guestEnv = context.env["GUEST"] || context.env["guest"]; + const allow_guest = guestEnv ? guestEnv.split(",") : []; + + // 合并用户权限和游客权限 + const combinedPermissions = [...allow, ...allow_guest]; + + // 过滤文件:显示用户有权限的文件 + 游客可访问的文件 + objKeys = objKeys.filter(file => { + for (var a of combinedPermissions) { + if (a == "*") return true; + if (file.key.startsWith(a)) return true; + } + return false; + }); + + // 过滤文件夹:显示用户有权限的文件夹 + 游客可访问的文件夹 + folders = folders.filter(folder => { + for (var a of combinedPermissions) { + if (a == "*") return true; + if (folder.startsWith(a)) return true; + } + return false; + }); } } } else { From 3db842e8df212fa1f4493cfae06e6da3c8441c4a Mon Sep 17 00:00:00 2001 From: liuyanchao Date: Wed, 13 Aug 2025 22:01:32 +0800 Subject: [PATCH 07/31] add new bg;modify footer;add description in README --- README.md | 4 ++++ assets/App.vue | 2 +- assets/Footer.vue | 6 ++++-- assets/bg-cat.jpeg | Bin 0 -> 788416 bytes 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 assets/bg-cat.jpeg diff --git a/README.md b/README.md index 9c38e9c..0609343 100644 --- a/README.md +++ b/README.md @@ -469,3 +469,7 @@ GUEST=public/ - 确认已先复制文件到剪贴板 - 检查用户权限是否允许写操作 - 移动端查看底部是否显示粘贴工具栏 + +--- + +**当前版本修复了只读用户显示所有目录的bug,只显示权限目录** \ No newline at end of file diff --git a/assets/App.vue b/assets/App.vue index 850263f..d21b015 100644 --- a/assets/App.vue +++ b/assets/App.vue @@ -582,7 +582,7 @@ export default { showUploadPopup: false, uploadProgress: null, uploadQueue: [], - backgroundImageUrl: "/assets/bg-light.webp", + backgroundImageUrl: "/assets/bg-cat.jpeg", needLogin: false, isGuest: true, // 默认为游客状态 isLoggedIn: false, diff --git a/assets/Footer.vue b/assets/Footer.vue index 61f8987..120b760 100644 --- a/assets/Footer.vue +++ b/assets/Footer.vue @@ -15,11 +15,13 @@ -
+ - +
-
+
+ +
@@ -441,6 +447,13 @@ export default { this.translateX = 0; this.translateY = 0; }, + panoImage() { + pannellum.viewer('pr-img-view', { + "type": "equirectangular", + "panorama": this.currentMedia.url, + "showFullscreenCtrl": true + }); + }, // 双击放大 onDoubleClick() { From 9ea722acfc38fe479c10e96e83dbc5e7b21a0fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=BD=A6=E8=B6=85?= Date: Fri, 29 Aug 2025 16:27:35 +0800 Subject: [PATCH 12/31] Update index.html add pannellum.js --- index.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.html b/index.html index 70adc20..6b6a78c 100644 --- a/index.html +++ b/index.html @@ -13,6 +13,8 @@ + +
From 5243ddd62e5ac8e222dcedc95f7ee3dddc6d92f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=BD=A6=E8=B6=85?= Date: Fri, 29 Aug 2025 16:35:31 +0800 Subject: [PATCH 13/31] Update MediaPreview.vue fix click link --- assets/MediaPreview.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/MediaPreview.vue b/assets/MediaPreview.vue index 3caff5d..d446775 100644 --- a/assets/MediaPreview.vue +++ b/assets/MediaPreview.vue @@ -183,7 +183,7 @@ -
  • - +
  • -