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

@@ -188,7 +188,7 @@ export default function OwnTaskTableContainer(props: {
const backUrl = type
? `/project/detail?id=${projectId}&type=${type}`
: `/project/detail?id=${projectId}`
setBackProps(backUrl, "own")
setBackProps(backUrl, "own", "/image")
if (info && [4, 5, 6, 7].includes(info.label_type)) {
router.push(

View File

@@ -456,7 +456,7 @@ export default function TaskTableContainer(props: {
const backUrl = type
? `/project/detail?id=${projectId}&type=${type}`
: `/project/detail?id=${projectId}`
setBackProps(backUrl, "all")
setBackProps(backUrl, "all", "/image")
if (info && [4, 5, 6, 7].includes(info.label_type)) {
router.push(

View File

@@ -167,7 +167,7 @@ export default function CollectionDetailPage() {
const backUrl = type
? `/project/detail?id=${projectId}&type=${type}`
: `/project/detail?id=${projectId}`
setBackProps(backUrl, next)
setBackProps(backUrl, next, "/image")
}}
style={{
paddingLeft: 14,

View File

@@ -51,11 +51,11 @@ FLAG_PROD="${ENV}_latest"
cd $SHELL_FOLDER
# 检查git状态
echo -e "${GREEN}Checking git status...${NC}"
git fetch
git merge
if [[ $? != 0 ]]; then echo -e "${RED}git pull error${NC}"; exit 100; fi
# # 检查git状态
# echo -e "${GREEN}Checking git status...${NC}"
# git fetch
# git merge
# if [[ $? != 0 ]]; then echo -e "${RED}git pull error${NC}"; exit 100; fi
BRANCH_NAME=`git branch | grep "*"`
echo -e "${GREEN}Current branch: ${BRANCH_NAME/* /}${NC}"

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()

View File

@@ -1,8 +1,8 @@
import { ALL_CODE } from "../utils/constants"
import dayjs from "dayjs"
import { create } from "zustand"
import { persist } from "zustand/middleware"
import { storage } from "../store"
import dayjs from "dayjs"
import { ALL_CODE } from "../utils/constants"
const initUserInfo = {
user_id: null,
@@ -263,8 +263,13 @@ export const useBackUrlStore = create(
(set) => ({
backUrl: null,
backTitle: null,
setBackProps: (url: string, title?: string) =>
set({ backUrl: url, backTitle: title || null }),
basePath: "",
setBackProps: (url: string, title?: string, basePath?: string) =>
set({
backUrl: url,
backTitle: title || null,
basePath: basePath || "",
}),
}),
{
name: "back_url",

View File

@@ -35,11 +35,11 @@ export const componentList: MenuItem[] = [
url: "video",
icon: "SystemIcon",
},
{
title: "点云标注",
url: "lidar",
icon: "SystemIcon",
},
// {
// title: "点云标注",
// url: "lidar",
// icon: "SystemIcon",
// },
{
title: "管理中心",
url: "mgt",