Enhance CORS configuration and WebSocket origin settings to include additional localhost ports. Improve error handling in SftpController and SftpView for better debugging and user feedback.

This commit is contained in:
liumangmang
2026-02-04 11:47:08 +08:00
parent 1aefc14e42
commit b82ea1919e
5 changed files with 32 additions and 8 deletions

View File

@@ -58,7 +58,8 @@ function initPath() {
currentPath.value = p || '.'
pathParts.value = p === '/' ? [''] : p.split('/').filter(Boolean)
loadPath()
}).catch(() => {
}).catch((err: { response?: { data?: { error?: string } } }) => {
error.value = err?.response?.data?.error ?? '获取当前路径失败,请检查连接与认证'
currentPath.value = '.'
pathParts.value = []
loadPath()
@@ -76,8 +77,8 @@ function loadPath() {
return a.name.localeCompare(b.name)
})
})
.catch(() => {
error.value = '获取文件列表失败'
.catch((err: { response?: { data?: { error?: string } } }) => {
error.value = err?.response?.data?.error ?? '获取文件列表失败'
})
.finally(() => {
loading.value = false