feat: 表单编辑器magic-api调用不会弹框,而是以图标闪烁的形式显示
This commit is contained in:
@ -22,10 +22,12 @@ import { useGo } from '/@/hooks/web/usePage';
|
||||
import { validateScript } from '/@/utils/event/design';
|
||||
import { notification } from 'ant-design-vue';
|
||||
import { throttle } from 'lodash-es';
|
||||
import useGlobalFlag from '/@/hooks/core/useGlobalFlag';
|
||||
|
||||
const globSetting = useGlobSetting();
|
||||
const urlPrefix = globSetting.urlPrefix;
|
||||
const { createMessage, createErrorModal } = useMessage();
|
||||
const { isEditorOpen, ajaxError } = useGlobalFlag();
|
||||
|
||||
const showNetworkError = function() {
|
||||
notification.error({
|
||||
@ -92,10 +94,14 @@ const transform: AxiosTransform = {
|
||||
|
||||
// errorMessageMode=‘modal’的时候会显示modal错误弹窗,而不是消息提示,用于一些比较重要的错误
|
||||
// errorMessageMode='none' 一般是调用时明确表示不希望自动弹出错误提示
|
||||
if (options.errorMessageMode === 'modal') {
|
||||
createErrorModal({ title: t('错误提示'), content: timeoutMsg });
|
||||
} else if (options.errorMessageMode === 'message') {
|
||||
createMessage.error(timeoutMsg);
|
||||
if (options.ignoreErrorInEditor && isEditorOpen.value) {
|
||||
ajaxError();
|
||||
} else {
|
||||
if (options.errorMessageMode === 'modal') {
|
||||
createErrorModal({ title: t('错误提示'), content: timeoutMsg });
|
||||
} else if (options.errorMessageMode === 'message') {
|
||||
createMessage.error(timeoutMsg);
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error(timeoutMsg || t('请求出错,请稍候重试'));
|
||||
@ -187,6 +193,7 @@ const transform: AxiosTransform = {
|
||||
let errMessage = '';
|
||||
|
||||
try {
|
||||
|
||||
if (code === 'ECONNABORTED' && message.indexOf('timeout') !== -1) {
|
||||
trNetworkError();
|
||||
} else if (err?.includes('Network Error')) {
|
||||
|
||||
Reference in New Issue
Block a user