fix: 修复普通用户登录和访问文件时的OSS配置检查

- 登录流程:当没有OSS配置时显示友好警告而不是权限错误
- 文件访问:在调用API前检查OSS配置,避免后端报错
- 更新JS版本号强制刷新缓存

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-22 19:50:29 +08:00
parent 6c283efffb
commit a86903fcdc
2 changed files with 11 additions and 4 deletions

View File

@@ -693,8 +693,8 @@ handleDragLeave(e) {
this.loadFiles('/');
} else {
this.currentView = 'settings';
this.showToast('info', '欢迎', '请先配置您的OSS服务');
this.openOssConfigModal();
this.showToast('warning', 'OSS未配置', '系统尚未配置OSS存储服务请联系管理员进行配置');
// 普通用户不需要打开配置弹窗,等待管理员配置
}
} else {
// 默认行为:跳转到文件页面
@@ -1287,6 +1287,13 @@ handleDragLeave(e) {
// ===== 文件管理 =====
async loadFiles(path) {
// 检查是否有可用的存储配置
if (this.storagePermission === 'oss_only' && this.user?.oss_config_source === 'none') {
this.showToast('warning', '无法访问文件', 'OSS存储未配置请联系管理员进行配置');
this.currentView = 'settings';
return;
}
this.loading = true;
// 确保路径不为undefined
this.currentPath = path || '/';
@@ -2557,7 +2564,7 @@ handleDragLeave(e) {
},
ensureOssConfigSection() {
this.openOssConfigModal();
// 普通用户不需要打开配置弹窗,等待管理员配置
},
openOssGuideModal() {