@bit-sun/business-component 2.4.21 → 2.4.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -12093,16 +12093,21 @@ var doDetailPageAction = function doDetailPageAction(config) {
12093
12093
  successMessage: config === null || config === void 0 ? void 0 : config.successMessage
12094
12094
  };
12095
12095
  var onOk = function onOk() {
12096
- request$1(requestConfig).then(function (res) {
12097
- if (config.backPath) {
12098
- history.push({
12099
- pathname: config.backPath
12100
- });
12101
- }
12102
- // 是否执行成功之后的回调
12103
- if (typeof config.successCb === 'function') {
12104
- config.successCb(res);
12105
- }
12096
+ return new Promise(function (resolve, reject) {
12097
+ request$1(requestConfig).then(function (res) {
12098
+ resolve(res);
12099
+ if (config.backPath) {
12100
+ history.push({
12101
+ pathname: config.backPath
12102
+ });
12103
+ }
12104
+ // 是否执行成功之后的回调
12105
+ if (typeof config.successCb === 'function') {
12106
+ config.successCb(res);
12107
+ }
12108
+ }).catch(function (error) {
12109
+ return reject(error);
12110
+ });
12106
12111
  });
12107
12112
  };
12108
12113
  if (config.noConfirm) {
package/dist/index.js CHANGED
@@ -12113,16 +12113,21 @@ var doDetailPageAction = function doDetailPageAction(config) {
12113
12113
  successMessage: config === null || config === void 0 ? void 0 : config.successMessage
12114
12114
  };
12115
12115
  var onOk = function onOk() {
12116
- bssula.request(requestConfig).then(function (res) {
12117
- if (config.backPath) {
12118
- umi.history.push({
12119
- pathname: config.backPath
12120
- });
12121
- }
12122
- // 是否执行成功之后的回调
12123
- if (typeof config.successCb === 'function') {
12124
- config.successCb(res);
12125
- }
12116
+ return new Promise(function (resolve, reject) {
12117
+ bssula.request(requestConfig).then(function (res) {
12118
+ resolve(res);
12119
+ if (config.backPath) {
12120
+ umi.history.push({
12121
+ pathname: config.backPath
12122
+ });
12123
+ }
12124
+ // 是否执行成功之后的回调
12125
+ if (typeof config.successCb === 'function') {
12126
+ config.successCb(res);
12127
+ }
12128
+ }).catch(function (error) {
12129
+ return reject(error);
12130
+ });
12126
12131
  });
12127
12132
  };
12128
12133
  if (config.noConfirm) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bit-sun/business-component",
3
- "version": "2.4.21",
3
+ "version": "2.4.22",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -4,6 +4,7 @@ import { Modal } from 'antd';
4
4
  import { ExclamationCircleOutlined } from '@ant-design/icons';
5
5
  import React from 'react';
6
6
  import { history } from 'umi';
7
+ import { handleError } from '@/utils/requestUtils';
7
8
 
8
9
  interface actionItem {
9
10
  [propName: string]: any;
@@ -21,17 +22,20 @@ export const doDetailPageAction = (config: actionItem) => {
21
22
 
22
23
 
23
24
  const onOk = () => {
24
- request(requestConfig).then((res) => {
25
- if (config.backPath) {
26
- history.push({
27
- pathname: config.backPath
28
- })
29
- }
30
- // 是否执行成功之后的回调
31
- if (typeof (config.successCb) === 'function') {
32
- config.successCb(res);
33
- }
34
- });
25
+ return new Promise((resolve, reject) => {
26
+ request(requestConfig).then((res) => {
27
+ resolve(res);
28
+ if (config.backPath) {
29
+ history.push({
30
+ pathname: config.backPath
31
+ })
32
+ }
33
+ // 是否执行成功之后的回调
34
+ if (typeof (config.successCb) === 'function') {
35
+ config.successCb(res);
36
+ }
37
+ }).catch(error => reject(error));
38
+ })
35
39
  };
36
40
 
37
41
  if (config.noConfirm) {