401提示多语言
This commit is contained in:
@@ -48,7 +48,8 @@ export default {
|
|||||||
submit: 'Submit',
|
submit: 'Submit',
|
||||||
enterNewPassword: 'Enter a new password for<br/><span>{email}</span>',
|
enterNewPassword: 'Enter a new password for<br/><span>{email}</span>',
|
||||||
passwordsDoNotMatch: 'Passwords do not match',
|
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: {
|
RegisterSuccess: {
|
||||||
title1: 'Welcome to Stylish Parade!',
|
title1: 'Welcome to Stylish Parade!',
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ export default {
|
|||||||
submit: '提交',
|
submit: '提交',
|
||||||
enterNewPassword: '请输入新密码<br/><span>{email}</span>',
|
enterNewPassword: '请输入新密码<br/><span>{email}</span>',
|
||||||
passwordsDoNotMatch: '两次输入密码不一致',
|
passwordsDoNotMatch: '两次输入密码不一致',
|
||||||
logOffTip: '确定退出登录吗?'
|
logOffTip: '确定退出登录吗?',
|
||||||
|
pleaseLogTip: '请重新登录并重试。',
|
||||||
},
|
},
|
||||||
RegisterSuccess: {
|
RegisterSuccess: {
|
||||||
title1: '欢迎来到 Stylish Parade!',
|
title1: '欢迎来到 Stylish Parade!',
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import axios from 'axios'
|
|||||||
import router from '@/router/index'
|
import router from '@/router/index'
|
||||||
import { useGlobalStore, useUserInfoStore } from '@/stores'
|
import { useGlobalStore, useUserInfoStore } from '@/stores'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
|
import i18n from '@/lang'
|
||||||
|
const t = i18n.global.t
|
||||||
|
|
||||||
// 扩展 AxiosRequestConfig 接口
|
// 扩展 AxiosRequestConfig 接口
|
||||||
declare module 'axios' {
|
declare module 'axios' {
|
||||||
@@ -117,7 +119,7 @@ service.interceptors.response.use(
|
|||||||
// })
|
// })
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: 'Please log in and try again.',
|
message: t("Login.pleaseLogTip"),
|
||||||
duration: 5000
|
duration: 5000
|
||||||
})
|
})
|
||||||
useUserInfoStore().logout()
|
useUserInfoStore().logout()
|
||||||
|
|||||||
Reference in New Issue
Block a user