kun-galgame-vue/src/error/errorHandler.ts
2023-10-13 23:05:30 +08:00

18 lines
559 B
TypeScript

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