From ed9c0e9768fb67ff5b57f5d4b620f2d590005683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=88=90?= Date: Mon, 17 Nov 2025 18:03:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E5=BD=95=E5=88=A4?= =?UTF-8?q?=E5=AE=9A=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PublishMenu/PublishMenu.tsx | 7 +++++++ src/publish_pages/publishBall/index.tsx | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/PublishMenu/PublishMenu.tsx b/src/components/PublishMenu/PublishMenu.tsx index 6f60789..07f250c 100644 --- a/src/components/PublishMenu/PublishMenu.tsx +++ b/src/components/PublishMenu/PublishMenu.tsx @@ -8,6 +8,7 @@ import { EvaluateScene, } from "@/store/evaluateStore"; import { navigateTo, redirectTo, navigateBack } from "@/utils/navigation"; +import { requireLoginWithPhone } from "@/utils/helper"; import styles from "./index.module.scss"; import images from "@/config/images"; import AiImportPopup from "@/publish_pages/publishBall/components/AiImportPopup"; @@ -34,6 +35,12 @@ const PublishMenu: React.FC = (props) => { }>({ show: () => {} }); const handleIconClick = () => { + // 点击发布 icon 时先检查登录状态和手机号 + if (!requireLoginWithPhone()) { + // 未登录或未绑定手机号,已跳转到登录页,不显示菜单 + return; + } + // 已登录,显示/隐藏菜单 setIsVisible(!isVisible); }; const handleOverlayClick = () => { diff --git a/src/publish_pages/publishBall/index.tsx b/src/publish_pages/publishBall/index.tsx index 0f23282..ff0854f 100644 --- a/src/publish_pages/publishBall/index.tsx +++ b/src/publish_pages/publishBall/index.tsx @@ -13,7 +13,7 @@ import { } from "../../config/formSchema/publishBallFormSchema"; import { PublishBallFormData } from "../../../types/publishBall"; import PublishService from "@/services/publishService"; -import { getNextHourTime, getEndTime, delay, requireLoginWithPhone } from "@/utils"; +import { getNextHourTime, getEndTime, delay } from "@/utils"; import { useGlobalState } from "@/store/global"; import GeneralNavbar from "@/components/GeneralNavbar"; import images from "@/config/images"; @@ -344,10 +344,6 @@ const PublishBall: React.FC = () => { }; // 提交表单 const handleSubmit = async () => { - // 检查登录状态和手机号 - if (!requireLoginWithPhone()) { - return; // 未登录或未绑定手机号,已跳转到登录页 - } // 基础验证 console.log(formData, "formData"); const params = getParams();