云文件系统初始化

This commit is contained in:
2026-04-02 22:08:01 +08:00
parent 6addb74d32
commit 9ff222c22c
9 changed files with 101 additions and 68 deletions

View File

@@ -22,7 +22,16 @@ request.interceptors.response.use(
const status = error.response?.status
// 只有 401/403 才清理 token 并跳转登录页
// 但在登录页时不跳转(避免死循环),登录接口的 401 也不跳转
if (status === 401 || status === 403) {
const isLoginPage = window.location.pathname === '/login'
const isAuthApi = error.config?.url?.startsWith('/auth/')
if (isLoginPage || isAuthApi) {
// 登录页或登录接口,不跳转,不清理
return Promise.reject(error)
}
localStorage.removeItem('token')
localStorage.removeItem('username')
localStorage.removeItem('userId')
@@ -31,12 +40,9 @@ request.interceptors.response.use(
localStorage.removeItem('storageUsed')
localStorage.removeItem('storageLimit')
if (window.location.pathname !== '/login') {
window.location.href = '/login'
}
window.location.href = '/login'
}
// 其他错误404、500、网络错误等正常 reject不跳转
return Promise.reject(error)
}
)

View File

@@ -619,8 +619,6 @@ const handleConfirmBatchMove = async (targetFolderId) => {
finalFolderId = targetFolderId
}
console.log('targetFolderId:', targetFolderId, 'finalFolderId:', finalFolderId)
let successCount = 0
let failCount = 0

View File

@@ -22,19 +22,19 @@ export default defineConfig({
port: 5173,
proxy: {
'/api': {
target: 'http://localhost:8080',
target: 'http://localhost:18089',
changeOrigin: true
},
'/ws': {
target: 'ws://localhost:8080',
target: 'ws://localhost:18089',
ws: true
},
'/uploads': {
target: 'http://localhost:8080',
target: 'http://localhost:18089',
changeOrigin: true
},
'/files': {
target: 'http://localhost:8080',
target: 'http://localhost:18089',
changeOrigin: true
}
}