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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user