feat(i18n): enhance notification templates with raw message handling

Updated the notification system to utilize the `tm` function for template resolution, ensuring that placeholders like `{name}` and `{role}` remain intact for proper rendering. This change improves the display of workspace and role information in login and tenant switch notifications, allowing for better localization and visual consistency across the application. Adjustments were made in `App.vue`, `Login.vue`, and related utility functions to accommodate the new template handling.
This commit is contained in:
wizardchen
2026-05-18 20:37:31 +08:00
committed by lyingbug
parent 559b5a6e20
commit 4344765cf9
4 changed files with 99 additions and 121 deletions
+2 -2
View File
@@ -390,7 +390,7 @@ import screenshot4 from '@/assets/img/screenshot-4.svg'
const router = useRouter()
const authStore = useAuthStore()
const { t, locale } = useI18n()
const { t, tm, locale } = useI18n()
const { formatRole, roleIcon } = useRoleLabel()
// Swiper modules
@@ -666,7 +666,7 @@ const handleLogin = async () => {
if (response.success) {
await persistLoginResponse(response)
notifyLoginSuccess(response, t, formatRole, roleIcon)
notifyLoginSuccess(response, t, tm, formatRole, roleIcon)
} else {
MessagePlugin.error(response.message || t('auth.loginError'))
}