@zgfe/modules-settings 1.1.1-alpha.1 → 1.1.1-password.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.
@@ -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 && pwdPanelUserConfig.id ? '创建成功' : '密码已生成',
539
+ title: pwdPanelUserConfig ? '创建成功' : '密码已生成',
540
540
  visible: showPasswordPanel,
541
541
  closable: true,
542
542
  onCancel: closePwdPanel,
543
- footer: [pwdPanelUserConfig && pwdPanelUserConfig.id ? /*#__PURE__*/React.createElement(Button, {
543
+ footer: [pwdPanelUserConfig ? /*#__PURE__*/React.createElement(Button, {
544
544
  style: {
545
545
  float: 'left'
546
546
  },
@@ -1,4 +1,10 @@
1
- import React from 'react';
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,15 +12,24 @@ 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;
20
+ var _useState = useState('1'),
21
+ _useState2 = _slicedToArray(_useState, 2),
22
+ currentKey = _useState2[0],
23
+ setCurrentKey = _useState2[1];
13
24
  var title = /*#__PURE__*/React.createElement("div", {
14
25
  className: "tab-header"
15
26
  }, /*#__PURE__*/React.createElement(UserOutlined, null), /*#__PURE__*/React.createElement("span", {
16
27
  className: "tab-header-title"
17
28
  }, "\u4E2A\u4EBA\u8BBE\u7F6E"));
29
+ useEffect(function () {
30
+ var query = util.getHrefData(window.location.href);
31
+ if (query.password) setCurrentKey('2');
32
+ }, []);
18
33
  var items = [{
19
34
  key: '1',
20
35
  label: '个人资料',
@@ -34,7 +49,8 @@ var PersonalSetting = function PersonalSetting(_ref) {
34
49
  return /*#__PURE__*/React.createElement(SettingTabs, {
35
50
  typeName: "personal",
36
51
  title: title,
37
- items: items
52
+ items: items,
53
+ currentKey: currentKey
38
54
  });
39
55
  };
40
56
  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,7 +30,7 @@ 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) === 101) {
33
+ if ((res === null || res === void 0 ? void 0 : res.success) == 101) {
34
34
  location.href = '/app/login';
35
35
  } else {
36
36
  form.setFields([{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgfe/modules-settings",
3
- "version": "1.1.1-alpha.1",
3
+ "version": "1.1.1-password.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": "b2586b262ee0bca3e375ff65e71ff620237c794f",
53
+ "gitHead": "f211823be6d9122829ef31f7b49458e8c4e5cdf1",
54
54
  "gitHooks": {
55
55
  "pre-commit": "lint-staged"
56
56
  }