fix(bug): fix router

This commit is contained in:
zhangheng
2026-03-27 15:13:41 +08:00
parent 764d0a726f
commit 72f1610fc3
7 changed files with 35 additions and 30 deletions

View File

@@ -156,7 +156,7 @@ const TopTools = (
isLabelTask,
renderPolygons,
} = props
const { backUrl } = useBackUrlStore()
const { backUrl, basePath } = useBackUrlStore()
const { mode, loadingData } = usePaperStore()
const router = useRouter()
const user_id = usePermissionStore.getState().user_id
@@ -1091,9 +1091,9 @@ const TopTools = (
useObjectStore.getState().resetPathAndOperationStatus()
} else {
// 无id返回时跳转回任务列表页
const url = backUrl || "/"
router.push(url)
// window.location.href = url
const url = backUrl ? basePath + backUrl : "/"
// router.push(url)
window.location.href = url
// 重置图片比例及选中标注对象
usePaperStore.getState().resetRasterScale()
useObjectStore.getState().resetPathAndOperationStatus()
@@ -1757,9 +1757,9 @@ const TopTools = (
c="dark"
onClick={() => {
if (isView) {
const url = backUrl || "/"
router.push(url)
// window.location.href = url
const url = backUrl ? basePath + backUrl : "/"
// router.push(url)
window.location.href = url
// handleBackup("auto_backup");
// 重置图片比例及选中标注对象
usePaperStore.getState().resetRasterScale()
@@ -2450,9 +2450,9 @@ const TopTools = (
return
}
setConfirmOpen(false)
const url = backUrl || "/"
router.push(url)
// window.location.href = url
const url = backUrl ? basePath + backUrl : "/"
// router.push(url)
window.location.href = url
// 重置图片比例及选中标注对象
usePaperStore.getState().resetRasterScale()
useObjectStore.getState().resetPathAndOperationStatus()
@@ -2461,9 +2461,9 @@ const TopTools = (
try {
setConfirmOpen(false)
handleBackup("auto_backup")
const url = backUrl || "/"
router.push(url)
// window.location.href = url
const url = backUrl ? basePath + backUrl : "/"
// router.push(url)
window.location.href = url
// 重置图片比例及选中标注对象
usePaperStore.getState().resetRasterScale()
useObjectStore.getState().resetPathAndOperationStatus()