fix: 修复普通用户登录和访问文件时的OSS配置检查
- 登录流程:当没有OSS配置时显示友好警告而不是权限错误 - 文件访问:在调用API前检查OSS配置,避免后端报错 - 更新JS版本号强制刷新缓存 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3520,6 +3520,6 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script src="app.js?v=20260122001"></script>
|
<script src="app.js?v=20260122002"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -693,8 +693,8 @@ handleDragLeave(e) {
|
|||||||
this.loadFiles('/');
|
this.loadFiles('/');
|
||||||
} else {
|
} else {
|
||||||
this.currentView = 'settings';
|
this.currentView = 'settings';
|
||||||
this.showToast('info', '欢迎', '请先配置您的OSS服务');
|
this.showToast('warning', 'OSS未配置', '系统尚未配置OSS存储服务,请联系管理员进行配置');
|
||||||
this.openOssConfigModal();
|
// 普通用户不需要打开配置弹窗,等待管理员配置
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 默认行为:跳转到文件页面
|
// 默认行为:跳转到文件页面
|
||||||
@@ -1287,6 +1287,13 @@ handleDragLeave(e) {
|
|||||||
// ===== 文件管理 =====
|
// ===== 文件管理 =====
|
||||||
|
|
||||||
async loadFiles(path) {
|
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;
|
this.loading = true;
|
||||||
// 确保路径不为undefined
|
// 确保路径不为undefined
|
||||||
this.currentPath = path || '/';
|
this.currentPath = path || '/';
|
||||||
@@ -2557,7 +2564,7 @@ handleDragLeave(e) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
ensureOssConfigSection() {
|
ensureOssConfigSection() {
|
||||||
this.openOssConfigModal();
|
// 普通用户不需要打开配置弹窗,等待管理员配置
|
||||||
},
|
},
|
||||||
|
|
||||||
openOssGuideModal() {
|
openOssGuideModal() {
|
||||||
|
|||||||
Reference in New Issue
Block a user