@zgfe/modules-settings 1.1.1-alpha.0 → 1.1.1
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.
|
@@ -536,11 +536,11 @@ var User = function User(props) {
|
|
|
536
536
|
width: 400
|
|
537
537
|
}
|
|
538
538
|
}, dialogContent)), /*#__PURE__*/React.createElement(BizDialog, {
|
|
539
|
-
title: pwdPanelUserConfig ? '创建成功' : '密码已生成',
|
|
539
|
+
title: pwdPanelUserConfig && pwdPanelUserConfig.id ? '创建成功' : '密码已生成',
|
|
540
540
|
visible: showPasswordPanel,
|
|
541
541
|
closable: true,
|
|
542
542
|
onCancel: closePwdPanel,
|
|
543
|
-
footer: [pwdPanelUserConfig ? /*#__PURE__*/React.createElement(Button, {
|
|
543
|
+
footer: [pwdPanelUserConfig && pwdPanelUserConfig.id ? /*#__PURE__*/React.createElement(Button, {
|
|
544
544
|
style: {
|
|
545
545
|
float: 'left'
|
|
546
546
|
},
|
|
@@ -9,8 +9,7 @@ import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
|
9
9
|
var PersonalSetting = function PersonalSetting(_ref) {
|
|
10
10
|
var settingsCallback = _ref.settingsCallback;
|
|
11
11
|
var _useContext = useContext(BizGlobalDataContext),
|
|
12
|
-
currentUser = _useContext.currentUser
|
|
13
|
-
isDemo = _useContext.isDemo;
|
|
12
|
+
currentUser = _useContext.currentUser;
|
|
14
13
|
var title = /*#__PURE__*/React.createElement("div", {
|
|
15
14
|
className: "tab-header"
|
|
16
15
|
}, /*#__PURE__*/React.createElement(UserOutlined, null), /*#__PURE__*/React.createElement("span", {
|
|
@@ -19,20 +18,17 @@ var PersonalSetting = function PersonalSetting(_ref) {
|
|
|
19
18
|
var items = [{
|
|
20
19
|
key: '1',
|
|
21
20
|
label: '个人资料',
|
|
22
|
-
content: /*#__PURE__*/React.createElement(PersonalInfo,
|
|
23
|
-
settingsCallback: settingsCallback
|
|
24
|
-
})
|
|
21
|
+
content: /*#__PURE__*/React.createElement(PersonalInfo, null)
|
|
25
22
|
}, {
|
|
26
23
|
key: '2',
|
|
27
24
|
label: '修改密码',
|
|
28
|
-
hidden: isDemo,
|
|
29
25
|
content: /*#__PURE__*/React.createElement(PersonalReset, {
|
|
30
26
|
settingsCallback: settingsCallback
|
|
31
27
|
})
|
|
32
28
|
}, {
|
|
33
29
|
key: '3',
|
|
34
30
|
label: '解绑虚拟MFA',
|
|
35
|
-
hidden: !(currentUser === null || currentUser === void 0 ? void 0 : currentUser.secret)
|
|
31
|
+
hidden: !(currentUser === null || currentUser === void 0 ? void 0 : currentUser.secret),
|
|
36
32
|
content: /*#__PURE__*/React.createElement(PersonalUnbinding, null)
|
|
37
33
|
}];
|
|
38
34
|
return /*#__PURE__*/React.createElement(SettingTabs, {
|
|
@@ -11,11 +11,9 @@ import React, { useContext, useState } from 'react';
|
|
|
11
11
|
import apis from '../../../constants/api';
|
|
12
12
|
import { urlRequest } from '../../../utils/ajax';
|
|
13
13
|
import constants from '../../../utils/constants';
|
|
14
|
-
var PersonalInfo = function PersonalInfo(
|
|
15
|
-
var settingsCallback = _ref.settingsCallback;
|
|
14
|
+
var PersonalInfo = function PersonalInfo() {
|
|
16
15
|
var _useContext = useContext(BizGlobalDataContext),
|
|
17
|
-
currentUser = _useContext.currentUser
|
|
18
|
-
isDemo = _useContext.isDemo;
|
|
16
|
+
currentUser = _useContext.currentUser;
|
|
19
17
|
var _useState = useState({
|
|
20
18
|
username: currentUser === null || currentUser === void 0 ? void 0 : currentUser.username,
|
|
21
19
|
emailNote: currentUser === null || currentUser === void 0 ? void 0 : currentUser.emailNote
|
|
@@ -55,8 +53,7 @@ var PersonalInfo = function PersonalInfo(_ref) {
|
|
|
55
53
|
emailNote: emailNote
|
|
56
54
|
});
|
|
57
55
|
form.resetFields();
|
|
58
|
-
// 主应用更新currentUser
|
|
59
|
-
settingsCallback('settingChangeCompanyNameCallback');
|
|
56
|
+
// 主应用更新currentUser
|
|
60
57
|
} else {
|
|
61
58
|
notification.error({
|
|
62
59
|
message: '修改失败'
|
|
@@ -89,8 +86,7 @@ var PersonalInfo = function PersonalInfo(_ref) {
|
|
|
89
86
|
message: '姓名最多为10个字符'
|
|
90
87
|
}]
|
|
91
88
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
92
|
-
placeholder: "\u59D3\u540D"
|
|
93
|
-
disabled: isDemo
|
|
89
|
+
placeholder: "\u59D3\u540D"
|
|
94
90
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
95
91
|
label: "\u90AE\u7BB1",
|
|
96
92
|
name: "emailNote",
|
|
@@ -102,8 +98,7 @@ var PersonalInfo = function PersonalInfo(_ref) {
|
|
|
102
98
|
message: '邮箱格式错误'
|
|
103
99
|
}]
|
|
104
100
|
}, /*#__PURE__*/React.createElement(Input, {
|
|
105
|
-
placeholder: "\u8BF7\u8F93\u5165\u90AE\u7BB1"
|
|
106
|
-
disabled: isDemo
|
|
101
|
+
placeholder: "\u8BF7\u8F93\u5165\u90AE\u7BB1"
|
|
107
102
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
108
103
|
shouldUpdate: true
|
|
109
104
|
}, function () {
|
|
@@ -111,8 +106,8 @@ var PersonalInfo = function PersonalInfo(_ref) {
|
|
|
111
106
|
type: "primary",
|
|
112
107
|
htmlType: "submit",
|
|
113
108
|
loading: loading,
|
|
114
|
-
disabled:
|
|
115
|
-
var errors =
|
|
109
|
+
disabled: !(form.isFieldTouched('username') || form.isFieldTouched('emailNote')) || !!form.getFieldsError().filter(function (_ref) {
|
|
110
|
+
var errors = _ref.errors;
|
|
116
111
|
return errors.length;
|
|
117
112
|
}).length || JSON.stringify(initialValues) === JSON.stringify(form.getFieldsValue())
|
|
118
113
|
}, "\u4FDD\u5B58");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-settings",
|
|
3
|
-
"version": "1.1.1
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"module": "es/index.js",
|
|
5
5
|
"typings": "es/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"umi-request": "^1.4.0",
|
|
51
51
|
"yorkie": "^2.0.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "46b6d784fa0b2a7e6789f520cc8ce1763e568218",
|
|
54
54
|
"gitHooks": {
|
|
55
55
|
"pre-commit": "lint-staged"
|
|
56
56
|
}
|