CN-749 fix: 统一error交互

This commit is contained in:
chenjinsong
2023-03-16 19:07:37 +08:00
parent 831b00fc78
commit 3aa2c19dbd
22 changed files with 420 additions and 382 deletions

View File

@@ -1,5 +1,6 @@
import { hasButton } from '@/permission'
import { dateFormatByAppearance } from '@/utils/date-util'
import { commonErrorTip } from '@/utils/constants'
export default {
data () {
return {
@@ -29,6 +30,16 @@ export default {
hasButton (code) {
return hasButton(this.$store.getters.buttonList, code)
},
errorMsgHandler (axiosError) {
if (axiosError.response) {
if (axiosError.response.data) {
return axiosError.response.data.message || commonErrorTip
}
} else if (axiosError.message) {
return axiosError.message
}
return commonErrorTip
},
isBuiltIn (row) {
return (row.buildIn && row.buildIn === 1) || (row.builtIn && row.builtIn === 1)
},