401提示多语言

This commit is contained in:
李志鹏
2026-06-04 09:41:14 +08:00
parent 8cc646f4b8
commit d789edcc80
3 changed files with 7 additions and 3 deletions

View File

@@ -48,7 +48,8 @@ export default {
submit: 'Submit',
enterNewPassword: 'Enter a new password for<br/><span>{email}</span>',
passwordsDoNotMatch: 'Passwords do not match',
logOffTip: 'Are you sure to log off?'
logOffTip: 'Are you sure to log off?',
pleaseLogTip: 'Please log in and try again.',
},
RegisterSuccess: {
title1: 'Welcome to Stylish Parade!',

View File

@@ -46,7 +46,8 @@ export default {
submit: '提交',
enterNewPassword: '请输入新密码<br/><span>{email}</span>',
passwordsDoNotMatch: '两次输入密码不一致',
logOffTip: '确定退出登录吗?'
logOffTip: '确定退出登录吗?',
pleaseLogTip: '请重新登录并重试。',
},
RegisterSuccess: {
title1: '欢迎来到 Stylish Parade',

View File

@@ -2,6 +2,8 @@ import axios from 'axios'
import router from '@/router/index'
import { useGlobalStore, useUserInfoStore } from '@/stores'
import { ElMessage } from 'element-plus'
import i18n from '@/lang'
const t = i18n.global.t
// 扩展 AxiosRequestConfig 接口
declare module 'axios' {
@@ -117,7 +119,7 @@ service.interceptors.response.use(
// })
ElMessage({
type: 'error',
message: 'Please log in and try again.',
message: t("Login.pleaseLogTip"),
duration: 5000
})
useUserInfoStore().logout()