kun-galgame-vue/src/error/errorHandler.ts

18 lines
559 B
TypeScript
Raw Normal View History

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)
}