2023-10-03 12:55:53 +00:00
|
|
|
|
// 全局消息组件(顶部)
|
2023-10-13 15:05:30 +00:00
|
|
|
|
import Message from '@/components/alert/Message'
|
2023-10-03 12:55:53 +00:00
|
|
|
|
import { getErrorMessageEN, getErrorMessageCN } from './errorI18n'
|
|
|
|
|
|
|
|
|
|
const showMessage = (errorCode: number) => {
|
|
|
|
|
const messageType = 'error'
|
|
|
|
|
const messageTextEN = getErrorMessageEN(errorCode)
|
|
|
|
|
const messageTextCN = getErrorMessageCN(errorCode)
|
2023-10-13 15:05:30 +00:00
|
|
|
|
Message(messageTextEN, messageTextCN, messageType)
|
2023-10-03 12:55:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* KUNGalgame 已知错误处理函数,错误代码与后端协同
|
|
|
|
|
*/
|
|
|
|
|
export const kungalgameErrorHandler = (errorNumber: number) => {
|
|
|
|
|
showMessage(errorNumber)
|
|
|
|
|
}
|