@zgfe/modules-settings 1.2.8-node.0 → 1.2.8-node.10
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/es/constants/api.js +23 -23
- package/es/modules/appSettings/appInfo/index.js +15 -24
- package/es/modules/appSettings/dataAccessFilter/index.js +0 -5
- package/es/modules/companySetting/appList/index.js +23 -46
- package/es/modules/companySetting/edit/multiAuthModule.js +0 -4
- package/es/modules/companySetting/edit/user.js +1 -6
- package/es/modules/companySetting/index.js +58 -69
- package/es/modules/companySetting/info/index.js +6 -7
- package/es/modules/companySetting/user/index.js +0 -2
- package/es/modules/companySetting/user/invite.js +0 -1
- package/es/modules/companySetting/userGroup/groupItem.js +1 -2
- package/es/modules/companySetting/userGroup/index.js +2 -8
- package/es/modules/companySetting/virtualApp/config.js +8 -14
- package/es/modules/companySetting/virtualApp/index.js +21 -41
- package/es/modules/companySetting/virtualApp/panels/sourceItem.js +3 -2
- package/es/modules/personalSetting/info/index.js +2 -0
- package/es/modules/personalSetting/securityLog/index.js +0 -4
- package/es/modules/systemSetting/notice/edit/index.js +2 -3
- package/es/types/app.d.ts +3 -3
- package/es/utils/ajax.d.ts +0 -1
- package/es/utils/ajax.js +0 -19
- package/package.json +2 -2
package/es/constants/api.js
CHANGED
|
@@ -6,42 +6,42 @@ var apis = {
|
|
|
6
6
|
},
|
|
7
7
|
app: {
|
|
8
8
|
queryLeftMenus: '/zg/web/v2/index/menuList',
|
|
9
|
-
deleteApp:
|
|
9
|
+
deleteApp: '/user/deleteApp.jsp',
|
|
10
10
|
createApp: apiPrefix + '/system/createApp',
|
|
11
11
|
queryAppList: '/zg/web/v2/data/v2ajaxGetDataByApp',
|
|
12
12
|
queryPackageInfo: apiPrefix + '/system/packageInfo',
|
|
13
|
-
queryVirtualApps:
|
|
14
|
-
getCompanyAppList:
|
|
15
|
-
editVirtualApp:
|
|
16
|
-
queryAccountEvents:
|
|
17
|
-
editVirtualSourceApp:
|
|
13
|
+
queryVirtualApps: '/user/sourceApp.jsp',
|
|
14
|
+
getCompanyAppList: '/user/getCompanyAppList.jsp',
|
|
15
|
+
editVirtualApp: '/user/editDataSource.jsp',
|
|
16
|
+
queryAccountEvents: '/contract/v2queryAccountEvent.jsp',
|
|
17
|
+
editVirtualSourceApp: '/user/editSourceApp.jsp' // 修改虚拟应用的来源应用配置
|
|
18
18
|
},
|
|
19
19
|
|
|
20
20
|
setting: {
|
|
21
|
-
updateCompanyName:
|
|
21
|
+
updateCompanyName: '/company/v2updateInfo.jsp',
|
|
22
22
|
updateLicense: apiPrefix + '/system/license',
|
|
23
|
-
groupInfos:
|
|
24
|
-
getGroupMembers:
|
|
25
|
-
removeMember:
|
|
26
|
-
resetpwd:
|
|
27
|
-
updateUserAuth:
|
|
28
|
-
delSubscribeUser:
|
|
23
|
+
groupInfos: '/auth/groupInfos.jsp',
|
|
24
|
+
getGroupMembers: '/company/getGroupMembers.jsp',
|
|
25
|
+
removeMember: '/company/v2deleteUser.jsp',
|
|
26
|
+
resetpwd: '/user/resetpwd.jsp',
|
|
27
|
+
updateUserAuth: '/auth/updateUserAuth.jsp',
|
|
28
|
+
delSubscribeUser: '//wx_subscribe/deleteWxUserRelation.jsp',
|
|
29
29
|
queryFunConfigList: '/cep-console/api/v1/permission/queryFunConfigList',
|
|
30
30
|
queryAppList: '/cep-console/api/v1/permission/queryAppList',
|
|
31
31
|
queryFunConfigByUserId: '/cep-console/api/v1/permission/queryFunConfigByUserId',
|
|
32
|
-
inviteUserByPhone:
|
|
33
|
-
updateCompanyAdmin:
|
|
32
|
+
inviteUserByPhone: '/company/v2invitation.jsp',
|
|
33
|
+
updateCompanyAdmin: '/company/updateCompanyAdmin.jsp',
|
|
34
34
|
updateUserAuthCEP: '/cep-console/api/v1/permission/updateUserAuth',
|
|
35
|
-
updateGroupAuth:
|
|
36
|
-
deleteGroup:
|
|
37
|
-
wxSubscribeUserList:
|
|
35
|
+
updateGroupAuth: '/auth/updateGroupAuth.jsp',
|
|
36
|
+
deleteGroup: '/auth/deleteGroup.jsp',
|
|
37
|
+
wxSubscribeUserList: '/wx_subscribe/getWxSubscribeUserInfoList.jsp',
|
|
38
38
|
// 个人设置
|
|
39
|
-
updateUserInfo:
|
|
40
|
-
resetPassword:
|
|
39
|
+
updateUserInfo: '/user/v2ajaxUpdateUserInfo.jsp',
|
|
40
|
+
resetPassword: '/user/v2ajaxmodifypwd.jsp',
|
|
41
41
|
// 应用设置
|
|
42
|
-
updateAppName:
|
|
43
|
-
createFilter:
|
|
44
|
-
queryFilter:
|
|
42
|
+
updateAppName: '/user/updateAppName.jsp',
|
|
43
|
+
createFilter: '/user/createFilter.jsp',
|
|
44
|
+
queryFilter: '/user/queryFilter.jsp',
|
|
45
45
|
//系统设置
|
|
46
46
|
queryNoticeConfig: apiPrefix + '/systemSettings/queryNoticeSettings',
|
|
47
47
|
editNoticeConfig: apiPrefix + '/systemSettings/setNoticeSettings'
|
|
@@ -37,37 +37,28 @@ var AppInfo = function AppInfo(_ref) {
|
|
|
37
37
|
var appName = value.appName,
|
|
38
38
|
appAccount = value.appAccount;
|
|
39
39
|
var data = {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
appName: appName,
|
|
41
|
+
appId: currentApp === null || currentApp === void 0 ? void 0 : currentApp.appId
|
|
42
42
|
};
|
|
43
43
|
if (showAppAccount) {
|
|
44
|
-
data.
|
|
44
|
+
data.appAccount = appAccount;
|
|
45
45
|
}
|
|
46
46
|
urlRequest(apis.setting.updateAppName, {
|
|
47
47
|
method: 'post',
|
|
48
48
|
data: data
|
|
49
49
|
}).then(function (res) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
} else if ((res === null || res === void 0 ? void 0 : res.flag) === -102) {
|
|
63
|
-
notification.error({
|
|
64
|
-
message: '开发者角色无权限修改'
|
|
65
|
-
});
|
|
66
|
-
} else if ((res === null || res === void 0 ? void 0 : res.flag) === 202) {
|
|
67
|
-
notification.error({
|
|
68
|
-
message: '应用名称已存在'
|
|
69
|
-
});
|
|
70
|
-
}
|
|
50
|
+
notification.success({
|
|
51
|
+
message: '更改成功'
|
|
52
|
+
});
|
|
53
|
+
// 重置表单
|
|
54
|
+
setInitialValues({
|
|
55
|
+
appName: appName,
|
|
56
|
+
appAccount: appAccount
|
|
57
|
+
});
|
|
58
|
+
form.resetFields();
|
|
59
|
+
if (currentApp) currentApp.appName = appName;
|
|
60
|
+
// 主应用更新appList
|
|
61
|
+
settingsCallback('updateAppList');
|
|
71
62
|
}).catch(function () {
|
|
72
63
|
notification.error({
|
|
73
64
|
message: '修改失败,请重试'
|
|
@@ -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
|
|
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
|
-
|
|
282
|
+
ajax(api.app.createApp, {
|
|
284
283
|
method: 'post',
|
|
285
284
|
data: {
|
|
286
|
-
|
|
285
|
+
appName: appNameVal,
|
|
287
286
|
companyId: companyId
|
|
288
287
|
}
|
|
289
288
|
}).then(function (res) {
|
|
290
|
-
if (res
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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, {
|
|
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
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
var _useState5 = useState(
|
|
50
|
+
dataAuth = _useState4[0],
|
|
51
|
+
setDataAuth = _useState4[1];
|
|
52
|
+
var _useState5 = useState(false),
|
|
53
53
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
isAdmin = _useState6[0],
|
|
55
|
+
setIsAdmin = _useState6[1];
|
|
56
56
|
var _useState7 = useState(false),
|
|
57
57
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var _useState9 = useState(
|
|
58
|
+
isDemoAccount = _useState8[0],
|
|
59
|
+
setIsDemoAccount = _useState8[1];
|
|
60
|
+
var _useState9 = useState(),
|
|
61
61
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
authConfig = _useState10[0],
|
|
63
|
+
setAuthConfig = _useState10[1];
|
|
64
64
|
var _useState11 = useState(),
|
|
65
65
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
var _useState13 = useState(),
|
|
66
|
+
id = _useState12[0],
|
|
67
|
+
setId = _useState12[1];
|
|
68
|
+
var _useState13 = useState(''),
|
|
69
69
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
var _useState15 = useState(
|
|
70
|
+
companyName = _useState14[0],
|
|
71
|
+
setCompanyName = _useState14[1];
|
|
72
|
+
var _useState15 = useState(),
|
|
73
73
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
74
|
-
|
|
75
|
-
|
|
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
|
|
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
|
-
|
|
84
|
-
|
|
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
|
-
|
|
95
|
-
|
|
94
|
+
appList = _useState24[0],
|
|
95
|
+
setAppList = _useState24[1];
|
|
96
96
|
var _useState25 = useState([]),
|
|
97
97
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
companyRealAppList = _useState26[0],
|
|
99
|
+
setCompanyRealAppList = _useState26[1];
|
|
100
|
+
// queryLeftMenus
|
|
100
101
|
var _useState27 = useState([]),
|
|
101
102
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
var _useState29 = useState([]),
|
|
103
|
+
leftMenus = _useState28[0],
|
|
104
|
+
setLeftMenus = _useState28[1];
|
|
105
|
+
var _useState29 = useState(0),
|
|
106
106
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
var _useState31 = useState(
|
|
107
|
+
serviceType = _useState30[0],
|
|
108
|
+
setServiceType = _useState30[1];
|
|
109
|
+
var _useState31 = useState(0),
|
|
110
110
|
_useState32 = _slicedToArray(_useState31, 2),
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
var _useState33 = useState(
|
|
111
|
+
pageReady = _useState32[0],
|
|
112
|
+
setPageReady = _useState32[1];
|
|
113
|
+
var _useState33 = useState(false),
|
|
114
114
|
_useState34 = _slicedToArray(_useState33, 2),
|
|
115
|
-
|
|
116
|
-
|
|
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 (
|
|
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 (
|
|
221
|
+
}).catch(function () {
|
|
233
222
|
notification.error({
|
|
234
223
|
message: '信息获取失败'
|
|
235
224
|
});
|
|
236
225
|
});
|
|
237
|
-
}).catch(function (
|
|
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 (
|
|
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 (
|
|
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 (
|
|
262
|
+
}).then(function () {
|
|
274
263
|
// if (res.flag === 101) {
|
|
275
264
|
// }
|
|
276
|
-
}).catch(function (
|
|
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(
|
|
612
|
+
var changeTab = function changeTab() {
|
|
624
613
|
// setCurrentTab(tab);
|
|
625
614
|
setIsShowCreateApp(false);
|
|
626
615
|
};
|
|
@@ -26,15 +26,14 @@ var Info = function Info(props) {
|
|
|
26
26
|
var updateLicense = function updateLicense(license) {
|
|
27
27
|
request(api.setting.updateLicense, {
|
|
28
28
|
method: 'post',
|
|
29
|
-
|
|
29
|
+
data: {
|
|
30
30
|
license: license
|
|
31
31
|
}
|
|
32
32
|
}).then(function (res) {
|
|
33
|
-
if (res
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
33
|
+
if (!res) return;
|
|
34
|
+
notification.success({
|
|
35
|
+
message: '授权码更新成功!'
|
|
36
|
+
});
|
|
38
37
|
}).catch(function (err) {
|
|
39
38
|
console.log(err);
|
|
40
39
|
notification.error({
|
|
@@ -48,7 +47,7 @@ var Info = function Info(props) {
|
|
|
48
47
|
if (companyNameVal !== companyName) {
|
|
49
48
|
changeCompanyName(companyNameVal);
|
|
50
49
|
}
|
|
51
|
-
if (license.length > 0) {
|
|
50
|
+
if ((license === null || license === void 0 ? void 0 : license.length) > 0) {
|
|
52
51
|
updateLicense(license);
|
|
53
52
|
}
|
|
54
53
|
};
|
|
@@ -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,
|
|
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, {
|
|
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
|
|
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
|
|
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
|
-
|
|
75
|
+
request(api.app.editVirtualApp, {
|
|
76
76
|
method: 'post',
|
|
77
77
|
data: params
|
|
78
|
-
}).then(function (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
|
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
|
-
|
|
107
|
+
request(api.app.createApp, {
|
|
108
108
|
method: 'post',
|
|
109
109
|
data: {
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
appName: e.appNameVal,
|
|
111
|
+
appType: 'virtual',
|
|
112
112
|
companyId: companyId
|
|
113
113
|
}
|
|
114
114
|
}).then(function (res) {
|
|
115
|
-
if (res
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
|
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
|
-
|
|
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) {
|
|
@@ -55,6 +55,8 @@ var PersonalInfo = function PersonalInfo(_ref) {
|
|
|
55
55
|
emailNote: emailNote
|
|
56
56
|
});
|
|
57
57
|
form.resetFields();
|
|
58
|
+
currentUser.username = username;
|
|
59
|
+
currentUser.emailNote = emailNote;
|
|
58
60
|
// 主应用更新currentUser,同公司设置-更新应用名称回调
|
|
59
61
|
settingsCallback('settingChangeCompanyNameCallback');
|
|
60
62
|
} else {
|
|
@@ -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,
|
|
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',
|
package/es/types/app.d.ts
CHANGED
|
@@ -11,9 +11,9 @@ export interface IAppInfoForm {
|
|
|
11
11
|
appAccount: string;
|
|
12
12
|
}
|
|
13
13
|
export interface IAppInfoParams {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
appName: string;
|
|
15
|
+
appId: number;
|
|
16
|
+
appAccount: string;
|
|
17
17
|
wdwdwd: boolean;
|
|
18
18
|
}
|
|
19
19
|
export interface IAppInfoRes<T> extends InterfaceApiResult<T> {
|
package/es/utils/ajax.d.ts
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "1.2.8-node.10",
|
|
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": "
|
|
54
|
+
"gitHead": "9c50dce567d7261891ca8bc3971f5e0fdf251129",
|
|
55
55
|
"gitHooks": {
|
|
56
56
|
"pre-commit": "lint-staged"
|
|
57
57
|
}
|