diff --git a/packages/web/i18n/en/account_info.json b/packages/web/i18n/en/account_info.json index 36cbc15e232e..442a6191b14d 100644 --- a/packages/web/i18n/en/account_info.json +++ b/packages/web/i18n/en/account_info.json @@ -10,9 +10,6 @@ "avatar_selection_exception": "Abnormal avatar selection", "balance": "balance", "billing_standard": "Standards", - "bind_notification_error": "Abnormal binding notification account", - "bind_notification_hint": "Please bind the notification receiving account to ensure that you can normally receive notifications such as package expiration reminders and ensure the normal operation of your services.", - "bind_notification_success": "Binding notification account successful", "cancel": "Cancel", "change": "change", "choose_avatar": "Click to select avatar", @@ -40,7 +37,6 @@ "month": "moon", "new_password": "New Password", "notification_receiving": "Notify", - "notification_receiving_hint": "Notification reception", "old_password": "Old Password", "openai_account_configuration": "OpenAI account configuration", "openai_account_setting_exception": "Setting OpenAI account exception", diff --git a/packages/web/i18n/en/common.json b/packages/web/i18n/en/common.json index eaf38abc9ae9..f0b737f5e88a 100644 --- a/packages/web/i18n/en/common.json +++ b/packages/web/i18n/en/common.json @@ -1035,6 +1035,12 @@ "support.user.User self info": "Profile", "support.user.auth.Sending Code": "Sending Code", "support.user.captcha_placeholder": "Please enter the verification code", + "support.user.info.notification_receiving_hint": "Notification reception", + "support.user.info.bind_notification_hint": "Please bind the notification receiving account to ensure that you can receive notifications such as package expiration reminders, etc., to ensure the normal operation of your service.", + "support.user.info.verification_code": "Verification Code", + "support.user.info.code_required": "Verification code cannot be empty", + "support.user.info.bind_notification_error": "Abnormal binding notification account", + "support.user.info.bind_notification_success": "Binding notification account successful", "support.user.inform.System message": "System Message", "support.user.login.Email": "Email", "support.user.login.Github": "GitHub Login", @@ -1047,7 +1053,7 @@ "support.user.login.Provider error": "Login Error, Please Try Again", "support.user.login.Username": "Username", "support.user.login.Wechat": "WeChat Login", - "support.user.login.can_not_login": "Cannot Log In, Click to Contact", + "support.user.login.can_not_login": "Cannot log in? Click here to contact us", "support.user.login.error": "Login Error", "support.user.login.security_failed": "Security Verification Failed", "support.user.login.wx_qr_login": "WeChat QR Code Login", diff --git a/packages/web/i18n/en/login.json b/packages/web/i18n/en/login.json index c02cbbb0c60f..8dfe1b826612 100644 --- a/packages/web/i18n/en/login.json +++ b/packages/web/i18n/en/login.json @@ -1,20 +1,20 @@ { "Chinese_ip_tip": "It is detected that you are a mainland Chinese IP, click to jump to visit the mainland China version.", "Login": "Login", - "agree": "agree", - "cookies_tip": " This website uses cookies to provide a better service experience. By continuing to use the site, you agree to our Cookie Policy.", - "forget_password": "Find password", + "forget_password": "Find Password", "login_failed": "Login failed", "login_success": "Login successful", "no_remind": "Don't remind again", "password_condition": "Password maximum 60 characters", "password_tip": "Password must be at least 6 characters long and contain at least two combinations: numbers, letters, or special characters", - "policy_tip": "By useing, you agree to our", - "privacy": "Privacy policy", - "privacy_policy": "Privacy Policy", + "policy_tip": "By using this service, you agree to our", + "privacy": "Privacy Policy", "redirect": "Jump", "register": "Register", "root_password_placeholder": "The root user password is the value of the environment variable DEFAULT_ROOT_PSW", "terms": "Terms", - "use_root_login": "Log in as root user" + "use_root_login": "Log in as root user", + "agree": "agree", + "cookies_tip": " This website uses cookies to provide a better service experience. By continuing to use the site, you agree to our Cookie Policy.", + "privacy_policy": "Privacy Policy" } diff --git a/packages/web/i18n/en/user.json b/packages/web/i18n/en/user.json index 814016f081b3..3f929a8ecddb 100644 --- a/packages/web/i18n/en/user.json +++ b/packages/web/i18n/en/user.json @@ -28,7 +28,6 @@ "login.Dingtalk": "DingTalk Login", "manage_team": "Manage team", "name": "Name", - "notification.Bind Notification Pipe Hint": "Please bind a notification receiving account to ensure you receive notifications such as plan expiration reminders, ensuring your service runs smoothly.", "notification.remind_owner_bind": "Please remind the creator to bind a notification account", "operations": "Actions", "owner": "owner", @@ -67,7 +66,7 @@ "register.confirm": "Confirm Registration", "register.register_account": "Register {{account}} Account", "register.success": "Registration Successful", - "register.to_login": "Already have an account? Login", + "register.to_login": "Already have an account? Go to Login", "search_user": "Search Username", "sso_auth_failed": "SSO authentication failed", "synchronization.button": "Sync Now", diff --git a/packages/web/i18n/zh-CN/account_info.json b/packages/web/i18n/zh-CN/account_info.json index 936e0cdbc5b1..efd52c90a39c 100644 --- a/packages/web/i18n/zh-CN/account_info.json +++ b/packages/web/i18n/zh-CN/account_info.json @@ -10,9 +10,6 @@ "avatar_selection_exception": "头像选择异常", "balance": "余额", "billing_standard": "计费标准", - "bind_notification_error": "绑定通知账号异常", - "bind_notification_hint": "请绑定通知接收账号,以确保您能正常接收套餐过期提醒等通知,保障您的服务正常运行。", - "bind_notification_success": "绑定通知账号成功", "cancel": "取消", "change": "变更", "choose_avatar": "点击选择头像", @@ -40,7 +37,6 @@ "month": "月", "new_password": "新密码", "notification_receiving": "通知接收", - "notification_receiving_hint": "通知接收", "old_password": "旧密码", "package_and_usage": "套餐与用量", "package_details": "套餐详情", diff --git a/packages/web/i18n/zh-CN/common.json b/packages/web/i18n/zh-CN/common.json index d12a2c6840d3..3b003417fab5 100644 --- a/packages/web/i18n/zh-CN/common.json +++ b/packages/web/i18n/zh-CN/common.json @@ -1039,6 +1039,12 @@ "support.user.auth.Sending Code": "正在发送", "support.user.captcha_placeholder": "请输入验证码", "support.user.inform.System message": "系统消息", + "support.user.info.notification_receiving_hint": "通知接收", + "support.user.info.bind_notification_hint": "请绑定通知接收账号,以确保您能正常接收套餐过期提醒等通知,保障您的服务正常运行。", + "support.user.info.verification_code": "验证码", + "support.user.info.code_required": "验证码不能为空", + "support.user.info.bind_notification_success": "绑定通知账号成功", + "support.user.info.bind_notification_error": "绑定通知账号异常", "support.user.login.Email": "邮箱", "support.user.login.Github": "GitHub 登录", "support.user.login.Google": "Google 登录", diff --git a/packages/web/i18n/zh-CN/user.json b/packages/web/i18n/zh-CN/user.json index 23b8b75504cc..99f63e043c69 100644 --- a/packages/web/i18n/zh-CN/user.json +++ b/packages/web/i18n/zh-CN/user.json @@ -28,7 +28,6 @@ "login.Dingtalk": "钉钉登录", "manage_team": "管理团队", "name": "名称", - "notification.Bind Notification Pipe Hint": "请绑定通知接收账号,以确保您能正常接收套餐过期提醒等通知,保障您的服务正常运行。", "notification.remind_owner_bind": "请提醒创建者绑定通知账号", "operations": "操作", "owner": "所有者", diff --git a/packages/web/i18n/zh-Hant/account_info.json b/packages/web/i18n/zh-Hant/account_info.json index 51831cb94271..e7e34366d00e 100644 --- a/packages/web/i18n/zh-Hant/account_info.json +++ b/packages/web/i18n/zh-Hant/account_info.json @@ -10,9 +10,6 @@ "avatar_selection_exception": "頭像選擇異常", "balance": "餘額", "billing_standard": "計費標準", - "bind_notification_error": "綁定通知帳號異常", - "bind_notification_hint": "請綁定通知接收帳號,確保您能正常接收套餐過期提醒等通知,保障您的服務正常運作。", - "bind_notification_success": "綁定通知帳號成功", "cancel": "取消", "change": "變更", "choose_avatar": "點選選擇頭像", @@ -40,7 +37,6 @@ "month": "月", "new_password": "新密碼", "notification_receiving": "通知接收", - "notification_receiving_hint": "通知接收", "old_password": "舊密碼", "openai_account_configuration": "OpenAI 帳號配置", "openai_account_setting_exception": "設定 OpenAI 帳號異常", diff --git a/packages/web/i18n/zh-Hant/common.json b/packages/web/i18n/zh-Hant/common.json index f921a766c533..765179eded72 100644 --- a/packages/web/i18n/zh-Hant/common.json +++ b/packages/web/i18n/zh-Hant/common.json @@ -1036,6 +1036,12 @@ "support.user.auth.Sending Code": "正在傳送驗證碼", "support.user.captcha_placeholder": "請輸入驗證碼", "support.user.inform.System message": "系統訊息", + "support.user.info.notification_receiving_hint": "通知接收", + "support.user.info.bind_notification_hint": "請綁定通知接收帳號,確保您能正常接收套餐過期提醒等通知,保障您的服務正常運作。", + "support.user.info.verification_code": "驗證碼", + "support.user.info.code_required": "驗證碼不能為空", + "support.user.info.bind_notification_success": "綁定通知帳號成功", + "support.user.info.bind_notification_error": "綁定通知帳號異常", "support.user.login.Email": "電子郵件", "support.user.login.Github": "GitHub 登入", "support.user.login.Google": "Google 登入", diff --git a/packages/web/i18n/zh-Hant/user.json b/packages/web/i18n/zh-Hant/user.json index 695dc164deac..9b4e64b3087a 100644 --- a/packages/web/i18n/zh-Hant/user.json +++ b/packages/web/i18n/zh-Hant/user.json @@ -28,7 +28,6 @@ "login.Dingtalk": "釘釘登入", "manage_team": "管理團隊", "name": "名稱", - "notification.Bind Notification Pipe Hint": "請綁定通知接收帳號,以確保您能正常接收方案到期提醒等通知,保障您的服務正常運作。", "notification.remind_owner_bind": "請提醒建立者綁定通知帳號", "operations": "操作", "owner": "擁有者", diff --git a/projects/app/src/components/Layout/index.tsx b/projects/app/src/components/Layout/index.tsx index 2cebee18e501..a8734e5c1f15 100644 --- a/projects/app/src/components/Layout/index.tsx +++ b/projects/app/src/components/Layout/index.tsx @@ -19,6 +19,9 @@ const UpdateInviteModal = dynamic(() => import('@/components/support/user/team/U const NotSufficientModal = dynamic(() => import('@/components/support/wallet/NotSufficientModal')); const SystemMsgModal = dynamic(() => import('@/components/support/user/inform/SystemMsgModal')); const ImportantInform = dynamic(() => import('@/components/support/user/inform/ImportantInform')); +const UpdateNotification = dynamic( + () => import('@/components/support/user/inform/UpdateNotificationModal') +); const pcUnShowLayoutRoute: Record = { '/': true, @@ -50,7 +53,7 @@ const Layout = ({ children }: { children: JSX.Element }) => { const { Loading } = useLoading(); const { loading, feConfigs, isNotSufficientModal } = useSystemStore(); const { isPc } = useSystem(); - const { userInfo } = useUserStore(); + const { userInfo, isUpdateNotification, setIsUpdateNotification } = useUserStore(); const { setUserDefaultLng } = useI18nLng(); const isChatPage = useMemo( @@ -68,6 +71,11 @@ const Layout = ({ children }: { children: JSX.Element }) => { const isHideNavbar = !!pcUnShowLayoutRoute[router.pathname]; + const showUpdateNotification = + isUpdateNotification && + !userInfo?.team.notificationAccount && + !!userInfo?.team.permission.isOwner; + useMount(() => { setUserDefaultLng(); }); @@ -115,6 +123,9 @@ const Layout = ({ children }: { children: JSX.Element }) => { {!!userInfo && } {isNotSufficientModal && } {!!userInfo && } + {showUpdateNotification && ( + setIsUpdateNotification(false)} /> + )} {!!userInfo && importantInforms.length > 0 && ( )} diff --git a/projects/app/src/pages/account/info/components/UpdateNotificationModal.tsx b/projects/app/src/components/support/user/inform/UpdateNotificationModal.tsx similarity index 79% rename from projects/app/src/pages/account/info/components/UpdateNotificationModal.tsx rename to projects/app/src/components/support/user/inform/UpdateNotificationModal.tsx index 5adbb505fa84..e6e220196b73 100644 --- a/projects/app/src/pages/account/info/components/UpdateNotificationModal.tsx +++ b/projects/app/src/components/support/user/inform/UpdateNotificationModal.tsx @@ -38,8 +38,8 @@ const UpdateNotificationModal = ({ onClose }: { onClose: () => void }) => { initUserInfo(); onClose(); }, - successToast: t('account_info:bind_notification_success'), - errorToast: t('account_info:bind_notification_error') + successToast: t('common:support.user.info.bind_notification_success'), + errorToast: t('common:support.user.info.bind_notification_error') } ); @@ -49,9 +49,9 @@ const UpdateNotificationModal = ({ onClose }: { onClose: () => void }) => { ?.map((item) => { switch (item) { case 'email': - return t('account_info:email_label'); + return t('common:support.user.login.Email'); case 'phone': - return t('account_info:phone_label'); + return t('common:support.user.login.Phone number'); } }) .join('/'); @@ -62,16 +62,16 @@ const UpdateNotificationModal = ({ onClose }: { onClose: () => void }) => { isOpen iconSrc="common/settingLight" w={'32rem'} - title={t('account_info:notification_receiving_hint')} + title={t('common:support.user.info.notification_receiving_hint')} > - {t('account_info:bind_notification_hint')} + {t('common:support.user.info.bind_notification_hint')} - {t('account_info:user_account')} + {t('common:user.Account')} void }) => { > - {t('account_info:verification_code')} + {t('common:support.user.info.verification_code')} @@ -93,14 +93,14 @@ const UpdateNotificationModal = ({ onClose }: { onClose: () => void }) => { diff --git a/projects/app/src/pages/account/info/index.tsx b/projects/app/src/pages/account/info/index.tsx index 1d9501339b63..9e98726fdb8e 100644 --- a/projects/app/src/pages/account/info/index.tsx +++ b/projects/app/src/pages/account/info/index.tsx @@ -47,7 +47,9 @@ import TeamSelector from '../components/TeamSelector'; const StandDetailModal = dynamic(() => import('./components/standardDetailModal'), { ssr: false }); const ConversionModal = dynamic(() => import('./components/ConversionModal')); const UpdatePswModal = dynamic(() => import('./components/UpdatePswModal')); -const UpdateNotification = dynamic(() => import('./components/UpdateNotificationModal')); +const UpdateNotification = dynamic( + () => import('@/components/support/user/inform/UpdateNotificationModal') +); const CommunityModal = dynamic(() => import('@/components/CommunityModal')); const ModelPriceModal = dynamic(() => diff --git a/projects/app/src/web/support/user/useUserStore.ts b/projects/app/src/web/support/user/useUserStore.ts index a6da4d48c63c..040e17556958 100644 --- a/projects/app/src/web/support/user/useUserStore.ts +++ b/projects/app/src/web/support/user/useUserStore.ts @@ -18,6 +18,9 @@ type State = { systemMsgReadId: string; setSysMsgReadId: (id: string) => void; + isUpdateNotification: boolean; + setIsUpdateNotification: (val: boolean) => void; + userInfo: UserType | null; isTeamAdmin: boolean; initUserInfo: () => Promise; @@ -50,6 +53,13 @@ export const useUserStore = create()( }); }, + isUpdateNotification: true, + setIsUpdateNotification(val: boolean) { + set((state) => { + state.isUpdateNotification = val; + }); + }, + userInfo: null, isTeamAdmin: false, async initUserInfo() { @@ -156,7 +166,8 @@ export const useUserStore = create()( { name: 'userStore', partialize: (state) => ({ - systemMsgReadId: state.systemMsgReadId + systemMsgReadId: state.systemMsgReadId, + isUpdateNotification: state.isUpdateNotification }) } )