@zgfe/modules-settings 1.1.8-alpha.2 → 1.1.8-node.0

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.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -13,9 +13,10 @@ import React from 'react';
13
13
  import { useState } from 'react';
14
14
  import { useEffect } from 'react';
15
15
  import apis from '../../../constants/api';
16
- import request, { urlRequest } from '../../../utils/ajax';
16
+ import request from '../../../utils/ajax';
17
17
  import ConfigItem from './configItem';
18
18
  import ItemEdit from './edit';
19
+ import { ajax } from '@zgfe/business-lib';
19
20
  var Notice = function Notice() {
20
21
  var typeMap = new Map([[1, 'email']]);
21
22
  var _useState = useState(new Map().set('email', {
@@ -64,27 +65,26 @@ var Notice = function Notice() {
64
65
  var formData = new FormData();
65
66
  formData.set('type', editSetting.type);
66
67
  formData.set('config', JSON.stringify(values));
67
- urlRequest(apis.setting.editNoticeConfig, {
68
+ ajax(apis.setting.editNoticeConfig, {
68
69
  method: 'post',
69
- // data: formData,
70
70
  data: {
71
71
  type: editSetting.type === 'email' ? 1 : null,
72
72
  config: JSON.stringify(values)
73
73
  }
74
74
  }).then(function (res) {
75
- if ((res === null || res === void 0 ? void 0 : res.status) === 200) {
76
- notification.success({
77
- message: '配置成功'
78
- });
79
- settingMap.get(editSetting.type).config = values;
80
- var newSettingMap = new Map(_toConsumableArray(settingMap));
81
- setSettingMap(newSettingMap);
82
- setIsEdit(false);
83
- } else {
84
- notification.error({
85
- message: '配置失败'
86
- });
87
- }
75
+ if (!res) return;
76
+ notification.success({
77
+ message: '配置成功'
78
+ });
79
+ settingMap.get(editSetting.type).config = values;
80
+ var newSettingMap = new Map(_toConsumableArray(settingMap));
81
+ setSettingMap(newSettingMap);
82
+ setIsEdit(false);
83
+ }).catch(function (err) {
84
+ console.error('配置失败', err);
85
+ notification.error({
86
+ message: '配置失败'
87
+ });
88
88
  });
89
89
  };
90
90
  return /*#__PURE__*/React.createElement("div", null, isEdit ? /*#__PURE__*/React.createElement(ItemEdit, {
@@ -163,9 +163,6 @@ var standard = _objectSpread({
163
163
  userPortrait: {
164
164
  key: '/user/userPortrait'
165
165
  },
166
- userJourney: {
167
- key: '/cxp/userJourney'
168
- },
169
166
  userTags: {
170
167
  key: '/user/userTags'
171
168
  },
@@ -322,9 +319,6 @@ var mars = {
322
319
  userPortrait: {
323
320
  key: '/analysis/user/userPortrait'
324
321
  },
325
- userJourney: {
326
- key: '/cxp/userJourney'
327
- },
328
322
  custom: {
329
323
  key: '/analysis/custom'
330
324
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-settings",
3
- "version": "1.1.8-alpha.2",
3
+ "version": "1.1.8-node.0",
4
4
  "module": "es/index.js",
5
5
  "typings": "es/index.d.ts",
6
6
  "files": [
@@ -51,7 +51,7 @@
51
51
  "umi-request": "^1.4.0",
52
52
  "yorkie": "^2.0.0"
53
53
  },
54
- "gitHead": "70c06ba076d2a0699ce2e40ad077384e7d6d345f",
54
+ "gitHead": "ed9d4863127678e7f4f5ff1a121203ad85ecc933",
55
55
  "gitHooks": {
56
56
  "pre-commit": "lint-staged"
57
57
  }