@zgfe/modules-settings 1.2.8-node.1 → 1.2.8-node.4

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.
@@ -46,11 +46,6 @@ var AppDataAccessFilter = function AppDataAccessFilter() {
46
46
  }
47
47
  }).catch(function (err) {});
48
48
  }, []);
49
- // 保存按钮禁用逻辑
50
- var disableBtn = function disableBtn(form) {
51
- var value = form.getFieldsValue();
52
- return !form.isFieldTouched('ip') && !form.isFieldTouched('ua') || JSON.stringify(initialValues) === JSON.stringify(value);
53
- };
54
49
  // 保存
55
50
  var onSubmit = function onSubmit(value) {
56
51
  var ip = value.ip,
@@ -9,10 +9,9 @@ import React, { useContext, useEffect, useRef, useState } from 'react';
9
9
  import './index.less';
10
10
  import util from './../../../utils/util';
11
11
  import { Button, Form, Input, notification } from 'antd';
12
- import request, { selfRequest } from './../../../utils/ajax';
13
- // import urlRequest from 'umi-request';
12
+ import request from './../../../utils/ajax';
14
13
  import api from './../../../constants/api';
15
- import { BizTable, BizDialog, BizGlobalDataContext } from '@zgfe/business-lib';
14
+ import { BizTable, BizDialog, BizGlobalDataContext, ajax } from '@zgfe/business-lib';
16
15
  var reworkAppName = function reworkAppName(name) {
17
16
  return name.length > 15 ? "".concat(name.substring(0, 15), "...") : name;
18
17
  };
@@ -280,54 +279,31 @@ var appList = function appList(props) {
280
279
  }
281
280
  setCreateAppLoading(true);
282
281
  var msg = '';
283
- selfRequest(api.app.createApp, {
282
+ ajax(api.app.createApp, {
284
283
  method: 'post',
285
284
  data: {
286
- app_name: appNameVal,
285
+ appName: appNameVal,
287
286
  companyId: companyId
288
287
  }
289
288
  }).then(function (res) {
290
- if (res.flag === 101) {
291
- setCreatedAppPanel(false);
292
- // window.track('应用-创建应用', {
293
- // 是否首次: companyRealAppList.length ? '否' : '是',
294
- // 应用名称: 'name'
295
- // })
296
- var cloneAuthConfig = util.clone(authConfig);
297
- cloneAuthConfig.dataAuth.unshift({
298
- appId: res.app_info.id,
299
- plats: [0]
300
- });
301
- var formData = {
302
- userId: id,
303
- authConfig: JSON.stringify(cloneAuthConfig),
304
- groupIds: findGroups().join(',')
305
- };
306
- // 通知数据刷新
307
- createAppCallback(formData, res.app_info.id);
308
- msg = '创建应用成功';
309
- notification.success({
310
- message: msg
311
- });
312
- } else {
313
- switch (res.flag) {
314
- case 201:
315
- msg = '创建失败,应用数量达到限制';
316
- break;
317
- case 202:
318
- msg = '创建失败,该名称已存在';
319
- break;
320
- case 203:
321
- msg = '创建失败,无权限';
322
- break;
323
- default:
324
- msg = '创建应用接口错误,请重试';
325
- break;
326
- }
327
- notification.error({
328
- message: msg
329
- });
330
- }
289
+ if (!res) return;
290
+ setCreatedAppPanel(false);
291
+ var cloneAuthConfig = util.clone(authConfig);
292
+ cloneAuthConfig.dataAuth.unshift({
293
+ appId: res.data.appInfo.id,
294
+ plats: [0]
295
+ });
296
+ var formData = {
297
+ userId: id,
298
+ authConfig: JSON.stringify(cloneAuthConfig),
299
+ groupIds: findGroups().join(',')
300
+ };
301
+ // 通知数据刷新
302
+ createAppCallback(formData, res.data.appInfo.id);
303
+ msg = '创建应用成功';
304
+ notification.success({
305
+ message: msg
306
+ });
331
307
  }).catch(function () {
332
308
  notification.error({
333
309
  message: '创建失败,请重试'
@@ -391,6 +367,7 @@ var appList = function appList(props) {
391
367
  }, "\u786E\u8BA4\u5220\u9664\u6B64\u5E94\u7528\u5417\uFF1F\u5220\u9664\u540E\u5E94\u7528\u7684\u6570\u636E\u5C06\u4E0D\u518D\u53EF\u7528"), /*#__PURE__*/React.createElement("div", {
392
368
  className: "app-list-content"
393
369
  }, /*#__PURE__*/React.createElement(BizTable, {
370
+ rowKey: "id",
394
371
  dataSource: system === 'CEP' ? cepAppList : companyRealAppList,
395
372
  columns: columns,
396
373
  pagination: false
@@ -72,10 +72,6 @@ var multiAuthModule = function multiAuthModule(props) {
72
72
  setFunctionGroups(dealArr);
73
73
  change(checked, false, dealArr);
74
74
  };
75
- var checkedAll = function checkedAll(checked) {
76
- setAll(checked);
77
- onAllChange();
78
- };
79
75
  var change = function change(all, indeterminate, functionGroups) {
80
76
  var dealData = _objectSpread(_objectSpread({}, data), {}, {
81
77
  checked: all,
@@ -10,9 +10,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
10
10
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
11
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
12
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
- import React, { useContext, useEffect, useRef, useState } from 'react';
13
+ import React, { useEffect, useRef, useState } from 'react';
14
14
  import './styles/user.less';
15
- import { BizGlobalDataContext } from '@zgfe/business-lib';
16
15
  import { Button, notification, Tabs, Select } from 'antd';
17
16
  import request from './../../../utils/ajax';
18
17
  import AuthConfig from './authConfig';
@@ -33,10 +32,6 @@ var Info = function Info(props) {
33
32
  label: item.groupName
34
33
  });
35
34
  });
36
- var _useContext = useContext(BizGlobalDataContext),
37
- currentApp = _useContext.currentApp,
38
- currentUser = _useContext.currentUser,
39
- isDemo = _useContext.isDemo;
40
35
  // SelectProps<string, { value: number; label: string; }>
41
36
  var _useState = useState([]),
42
37
  _useState2 = _slicedToArray(_useState, 2),
@@ -40,98 +40,88 @@ var CompanySetting = function CompanySetting(props) {
40
40
  showVirtualApp = _ref.showVirtualApp,
41
41
  showDataDaily = _ref.showDataDaily,
42
42
  ENVIRONMENT = _ref.ENVIRONMENT;
43
- var _useState = useState('info'),
44
- _useState2 = _slicedToArray(_useState, 2),
45
- currentTab = _useState2[0],
46
- setCurrentTab = _useState2[1];
47
43
  // getCurrentUser
48
- var _useState3 = useState(),
44
+ var _useState = useState(),
45
+ _useState2 = _slicedToArray(_useState, 2),
46
+ settingCurrentUser = _useState2[0],
47
+ setSettingCurrentUser = _useState2[1];
48
+ var _useState3 = useState([]),
49
49
  _useState4 = _slicedToArray(_useState3, 2),
50
- settingCurrentUser = _useState4[0],
51
- setSettingCurrentUser = _useState4[1];
52
- var _useState5 = useState([]),
50
+ dataAuth = _useState4[0],
51
+ setDataAuth = _useState4[1];
52
+ var _useState5 = useState(false),
53
53
  _useState6 = _slicedToArray(_useState5, 2),
54
- dataAuth = _useState6[0],
55
- setDataAuth = _useState6[1];
54
+ isAdmin = _useState6[0],
55
+ setIsAdmin = _useState6[1];
56
56
  var _useState7 = useState(false),
57
57
  _useState8 = _slicedToArray(_useState7, 2),
58
- isAdmin = _useState8[0],
59
- setIsAdmin = _useState8[1];
60
- var _useState9 = useState(false),
58
+ isDemoAccount = _useState8[0],
59
+ setIsDemoAccount = _useState8[1];
60
+ var _useState9 = useState(),
61
61
  _useState10 = _slicedToArray(_useState9, 2),
62
- isDemoAccount = _useState10[0],
63
- setIsDemoAccount = _useState10[1];
62
+ authConfig = _useState10[0],
63
+ setAuthConfig = _useState10[1];
64
64
  var _useState11 = useState(),
65
65
  _useState12 = _slicedToArray(_useState11, 2),
66
- authConfig = _useState12[0],
67
- setAuthConfig = _useState12[1];
68
- var _useState13 = useState(),
66
+ id = _useState12[0],
67
+ setId = _useState12[1];
68
+ var _useState13 = useState(''),
69
69
  _useState14 = _slicedToArray(_useState13, 2),
70
- id = _useState14[0],
71
- setId = _useState14[1];
72
- var _useState15 = useState(''),
70
+ companyName = _useState14[0],
71
+ setCompanyName = _useState14[1];
72
+ var _useState15 = useState(),
73
73
  _useState16 = _slicedToArray(_useState15, 2),
74
- companyName = _useState16[0],
75
- setCompanyName = _useState16[1];
76
- var _useState17 = useState(),
77
- _useState18 = _slicedToArray(_useState17, 2),
78
- companyId = _useState18[0],
79
- setCompanyId = _useState18[1];
74
+ companyId = _useState16[0],
75
+ setCompanyId = _useState16[1];
80
76
  // groupInfos
81
- var _useState19 = useState([]),
77
+ var _useState17 = useState([]),
78
+ _useState18 = _slicedToArray(_useState17, 2),
79
+ allGroupInfos = _useState18[0],
80
+ setAllGroupInfos = _useState18[1];
81
+ var _useState19 = useState({}),
82
82
  _useState20 = _slicedToArray(_useState19, 2),
83
- allGroupInfos = _useState20[0],
84
- setAllGroupInfos = _useState20[1];
85
- var _useState21 = useState({}),
86
- _useState22 = _slicedToArray(_useState21, 2),
87
- groupHashList = _useState22[0],
88
- setGroupHashList = _useState22[1];
83
+ groupHashList = _useState20[0],
84
+ setGroupHashList = _useState20[1];
89
85
  // queryAppList
90
86
  // companyAppList:公司内所有应用,包括无权限的应用(普通应用、虚拟应用)
91
87
  // appList: 当前用户有权限的应用(普通应用、虚拟应用)
88
+ var _useState21 = useState([]),
89
+ _useState22 = _slicedToArray(_useState21, 2),
90
+ companyAppList = _useState22[0],
91
+ setCompanyAppList = _useState22[1];
92
92
  var _useState23 = useState([]),
93
93
  _useState24 = _slicedToArray(_useState23, 2),
94
- companyAppList = _useState24[0],
95
- setCompanyAppList = _useState24[1];
94
+ appList = _useState24[0],
95
+ setAppList = _useState24[1];
96
96
  var _useState25 = useState([]),
97
97
  _useState26 = _slicedToArray(_useState25, 2),
98
- appList = _useState26[0],
99
- setAppList = _useState26[1];
98
+ companyRealAppList = _useState26[0],
99
+ setCompanyRealAppList = _useState26[1];
100
+ // queryLeftMenus
100
101
  var _useState27 = useState([]),
101
102
  _useState28 = _slicedToArray(_useState27, 2),
102
- companyRealAppList = _useState28[0],
103
- setCompanyRealAppList = _useState28[1];
104
- // queryLeftMenus
105
- var _useState29 = useState([]),
103
+ leftMenus = _useState28[0],
104
+ setLeftMenus = _useState28[1];
105
+ var _useState29 = useState(0),
106
106
  _useState30 = _slicedToArray(_useState29, 2),
107
- leftMenus = _useState30[0],
108
- setLeftMenus = _useState30[1];
109
- var _useState31 = useState({}),
107
+ serviceType = _useState30[0],
108
+ setServiceType = _useState30[1];
109
+ var _useState31 = useState(0),
110
110
  _useState32 = _slicedToArray(_useState31, 2),
111
- menusNameMap = _useState32[0],
112
- setMenusNameMap = _useState32[1];
113
- var _useState33 = useState(0),
111
+ pageReady = _useState32[0],
112
+ setPageReady = _useState32[1];
113
+ var _useState33 = useState(false),
114
114
  _useState34 = _slicedToArray(_useState33, 2),
115
- serviceType = _useState34[0],
116
- setServiceType = _useState34[1];
117
- var _useState35 = useState(0),
118
- _useState36 = _slicedToArray(_useState35, 2),
119
- pageReady = _useState36[0],
120
- setPageReady = _useState36[1];
121
- var _useState37 = useState(false),
122
- _useState38 = _slicedToArray(_useState37, 2),
123
- isShowCreateApp = _useState38[0],
124
- setIsShowCreateApp = _useState38[1];
115
+ isShowCreateApp = _useState34[0],
116
+ setIsShowCreateApp = _useState34[1];
125
117
  useEffect(function () {
126
118
  getSettingData();
127
119
  apisOkNum = 0;
128
120
  }, []);
129
121
  useEffect(function () {
130
122
  if (action == 'createApp') {
131
- setCurrentTab('appList');
132
123
  setIsShowCreateApp(true);
133
124
  } else {
134
- setCurrentTab('info');
135
125
  setIsShowCreateApp(false);
136
126
  }
137
127
  }, [props.action]);
@@ -202,7 +192,7 @@ var CompanySetting = function CompanySetting(props) {
202
192
  }
203
193
  apisOkNum += 1;
204
194
  setPageReady(apisOkNum);
205
- }).catch(function (err) {
195
+ }).catch(function () {
206
196
  notification.error({
207
197
  message: '信息获取失败'
208
198
  });
@@ -226,15 +216,14 @@ var CompanySetting = function CompanySetting(props) {
226
216
  };
227
217
  formatMenus(menus);
228
218
  setLeftMenus(menus);
229
- setMenusNameMap(menusNameMap);
230
219
  apisOkNum += 1;
231
220
  setPageReady(apisOkNum);
232
- }).catch(function (err) {
221
+ }).catch(function () {
233
222
  notification.error({
234
223
  message: '信息获取失败'
235
224
  });
236
225
  });
237
- }).catch(function (err) {
226
+ }).catch(function () {
238
227
  notification.error({
239
228
  message: '信息获取失败'
240
229
  });
@@ -247,7 +236,7 @@ var CompanySetting = function CompanySetting(props) {
247
236
  }
248
237
  apisOkNum += 1;
249
238
  setPageReady(apisOkNum);
250
- }).catch(function (err) {
239
+ }).catch(function () {
251
240
  notification.error({
252
241
  message: '信息获取失败'
253
242
  });
@@ -260,7 +249,7 @@ var CompanySetting = function CompanySetting(props) {
260
249
  if (res && res.flag === 101) {
261
250
  setAllGroupInfos((res.infos || []).reverse());
262
251
  }
263
- }).catch(function (err) {
252
+ }).catch(function () {
264
253
  notification.error({
265
254
  message: '信息获取失败'
266
255
  });
@@ -270,10 +259,10 @@ var CompanySetting = function CompanySetting(props) {
270
259
  return request(api.setting.updateUserAuth, {
271
260
  method: 'post',
272
261
  params: params
273
- }).then(function (res) {
262
+ }).then(function () {
274
263
  // if (res.flag === 101) {
275
264
  // }
276
- }).catch(function (err) {
265
+ }).catch(function () {
277
266
  notification.error({
278
267
  message: '信息获取失败'
279
268
  });
@@ -620,7 +609,7 @@ var CompanySetting = function CompanySetting(props) {
620
609
  // 用来处理同步主应用可能需要的刷新的逻辑, 可不传
621
610
  settingCallback && settingCallback('settingCloseCreateCallback');
622
611
  };
623
- var changeTab = function changeTab(tab) {
612
+ var changeTab = function changeTab() {
624
613
  // setCurrentTab(tab);
625
614
  setIsShowCreateApp(false);
626
615
  };
@@ -26,7 +26,7 @@ var Info = function Info(props) {
26
26
  var updateLicense = function updateLicense(license) {
27
27
  request(api.setting.updateLicense, {
28
28
  method: 'post',
29
- params: {
29
+ data: {
30
30
  license: license
31
31
  }
32
32
  }).then(function (res) {
@@ -14,8 +14,6 @@ import AuthConfigDetail from './../userGroup/authConfigDetail';
14
14
  import CompanySettingUser from './../edit/user';
15
15
  import Invite from './invite';
16
16
  import { BizTable, BizDialog, BizSelect } from '@zgfe/business-lib';
17
- var TextArea = Input.TextArea,
18
- Search = Input.Search;
19
17
  var splitString = function splitString(str) {
20
18
  var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
21
19
  return str.length > len ? "".concat(str.substring(0, len), "...") : str;
@@ -16,7 +16,6 @@ import constants from './../../../utils/constants';
16
16
  import { Button, Input, notification, Select } from 'antd';
17
17
  import request from './../../../utils/ajax';
18
18
  import apis from './../../../constants/api';
19
- var TextArea = Input.TextArea;
20
19
  var UserGroup = function UserGroup(props) {
21
20
  var ENVIRONMENT = props.ENVIRONMENT,
22
21
  allGroupInfos = props.allGroupInfos,
@@ -7,14 +7,13 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React, { useState } from 'react';
8
8
  import './index.less';
9
9
  import { BizDialog } from '@zgfe/business-lib';
10
- import { Button, Input, notification, Popover } from 'antd';
10
+ import { Button, notification, Popover } from 'antd';
11
11
  import request from './../../../utils/ajax';
12
12
  import apis from './../../../constants/api';
13
13
  import AuthConfigDetail from './authConfigDetail';
14
14
  import util from '../../../utils/util';
15
15
  // import companySettingUserGroup from '../edit/userGroup'
16
16
  // import groupItem from './groupItem.vue'
17
- var TextArea = Input.TextArea;
18
17
  var GroupItem = function GroupItem(props) {
19
18
  var groupData = props.groupData,
20
19
  companyAppList = props.companyAppList,
@@ -4,14 +4,12 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
5
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import React, { useContext, useEffect, useRef, useState } from 'react';
7
+ import React, { useEffect, useRef, useState } from 'react';
8
8
  import './index.less';
9
- import { BizGlobalDataContext } from '@zgfe/business-lib';
10
9
  import { Input } from 'antd';
11
10
  import PageLoading from '../../../components/pageLoading';
12
11
  import GroupItem from './groupItem';
13
12
  import CompanySettingUserGroup from '../edit/userGroup';
14
- var TextArea = Input.TextArea;
15
13
  var UserGroup = function UserGroup(props) {
16
14
  var id = props.id,
17
15
  allGroupInfos = props.allGroupInfos,
@@ -21,10 +19,6 @@ var UserGroup = function UserGroup(props) {
21
19
  serviceType = props.serviceType,
22
20
  delGroupCallback = props.delGroupCallback,
23
21
  updateGroupAuthCallback = props.updateGroupAuthCallback;
24
- var _useContext = useContext(BizGlobalDataContext),
25
- currentApp = _useContext.currentApp,
26
- currentUser = _useContext.currentUser,
27
- isDemo = _useContext.isDemo;
28
22
  var _useState = useState([]),
29
23
  _useState2 = _slicedToArray(_useState, 2),
30
24
  showGroups = _useState2[0],
@@ -128,7 +122,7 @@ var UserGroup = function UserGroup(props) {
128
122
  className: "create-model"
129
123
  }, /*#__PURE__*/React.createElement("span", {
130
124
  className: "icon-add-thin"
131
- }, "\u521B\u5EFA\u7528\u6237\u7EC4")), showGroups.map(function (item, index) {
125
+ }, "\u521B\u5EFA\u7528\u6237\u7EC4")), showGroups.map(function (item) {
132
126
  return /*#__PURE__*/React.createElement(GroupItem, {
133
127
  key: item.id,
134
128
  groupData: item,
@@ -8,7 +8,7 @@ import React, { useEffect, useState } from 'react';
8
8
  import './styles/config.less';
9
9
  import './styles/table.less';
10
10
  import { Button, notification } from 'antd';
11
- import { selfRequest } from './../../../utils/ajax';
11
+ import request from './../../../utils/ajax';
12
12
  import api from './../../../constants/api';
13
13
  import SourceItem from './panels/sourceItem';
14
14
  import util from '../../../utils/util';
@@ -72,21 +72,15 @@ var Config = function Config(props) {
72
72
  return item;
73
73
  })))
74
74
  };
75
- selfRequest(api.app.editVirtualApp, {
75
+ request(api.app.editVirtualApp, {
76
76
  method: 'post',
77
77
  data: params
78
- }).then(function (res) {
79
- if (res.code === 10001) {
80
- notification.success({
81
- message: '修改成功!'
82
- });
83
- editVirtualAppCallback && editVirtualAppCallback(virtualAppsIdMap[selectApp.app_id].app_id);
84
- onCancel();
85
- } else {
86
- notification.error({
87
- message: '修改失败,请重试!'
88
- });
89
- }
78
+ }).then(function () {
79
+ notification.success({
80
+ message: '修改成功!'
81
+ });
82
+ editVirtualAppCallback && editVirtualAppCallback(virtualAppsIdMap[selectApp.app_id].app_id);
83
+ onCancel();
90
84
  }).catch(function (error) {
91
85
  notification.error({
92
86
  message: '修改失败,请重试!'
@@ -8,7 +8,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
8
8
  import React, { useEffect, useState } from 'react';
9
9
  import './styles/index.less';
10
10
  import { Form, Input, Button, notification } from 'antd';
11
- import request, { selfRequest } from './../../../utils/ajax';
11
+ import request from './../../../utils/ajax';
12
12
  import api from './../../../constants/api';
13
13
  import PageLoading from '../../../components/pageLoading';
14
14
  import VirtualAppList from './panels/list';
@@ -104,53 +104,33 @@ var VirtualApp = function VirtualApp(props) {
104
104
  });
105
105
  };
106
106
  var onSubmit = function onSubmit(e) {
107
- selfRequest(api.app.createApp, {
107
+ request(api.app.createApp, {
108
108
  method: 'post',
109
109
  data: {
110
- app_name: e.appNameVal,
111
- app_type: 'virtual',
110
+ appName: e.appNameVal,
111
+ appType: 'virtual',
112
112
  companyId: companyId
113
113
  }
114
114
  }).then(function (res) {
115
- if (res.flag === 101) {
116
- notification.success({
117
- message: '创建成功'
118
- });
119
- setStatus('list');
120
- var dealAuthConfig = util.clone(authConfig);
121
- if (!(dealAuthConfig.dataAuth.length === 1 && dealAuthConfig.dataAuth[0].appId === 0)) {
122
- dealAuthConfig.dataAuth.unshift({
123
- appId: res.app_info.id,
124
- plats: [0]
125
- });
126
- }
127
- var formData = {
128
- userId: id,
129
- authConfig: JSON.stringify(dealAuthConfig),
130
- groupIds: userOfGroups.join(',')
131
- };
132
- createVirtualAppCallback && createVirtualAppCallback(res, formData);
133
- queryVirtualApps();
134
- } else {
135
- var msg = '创建失败,请重试';
136
- switch (res.flag) {
137
- case 201:
138
- msg = '创建失败,应用数量达到限制';
139
- break;
140
- case 202:
141
- msg = '该名称已存在';
142
- break;
143
- case 203:
144
- msg = '无权限';
145
- break;
146
- default:
147
- msg = '创建失败,请重试';
148
- break;
149
- }
150
- notification.error({
151
- message: msg
115
+ if (!res) return;
116
+ notification.success({
117
+ message: '创建成功'
118
+ });
119
+ setStatus('list');
120
+ var dealAuthConfig = util.clone(authConfig);
121
+ if (!(dealAuthConfig.dataAuth.length === 1 && dealAuthConfig.dataAuth[0].appId === 0)) {
122
+ dealAuthConfig.dataAuth.unshift({
123
+ appId: res.data.appInfo.id,
124
+ plats: [0]
152
125
  });
153
126
  }
127
+ var formData = {
128
+ userId: id,
129
+ authConfig: JSON.stringify(dealAuthConfig),
130
+ groupIds: userOfGroups.join(',')
131
+ };
132
+ createVirtualAppCallback && createVirtualAppCallback(res, formData);
133
+ queryVirtualApps();
154
134
  }).catch(function (error) {
155
135
  notification.error({
156
136
  message: '创建失败,请重试'
@@ -7,7 +7,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React, { useEffect, useState } from 'react';
8
8
  import './../styles/sourceItem.less';
9
9
  import { Transfer, Checkbox } from 'antd';
10
- import { selfRequest } from './../../../../utils/ajax';
10
+ import request from './../../../../utils/ajax';
11
11
  import api from './../../../../constants/api';
12
12
  import util from '../../../../utils/util';
13
13
  var VirtualApp = function VirtualApp(props) {
@@ -48,13 +48,14 @@ var VirtualApp = function VirtualApp(props) {
48
48
  useEffect(function () {
49
49
  if (showTransfer) {
50
50
  // 第一次展开时:查询当前源应用的事件列表
51
- selfRequest(api.eventMeta.queryEventMeta, {
51
+ request(api.eventMeta.queryEventMeta, {
52
52
  method: 'post',
53
53
  data: {
54
54
  appId: sourceAppId,
55
55
  plat: 0
56
56
  }
57
57
  }).then(function (res) {
58
+ if (!res) return;
58
59
  var eventList = [];
59
60
  var groups = res.data;
60
61
  groups.forEach(function (group) {
@@ -48,10 +48,6 @@ var SecurityLog = function SecurityLog() {
48
48
  _useState12 = _slicedToArray(_useState11, 2),
49
49
  tableData = _useState12[0],
50
50
  setTableData = _useState12[1];
51
- var _useState13 = useState(0),
52
- _useState14 = _slicedToArray(_useState13, 2),
53
- time = _useState14[0],
54
- setTime = _useState14[1];
55
51
  var columns = [{
56
52
  title: '详情',
57
53
  dataIndex: 'operationType',
@@ -17,9 +17,8 @@ var ItemEdit = function ItemEdit(props) {
17
17
  editCancel = props.editCancel,
18
18
  onSubmit = props.onSubmit;
19
19
  var _useState = useState(editSetting.config),
20
- _useState2 = _slicedToArray(_useState, 2),
21
- initialValues = _useState2[0],
22
- setInitialValues = _useState2[1];
20
+ _useState2 = _slicedToArray(_useState, 1),
21
+ initialValues = _useState2[0];
23
22
  var settingsOptionsMap = new Map().set('email', {
24
23
  config: [{
25
24
  name: 'host',
@@ -1,5 +1,4 @@
1
1
  import { ajaxConfig } from '@zgfe/business-lib/es/utils/type';
2
2
  declare function request<T>(url: string, options: ajaxConfig<T>): Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<T> | null>;
3
3
  export declare function urlRequest<T>(url: string, options: ajaxConfig<T>): Promise<import("@zgfe/business-lib/es/utils/type").InterfaceApiResult<T> | null>;
4
- export declare function selfRequest<T>(url: string, options: ajaxConfig<T>): Promise<any>;
5
4
  export default request;
package/es/utils/ajax.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { ajax } from '@zgfe/business-lib';
2
- import Request from 'umi-request';
3
2
  function request(url, options) {
4
3
  return ajax(url, options);
5
4
  }
@@ -21,22 +20,4 @@ export function urlRequest(url, options) {
21
20
  data ? options.data = transformRequest(data) : options.data = data;
22
21
  return ajax(url, options);
23
22
  }
24
- export function selfRequest(url, options) {
25
- var data = options.data,
26
- headers = options.headers;
27
- headers ? options.headers = Object.assign(options.headers, {
28
- 'Content-Type': 'application/x-www-form-urlencoded'
29
- }) : options.headers = {
30
- 'Content-Type': 'application/x-www-form-urlencoded'
31
- };
32
- var transformRequest = function transformRequest(params) {
33
- var arr = [];
34
- for (var key in params) {
35
- arr.push("".concat(key, "=").concat(encodeURIComponent(params[key])));
36
- }
37
- return arr.join('&');
38
- };
39
- data ? options.data = transformRequest(data) : options.data = data;
40
- return Request(url, options);
41
- }
42
23
  export default request;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-settings",
3
- "version": "1.2.8-node.1",
3
+ "version": "1.2.8-node.4",
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": "5f1861c19a3aa6e6b49a4ff284089a8f0b44c81a",
54
+ "gitHead": "2cf99a13a326d3efadadda1315e63a296c08a87c",
55
55
  "gitHooks": {
56
56
  "pre-commit": "lint-staged"
57
57
  }