@zgfe/modules-settings 1.1.2-alpha.2 → 1.1.3-alpha.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.
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
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
|
+
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
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { useEffect, useState } from 'react';
|
|
2
8
|
import PersonalInfo from './info';
|
|
3
9
|
import PersonalReset from './reset';
|
|
4
10
|
import { UserOutlined } from '@ant-design/icons';
|
|
@@ -6,16 +12,25 @@ import SettingTabs from '../../components/settingTabs';
|
|
|
6
12
|
import PersonalUnbinding from './unbinding';
|
|
7
13
|
import { useContext } from 'react';
|
|
8
14
|
import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
15
|
+
import util from '../../utils/util';
|
|
9
16
|
var PersonalSetting = function PersonalSetting(_ref) {
|
|
10
17
|
var settingsCallback = _ref.settingsCallback;
|
|
11
18
|
var _useContext = useContext(BizGlobalDataContext),
|
|
12
19
|
currentUser = _useContext.currentUser,
|
|
13
20
|
isDemo = _useContext.isDemo;
|
|
21
|
+
var _useState = useState('1'),
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
currentKey = _useState2[0],
|
|
24
|
+
setCurrentKey = _useState2[1];
|
|
14
25
|
var title = /*#__PURE__*/React.createElement("div", {
|
|
15
26
|
className: "tab-header"
|
|
16
27
|
}, /*#__PURE__*/React.createElement(UserOutlined, null), /*#__PURE__*/React.createElement("span", {
|
|
17
28
|
className: "tab-header-title"
|
|
18
29
|
}, "\u4E2A\u4EBA\u8BBE\u7F6E"));
|
|
30
|
+
useEffect(function () {
|
|
31
|
+
var query = util.getHrefData(window.location.href);
|
|
32
|
+
if (query.password) setCurrentKey('2');
|
|
33
|
+
}, []);
|
|
19
34
|
var items = [{
|
|
20
35
|
key: '1',
|
|
21
36
|
label: '个人资料',
|
|
@@ -38,7 +53,8 @@ var PersonalSetting = function PersonalSetting(_ref) {
|
|
|
38
53
|
return /*#__PURE__*/React.createElement(SettingTabs, {
|
|
39
54
|
typeName: "personal",
|
|
40
55
|
title: title,
|
|
41
|
-
items: items
|
|
56
|
+
items: items,
|
|
57
|
+
currentKey: currentKey
|
|
42
58
|
});
|
|
43
59
|
};
|
|
44
60
|
export default PersonalSetting;
|
|
@@ -7,11 +7,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
7
7
|
import { BizGlobalDataContext } from '@zgfe/business-lib';
|
|
8
8
|
import { Button, Form, notification } from 'antd';
|
|
9
9
|
import Input from 'antd/lib/input/Input';
|
|
10
|
-
import React, { useContext } from 'react';
|
|
10
|
+
import React, { useContext, useEffect } from 'react';
|
|
11
11
|
import { useState } from 'react';
|
|
12
12
|
import apis from '../../../constants/api';
|
|
13
13
|
import { urlRequest } from '../../../utils/ajax';
|
|
14
14
|
import base64 from '../../../utils/base64';
|
|
15
|
+
import util from '../../../utils/util';
|
|
15
16
|
var PersonalReset = function PersonalReset(_ref) {
|
|
16
17
|
var settingsCallback = _ref.settingsCallback;
|
|
17
18
|
var _useContext = useContext(BizGlobalDataContext),
|
|
@@ -27,6 +28,16 @@ var PersonalReset = function PersonalReset(_ref) {
|
|
|
27
28
|
_useState2 = _slicedToArray(_useState, 2),
|
|
28
29
|
loading = _useState2[0],
|
|
29
30
|
setLoading = _useState2[1];
|
|
31
|
+
useEffect(function () {
|
|
32
|
+
var query = util.getHrefData(window.location.href);
|
|
33
|
+
// 密码过期提示
|
|
34
|
+
if (query.password) {
|
|
35
|
+
var passwordReset = JSON.parse(decodeURIComponent(query.password));
|
|
36
|
+
notification.error({
|
|
37
|
+
message: "\u60A8\u7684\u5BC6\u7801\u5DF2\u7ECF".concat(passwordReset.period, "\u5929\u672A\u4FEE\u6539\uFF0C\u8BF7\u4FEE\u6539\u60A8\u7684\u5BC6\u7801\u4EE5\u786E\u4FDD\u8D26\u6237\u5B89\u5168")
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}, []);
|
|
30
41
|
var onSubmit = function onSubmit(value) {
|
|
31
42
|
setLoading(true);
|
|
32
43
|
var pwd = value.pwd,
|
|
@@ -30,8 +30,8 @@ var PersonalUnbinding = function PersonalUnbinding() {
|
|
|
30
30
|
}
|
|
31
31
|
}).then(function (res) {
|
|
32
32
|
setLoading(false);
|
|
33
|
-
if ((res === null || res === void 0 ? void 0 : res.success)
|
|
34
|
-
location.href = '/app/login';
|
|
33
|
+
if ((res === null || res === void 0 ? void 0 : res.success) == 101) {
|
|
34
|
+
location.href = '/webapp/app/login';
|
|
35
35
|
} else {
|
|
36
36
|
form.setFields([{
|
|
37
37
|
name: 'code',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zgfe/modules-settings",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3-alpha.0",
|
|
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": "2784b2098f13fbe2427c20fc19ba539b287ec2de",
|
|
54
54
|
"gitHooks": {
|
|
55
55
|
"pre-commit": "lint-staged"
|
|
56
56
|
}
|