|
@@ -10,7 +10,7 @@ import { checkStatus } from './checkStatus';
|
|
|
import { useGlobSetting } from '/@/hooks/setting';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
import { RequestEnum, ResultEnum, ContentTypeEnum } from '/@/enums/httpEnum';
|
|
|
-import { isString } from '/@/utils/is';
|
|
|
+import { isString, isUnDef, isNull, isEmpty } from '/@/utils/is';
|
|
|
import { getToken } from '/@/utils/auth';
|
|
|
import { setObjToUrlParams, deepMerge } from '/@/utils';
|
|
|
import { useErrorLogStoreWithOut } from '/@/store/modules/errorLog';
|
|
@@ -57,9 +57,11 @@ const transform: AxiosTransform = {
|
|
|
const hasSuccess = data && Reflect.has(data, 'code') && code === ResultEnum.SUCCESS;
|
|
|
if (hasSuccess) {
|
|
|
let successMsg = message;
|
|
|
- if (successMsg === null || successMsg === undefined || successMsg === '') {
|
|
|
- successMsg = '操作成功';
|
|
|
+
|
|
|
+ if (isNull(successMsg) || isUnDef(successMsg) || isEmpty(successMsg)) {
|
|
|
+ successMsg = t(`sys.api.operationSuccess`);
|
|
|
}
|
|
|
+
|
|
|
if (options.successMessageMode === 'modal') {
|
|
|
createSuccessModal({ title: t('sys.api.successTip'), content: successMsg });
|
|
|
} else if (options.successMessageMode === 'message') {
|