|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[64520],{
|
|
|
|
|
|
/***/ 73331:
|
|
|
/*!**************************************************************************************************************!*\
|
|
|
!*** ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/EyeInvisibleOutlined.js + 1 modules ***!
|
|
|
\**************************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ icons_EyeInvisibleOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.28.6@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(60499);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/EyeInvisibleOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var EyeInvisibleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" } }, { "tag": "path", "attrs": { "d": "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" } }] }, "name": "eye-invisible", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_EyeInvisibleOutlined = (EyeInvisibleOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(7657);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/EyeInvisibleOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var EyeInvisibleOutlined_EyeInvisibleOutlined = function EyeInvisibleOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_EyeInvisibleOutlined
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/** */
|
|
|
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(EyeInvisibleOutlined_EyeInvisibleOutlined);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_EyeInvisibleOutlined = (RefIcon);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 15277:
|
|
|
/*!*****************************************************************************************************!*\
|
|
|
!*** ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/EyeOutlined.js + 1 modules ***!
|
|
|
\*****************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ icons_EyeOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.28.6@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(60499);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.4.2@@ant-design/icons-svg/es/asn/EyeOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var EyeOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" } }] }, "name": "eye", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_EyeOutlined = (EyeOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(7657);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/EyeOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var EyeOutlined_EyeOutlined = function EyeOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_EyeOutlined
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/** */
|
|
|
var RefIcon = /*#__PURE__*/_react_17_0_2_react.forwardRef(EyeOutlined_EyeOutlined);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_EyeOutlined = (RefIcon);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 32333:
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./src/pages/Account/Secure/index.tsx + 1 modules ***!
|
|
|
\********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
// ESM COMPAT FLAG
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
"default": function() { return /* binding */ Account_Secure; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectDestructuringEmpty.js
|
|
|
var objectDestructuringEmpty = __webpack_require__(70236);
|
|
|
var objectDestructuringEmpty_default = /*#__PURE__*/__webpack_require__.n(objectDestructuringEmpty);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(7557);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(79800);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectWithoutProperties.js
|
|
|
var objectWithoutProperties = __webpack_require__(39647);
|
|
|
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
|
var _umi_production_exports = __webpack_require__(25789);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/index.js + 19 modules
|
|
|
var es_form = __webpack_require__(78241);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/message/index.js + 4 modules
|
|
|
var message = __webpack_require__(8591);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js + 3 modules
|
|
|
var input = __webpack_require__(92832);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(6848);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
|
var modal = __webpack_require__(43418);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Account/Secure/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var Securemodules = ({"wrap":"wrap___vEhcs","content":"content___ebZIP","hint":"hint___b1gVO","titleWrap":"titleWrap___iGFyX","title":"title___O7ajd","formWrap":"formWrap___hsI9d","row":"row___xYJES","rowBorder":"rowBorder___YP4Tf","name":"name___kvtHq","status":"status___Z3SQA","description":"description___iGcNP","active":"active___DoK2i","color999":"color999___MWFZD","colorCDCDCD":"colorCDCDCD___miC4g","colorRed":"colorRed___YHbHP","submitButton":"submitButton___iLv6C","buttonWrap":"buttonWrap___gaJuB"});
|
|
|
// EXTERNAL MODULE: ./src/utils/hooks/useInterval.tsx
|
|
|
var useInterval = __webpack_require__(78079);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(20681);
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
var fetch = __webpack_require__(55794);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Account/Secure/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["user", "account", "globalSetting", "loading", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ActiveType = /*#__PURE__*/function (ActiveType) {
|
|
|
ActiveType[ActiveType["Phone"] = 1] = "Phone";
|
|
|
ActiveType[ActiveType["Email"] = 2] = "Email";
|
|
|
ActiveType[ActiveType["Password"] = 3] = "Password";
|
|
|
return ActiveType;
|
|
|
}(ActiveType || {});
|
|
|
var phoneReg = /^1\d{10}$/;
|
|
|
var emailReg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
|
|
|
var Secure_password = /^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{8,16}$/;
|
|
|
var inputNewPassword = function inputNewPassword(rule, value, callback) {
|
|
|
if (!value) {
|
|
|
callback("请输入8-16位字符的新密码,区分大小写!");
|
|
|
} else if (value.indexOf(" ") > -1) {
|
|
|
callback('请输入8-16位密码,区分大小写、不能使用空格');
|
|
|
} else if (value.length < 8 || value.length > 16) {
|
|
|
callback("请输入8-16位字符的新密码,区分大小写!");
|
|
|
} else if (!Secure_password.test(value)) {
|
|
|
callback("请输入8~16位字符,字母、数字和特殊符号至少包含2种");
|
|
|
} else {
|
|
|
callback();
|
|
|
}
|
|
|
};
|
|
|
var DataType = /*#__PURE__*/function (DataType) {
|
|
|
DataType["Wechat"] = "wechat";
|
|
|
DataType["QQ"] = "qq";
|
|
|
return DataType;
|
|
|
}(DataType || {});
|
|
|
var Secure = function Secure(_ref) {
|
|
|
var _account$basicInfo4, _account$basicInfo5, _account$basicInfo6, _account$basicInfo7, _account$basicInfo9, _account$basicInfo10, _account$basicInfo11, _globalSetting$settin, _account$basicInfo12, _account$basicInfo13, _globalSetting$settin2, _account$basicInfo14, _account$basicInfo15, _account$basicInfo16, _globalSetting$settin3, _account$basicInfo17, _account$basicInfo18;
|
|
|
var user = _ref.user,
|
|
|
account = _ref.account,
|
|
|
globalSetting = _ref.globalSetting,
|
|
|
loading = _ref.loading,
|
|
|
dispatch = _ref.dispatch,
|
|
|
props = objectWithoutProperties_default()(_ref, _excluded);
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
active = _useState2[0],
|
|
|
setActive = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(60),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
countdown = _useState4[0],
|
|
|
setCountdown = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
countdownFlag = _useState6[0],
|
|
|
setCountdownFlag = _useState6[1];
|
|
|
var intervalId = (0,_react_17_0_2_react.useRef)();
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)({}),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
wechatData = _useState8[0],
|
|
|
setWechatData = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)({}),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
qqData = _useState10[0],
|
|
|
setqqData = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
isShowModal = _useState12[0],
|
|
|
setIsShowModal = _useState12[1];
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
isShowPhone = _useState14[0],
|
|
|
setIsShowPhone = _useState14[1];
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
isShowPoint = _useState16[0],
|
|
|
setIsShowPoint = _useState16[1];
|
|
|
var _useState17 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
|
isShowUntie = _useState18[0],
|
|
|
setIsShowUntie = _useState18[1];
|
|
|
var _useState19 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
|
PhoneValue = _useState20[0],
|
|
|
setPhoneValue = _useState20[1];
|
|
|
var _useState21 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
|
UntieValue = _useState22[0],
|
|
|
setUntieValue = _useState22[1];
|
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
|
searchParams = _useSearchParams2[0];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var _account$basicInfo, _account$basicInfo2;
|
|
|
var wechat = ((_account$basicInfo = account.basicInfo) === null || _account$basicInfo === void 0 ? void 0 : _account$basicInfo.open_users.find(function (item) {
|
|
|
return item.en_type === DataType.Wechat;
|
|
|
})) || {};
|
|
|
setWechatData(wechat);
|
|
|
var qq = ((_account$basicInfo2 = account.basicInfo) === null || _account$basicInfo2 === void 0 ? void 0 : _account$basicInfo2.open_users.find(function (item) {
|
|
|
return item.en_type === DataType.QQ;
|
|
|
})) || {};
|
|
|
setqqData(qq);
|
|
|
}, [account.basicInfo]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
return function () {
|
|
|
intervalId.current && clearInterval(intervalId.current);
|
|
|
};
|
|
|
}, []);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
setActive(parseInt(searchParams.get("active")));
|
|
|
}, [location]);
|
|
|
(0,useInterval/* useInterval */.Y)(function () {
|
|
|
if (!countdownFlag) {
|
|
|
return;
|
|
|
} else {
|
|
|
setCountdown(60);
|
|
|
}
|
|
|
if (countdown > 0) {
|
|
|
setCountdown(countdown - 1);
|
|
|
} else {
|
|
|
setCountdown(60);
|
|
|
setCountdownFlag(false);
|
|
|
intervalId.current && clearInterval(intervalId.current);
|
|
|
}
|
|
|
}, 1000);
|
|
|
var handleGetCode = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(isPhone) {
|
|
|
var login, type, _user$userInfo, data, smscode, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if (!isPhone) {
|
|
|
_context.next = 16;
|
|
|
break;
|
|
|
}
|
|
|
type = 3;
|
|
|
login = form.getFieldValue('phone');
|
|
|
if (phoneReg.test(login)) {
|
|
|
_context.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('请先输入正确的手机号码');
|
|
|
return _context.abrupt("return");
|
|
|
case 6:
|
|
|
_context.next = 8;
|
|
|
return (0,fetch/* default */.ZP)("/api/users/accounts/".concat((_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.login, "/valid_phone.json"), {
|
|
|
method: 'get',
|
|
|
params: {
|
|
|
phone: login
|
|
|
}
|
|
|
});
|
|
|
case 8:
|
|
|
data = _context.sent;
|
|
|
if (!((data === null || data === void 0 ? void 0 : data.status) === -1)) {
|
|
|
_context.next = 11;
|
|
|
break;
|
|
|
}
|
|
|
return _context.abrupt("return");
|
|
|
case 11:
|
|
|
if (!(data !== null && data !== void 0 && data.is_exists)) {
|
|
|
_context.next = 14;
|
|
|
break;
|
|
|
}
|
|
|
setIsShowPoint(true);
|
|
|
return _context.abrupt("return");
|
|
|
case 14:
|
|
|
_context.next = 21;
|
|
|
break;
|
|
|
case 16:
|
|
|
type = 4;
|
|
|
login = form.getFieldValue('email');
|
|
|
if (emailReg.test(login)) {
|
|
|
_context.next = 21;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('请先输入正确的邮箱地址');
|
|
|
return _context.abrupt("return");
|
|
|
case 21:
|
|
|
smscode = (0,util/* setmiyah */.M)(login);
|
|
|
_context.next = 24;
|
|
|
return dispatch({
|
|
|
type: 'account/getCode',
|
|
|
payload: {
|
|
|
login: login,
|
|
|
type: type,
|
|
|
smscode: smscode
|
|
|
}
|
|
|
});
|
|
|
case 24:
|
|
|
res = _context.sent;
|
|
|
if (res.status === 1) {
|
|
|
message/* default */.ZP.info('验证码已发送,请注意查收');
|
|
|
setCountdownFlag(true);
|
|
|
}
|
|
|
case 26:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function handleGetCode(_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handlePhoneFinish = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(values) {
|
|
|
var _ref4, phone, code, _ref5, login, res, _user$userInfo2;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
_ref4 = values || {}, phone = _ref4.phone, code = _ref4.phoneValidateCode;
|
|
|
_ref5 = user.userInfo || {}, login = _ref5.login;
|
|
|
if (phoneReg.test(phone)) {
|
|
|
_context2.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info("请输入有效的11位手机号码");
|
|
|
return _context2.abrupt("return");
|
|
|
case 5:
|
|
|
_context2.next = 7;
|
|
|
return dispatch({
|
|
|
type: 'account/bindPhone',
|
|
|
payload: {
|
|
|
login: login,
|
|
|
phone: phone,
|
|
|
code: code
|
|
|
}
|
|
|
});
|
|
|
case 7:
|
|
|
res = _context2.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
message/* default */.ZP.info("手机号码绑定成功!");
|
|
|
setActive(null);
|
|
|
setCountdownFlag(false);
|
|
|
dispatch({
|
|
|
type: 'account/getBasicInfo',
|
|
|
payload: {
|
|
|
login: (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.login
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 9:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function handlePhoneFinish(_x2) {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleEmailFinish = /*#__PURE__*/function () {
|
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(values) {
|
|
|
var _ref7, email, code, _ref8, login, res, _user$userInfo3;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_ref7 = values || {}, email = _ref7.email, code = _ref7.emailValidateCode;
|
|
|
_ref8 = user.userInfo || {}, login = _ref8.login;
|
|
|
if (emailReg.test(email)) {
|
|
|
_context3.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info("请输入正确的邮箱地址");
|
|
|
return _context3.abrupt("return");
|
|
|
case 5:
|
|
|
_context3.next = 7;
|
|
|
return dispatch({
|
|
|
type: 'account/bindEmail',
|
|
|
payload: {
|
|
|
login: login,
|
|
|
email: email,
|
|
|
code: code
|
|
|
}
|
|
|
});
|
|
|
case 7:
|
|
|
res = _context3.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
message/* default */.ZP.info("邮箱地址绑定成功!");
|
|
|
setActive(null);
|
|
|
setCountdownFlag(false);
|
|
|
dispatch({
|
|
|
type: 'account/getBasicInfo',
|
|
|
payload: {
|
|
|
login: (_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.login
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 9:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return function handleEmailFinish(_x3) {
|
|
|
return _ref6.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handlePasswordFinish = /*#__PURE__*/function () {
|
|
|
var _ref9 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(values) {
|
|
|
var _account$basicInfo3;
|
|
|
var _ref10, oldPassword, newPassword, againPassword, _ref11, login, res, _user$userInfo4;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
_ref10 = values || {}, oldPassword = _ref10.oldPassword, newPassword = _ref10.newPassword, againPassword = _ref10.againPassword;
|
|
|
_ref11 = user.userInfo || {}, login = _ref11.login;
|
|
|
if (!((_account$basicInfo3 = account.basicInfo) !== null && _account$basicInfo3 !== void 0 && _account$basicInfo3.has_password && oldPassword === newPassword)) {
|
|
|
_context4.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info("新密码不能与旧密码相同!");
|
|
|
return _context4.abrupt("return");
|
|
|
case 5:
|
|
|
if (!(newPassword !== againPassword)) {
|
|
|
_context4.next = 8;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info("两次输入的新密码必须一致!");
|
|
|
return _context4.abrupt("return");
|
|
|
case 8:
|
|
|
_context4.next = 10;
|
|
|
return dispatch({
|
|
|
type: 'account/updatePassword',
|
|
|
payload: {
|
|
|
login: login,
|
|
|
old_password: oldPassword,
|
|
|
password: newPassword
|
|
|
}
|
|
|
});
|
|
|
case 10:
|
|
|
res = _context4.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
message/* default */.ZP.info('密码更新成功!');
|
|
|
setActive(null);
|
|
|
dispatch({
|
|
|
type: 'account/getBasicInfo',
|
|
|
payload: {
|
|
|
login: (_user$userInfo4 = user.userInfo) === null || _user$userInfo4 === void 0 ? void 0 : _user$userInfo4.login
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 12:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
return function handlePasswordFinish(_x4) {
|
|
|
return _ref9.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleFinish = function handleFinish(values) {
|
|
|
objectDestructuringEmpty_default()(values || {});
|
|
|
console.log("handleFinish values: ", values);
|
|
|
if (active === ActiveType.Phone) {
|
|
|
handlePhoneFinish(values);
|
|
|
}
|
|
|
if (active === ActiveType.Email) {
|
|
|
handleEmailFinish(values);
|
|
|
}
|
|
|
if (active === ActiveType.Password) {
|
|
|
handlePasswordFinish(values);
|
|
|
}
|
|
|
};
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (!active) {
|
|
|
form.setFieldsValue({
|
|
|
phone: '',
|
|
|
phoneValidateCode: '',
|
|
|
email: '',
|
|
|
emailValidateCode: '',
|
|
|
oldPassword: '',
|
|
|
newPassword: '',
|
|
|
againPassword: ''
|
|
|
});
|
|
|
}
|
|
|
}, [active]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: Securemodules.wrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Securemodules.content,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(Securemodules.titleWrap, " mt10"),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Securemodules.title,
|
|
|
children: "\u5B89\u5168\u8BBE\u7F6E"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
className: Securemodules.formWrap,
|
|
|
labelCol: {
|
|
|
span: 6
|
|
|
},
|
|
|
wrapperCol: {
|
|
|
span: 10
|
|
|
},
|
|
|
onFinish: handleFinish,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(Securemodules.row, " ").concat(active === ActiveType.Phone ? '' : Securemodules.rowBorder),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Securemodules.name, " ").concat(Securemodules.color999),
|
|
|
children: "\u624B\u673A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(Securemodules.description, " ").concat(Securemodules.colorCDCDCD),
|
|
|
children: [(_account$basicInfo4 = account.basicInfo) !== null && _account$basicInfo4 !== void 0 && _account$basicInfo4.phone ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Securemodules.status, " mr20"),
|
|
|
children: (_account$basicInfo5 = account.basicInfo) === null || _account$basicInfo5 === void 0 ? void 0 : _account$basicInfo5.phone
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Securemodules.status, " ").concat(Securemodules.colorRed, " mr20"),
|
|
|
children: "\u672A\u7ED1\u5B9A"
|
|
|
}), (_account$basicInfo6 = account.basicInfo) !== null && _account$basicInfo6 !== void 0 && _account$basicInfo6.phone ? '仅自己可见,可用手机号码登录EduCoder' : '绑定手机号码,将获得500金币的奖励哟~,手机号码仅自己可见~']
|
|
|
}), ((_account$basicInfo7 = account.basicInfo) === null || _account$basicInfo7 === void 0 ? void 0 : _account$basicInfo7.phone) && active !== ActiveType.Phone && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Securemodules.active,
|
|
|
style: {
|
|
|
marginRight: '30px',
|
|
|
cursor: 'pointer'
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
var _account$basicInfo8;
|
|
|
// console.log(wechatData?.id,qqData?.id,account.basicInfo?.mail);
|
|
|
|
|
|
//判断是不是只绑定了手机号
|
|
|
if (!(wechatData !== null && wechatData !== void 0 && wechatData.id) && !(qqData !== null && qqData !== void 0 && qqData.id) && !((_account$basicInfo8 = account.basicInfo) !== null && _account$basicInfo8 !== void 0 && _account$basicInfo8.mail)) {
|
|
|
// console.log('------','啥也没绑定');
|
|
|
setIsShowModal(true);
|
|
|
} else {
|
|
|
setIsShowPhone(true);
|
|
|
}
|
|
|
},
|
|
|
children: '解绑手机号'
|
|
|
}), active !== ActiveType.Phone && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Securemodules.active,
|
|
|
onClick: function onClick() {
|
|
|
return setActive(ActiveType.Phone);
|
|
|
},
|
|
|
children: (_account$basicInfo9 = account.basicInfo) !== null && _account$basicInfo9 !== void 0 && _account$basicInfo9.phone ? '更换' : '立即绑定'
|
|
|
})]
|
|
|
}), active === ActiveType.Phone && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u4F60\u7684\u624B\u673A\u53F7",
|
|
|
name: "phone",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "\u8BF7\u8F93\u5165\u8981".concat((_account$basicInfo10 = account.basicInfo) !== null && _account$basicInfo10 !== void 0 && _account$basicInfo10.phone ? '更换' : '绑定', "\u7684\u624B\u673A\u53F7\u7801")
|
|
|
}, {
|
|
|
validator: function validator(rule, value, callback) {
|
|
|
if (phoneReg.test(value)) {
|
|
|
callback();
|
|
|
}
|
|
|
callback('请输入有效的11位手机号码');
|
|
|
}
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u8981".concat((_account$basicInfo11 = account.basicInfo) !== null && _account$basicInfo11 !== void 0 && _account$basicInfo11.phone ? '更换' : '绑定', "\u7684\u624B\u673A\u53F7\u7801")
|
|
|
})
|
|
|
}), !(globalSetting !== null && globalSetting !== void 0 && (_globalSetting$settin = globalSetting.setting) !== null && _globalSetting$settin !== void 0 && _globalSetting$settin.is_local) && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, {
|
|
|
label: "\u624B\u673A\u9A8C\u8BC1\u7801",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "phoneValidateCode",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入手机获取的验证码'
|
|
|
}],
|
|
|
noStyle: true,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u624B\u673A\u83B7\u53D6\u7684\u9A8C\u8BC1\u7801"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
className: "ml5",
|
|
|
disabled: countdownFlag,
|
|
|
onClick: function onClick() {
|
|
|
return handleGetCode(true);
|
|
|
},
|
|
|
children: countdownFlag ? "\u91CD\u65B0\u53D1\u9001".concat(countdown, "s") : '获取验证码'
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
noStyle: true,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Securemodules.buttonWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: "".concat(Securemodules.submitButton),
|
|
|
size: 'middle',
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
children: "\u786E\u5B9A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: Securemodules.submitButton,
|
|
|
size: 'middle',
|
|
|
onClick: function onClick() {
|
|
|
return setActive(null);
|
|
|
},
|
|
|
children: "\u53D6\u6D88"
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(Securemodules.row, " ").concat(active === ActiveType.Email ? '' : Securemodules.rowBorder),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Securemodules.name, " ").concat(Securemodules.color999),
|
|
|
children: "\u90AE\u7BB1"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(Securemodules.description, " ").concat(Securemodules.colorCDCDCD),
|
|
|
children: [(_account$basicInfo12 = account.basicInfo) !== null && _account$basicInfo12 !== void 0 && _account$basicInfo12.mail ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Securemodules.status, " mr20"),
|
|
|
children: (_account$basicInfo13 = account.basicInfo) === null || _account$basicInfo13 === void 0 ? void 0 : _account$basicInfo13.mail
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Securemodules.status, " ").concat(Securemodules.colorRed, " mr20"),
|
|
|
children: "\u672A\u7ED1\u5B9A"
|
|
|
}), "\u90AE\u7BB1\u8D26\u53F7\u4EC5\u81EA\u5DF1\u53EF\u89C1\uFF0C\u53EF\u7528\u4E8E\u90AE\u7BB1\u8D26\u53F7\u767B\u5F55", !(globalSetting !== null && globalSetting !== void 0 && (_globalSetting$settin2 = globalSetting.setting) !== null && _globalSetting$settin2 !== void 0 && _globalSetting$settin2.is_local) && 'EduCoder']
|
|
|
}), active !== ActiveType.Email && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Securemodules.active,
|
|
|
onClick: function onClick() {
|
|
|
return setActive(ActiveType.Email);
|
|
|
},
|
|
|
children: (_account$basicInfo14 = account.basicInfo) !== null && _account$basicInfo14 !== void 0 && _account$basicInfo14.mail ? '更换' : '立即绑定'
|
|
|
})]
|
|
|
}), active === ActiveType.Email && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u90AE\u7BB1\u5730\u5740",
|
|
|
name: "email",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: (_account$basicInfo15 = account.basicInfo) !== null && _account$basicInfo15 !== void 0 && _account$basicInfo15.mail ? '请输入要更换的新邮箱地址' : '请输入邮箱地址'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: (_account$basicInfo16 = account.basicInfo) !== null && _account$basicInfo16 !== void 0 && _account$basicInfo16.mail ? '请输入要更换的新邮箱地址' : '请输入邮箱地址'
|
|
|
})
|
|
|
}), !(globalSetting !== null && globalSetting !== void 0 && (_globalSetting$settin3 = globalSetting.setting) !== null && _globalSetting$settin3 !== void 0 && _globalSetting$settin3.is_local) && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, {
|
|
|
label: "\u90AE\u7BB1\u9A8C\u8BC1\u7801",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "emailValidateCode",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入邮箱收到的验证码'
|
|
|
}],
|
|
|
noStyle: true,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u90AE\u7BB1\u6536\u5230\u7684\u9A8C\u8BC1\u7801"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
className: "ml5",
|
|
|
disabled: countdownFlag,
|
|
|
onClick: function onClick() {
|
|
|
return handleGetCode(false);
|
|
|
},
|
|
|
children: countdownFlag ? "\u91CD\u65B0\u53D1\u9001".concat(countdown, "s") : '获取验证码'
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
noStyle: true,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Securemodules.buttonWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: "".concat(Securemodules.submitButton),
|
|
|
size: 'middle',
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
children: "\u786E\u5B9A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: Securemodules.submitButton,
|
|
|
size: 'middle',
|
|
|
onClick: function onClick() {
|
|
|
return setActive(null);
|
|
|
},
|
|
|
children: "\u53D6\u6D88"
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Securemodules.row,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Securemodules.name, " ").concat(Securemodules.color999),
|
|
|
children: "\u5BC6\u7801"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(Securemodules.description, " ").concat(Securemodules.colorCDCDCD),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Securemodules.status, " mr20"),
|
|
|
children: "**********"
|
|
|
}), "\u7528\u4E8E\u4FDD\u62A4\u8D26\u6237\u4FE1\u606F\u548C\u767B\u5F55\u5B89\u5168"]
|
|
|
}), active !== ActiveType.Password && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Securemodules.active,
|
|
|
onClick: function onClick() {
|
|
|
return setActive(ActiveType.Password);
|
|
|
},
|
|
|
children: "\u4FEE\u6539"
|
|
|
})]
|
|
|
}), active === ActiveType.Password && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [((_account$basicInfo17 = account.basicInfo) === null || _account$basicInfo17 === void 0 ? void 0 : _account$basicInfo17.has_password) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u65E7\u5BC6\u7801",
|
|
|
name: "oldPassword",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请设置8~16位密码,区分大小写'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
type: "password",
|
|
|
placeholder: "\u8BF7\u8BBE\u7F6E8\uFF5E16\u4F4D\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u957F\u5EA6\u4E3A8-16\u4F4D\u5B57\u7B26"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u5B57\u6BCD/\u6570\u5B57\u4EE5\u53CA\u6807\u70B9\u7B26\u53F7\u81F3\u5C11\u5305\u542B2\u79CD"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u4E0D\u5141\u8BB8\u6709\u7A7A\u683C\u3001\u4E2D\u6587"
|
|
|
})]
|
|
|
}),
|
|
|
placement: "top",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u65B0\u5BC6\u7801",
|
|
|
name: "newPassword",
|
|
|
rules: [{}, {
|
|
|
validator: inputNewPassword
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
type: "password",
|
|
|
placeholder: "\u8BF7\u8F93\u51658\uFF5E16\u4F4D\u7684\u65B0\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199"
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u957F\u5EA6\u4E3A8-16\u4F4D\u5B57\u7B26"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u5B57\u6BCD/\u6570\u5B57\u4EE5\u53CA\u6807\u70B9\u7B26\u53F7\u81F3\u5C11\u5305\u542B2\u79CD"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u4E0D\u5141\u8BB8\u6709\u7A7A\u683C\u3001\u4E2D\u6587"
|
|
|
})]
|
|
|
}),
|
|
|
placement: "top",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u518D\u6B21\u8F93\u5165",
|
|
|
name: "againPassword",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请再次输入新密码'
|
|
|
}, {
|
|
|
validator: function validator(rule, value, callback) {
|
|
|
if (value != form.getFieldsValue().newPassword) {
|
|
|
callback("两次输入的新密码必须一致!");
|
|
|
} else {
|
|
|
callback();
|
|
|
}
|
|
|
}
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
type: "password",
|
|
|
placeholder: "\u8BF7\u518D\u6B21\u8F93\u5165\u65B0\u5BC6\u7801"
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
noStyle: true,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Securemodules.buttonWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: "".concat(Securemodules.submitButton),
|
|
|
size: 'middle',
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
children: "\u786E\u5B9A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: Securemodules.submitButton,
|
|
|
size: 'middle',
|
|
|
onClick: function onClick() {
|
|
|
return setActive(null);
|
|
|
},
|
|
|
children: "\u53D6\u6D88"
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(Securemodules.hint, " font14"),
|
|
|
children: "* \u6211\u4EEC\u786E\u4FDD\u4F60\u6240\u63D0\u4F9B\u7684\u4FE1\u606F\u5747\u5904\u4E8E\u4E25\u683C\u4FDD\u5BC6\u72B6\u6001\uFF0C\u4E0D\u4F1A\u6CC4\u9732"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
title: "\u63D0\u793A",
|
|
|
open: isShowModal,
|
|
|
onCancel: function onCancel() {
|
|
|
setIsShowModal(false);
|
|
|
},
|
|
|
footer: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
style: {
|
|
|
textAlign: 'end'
|
|
|
},
|
|
|
type: "primary",
|
|
|
onClick: function onClick() {
|
|
|
return setIsShowModal(false);
|
|
|
},
|
|
|
children: "\u786E \u5B9A"
|
|
|
})
|
|
|
}),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
padding: '7px 24px'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u60A8\u76EE\u524D\u53EA\u6709\u624B\u673A\u53F7\u767B\u5F55\u4E00\u79CD\u65B9\u5F0F\uFF0C\u89E3\u7ED1\u540E\u5C06\u65E0\u6CD5\u6B63\u5E38\u4F7F\u7528\u5E73\u53F0\uFF0C\u9700\u8981\u60A8\u5148\u7ED1\u5B9A\u4EE5\u4E0B\u7684\u4EFB\u610F\u4E00\u79CD\u767B\u5F55\u65B9\u5F0F\uFF0C\u518D\u8FDB\u884C\u89E3\u7ED1\u3002"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
style: {
|
|
|
marginTop: '1em',
|
|
|
display: 'flex'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
flex: '1'
|
|
|
},
|
|
|
children: "1\u3001\u7ED1\u5B9A\u90AE\u7BB1 "
|
|
|
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
style: {
|
|
|
height: 24,
|
|
|
padding: '0px 11px',
|
|
|
borderRadius: 12
|
|
|
},
|
|
|
type: "primary",
|
|
|
ghost: true,
|
|
|
onClick: function onClick() {
|
|
|
return setIsShowModal(false);
|
|
|
},
|
|
|
children: "\u524D\u5F80\u7ED1\u5B9A"
|
|
|
})]
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
title: "\u624B\u673A\u53F7\u89E3\u7ED1",
|
|
|
open: isShowPhone,
|
|
|
onCancel: function onCancel() {
|
|
|
return setIsShowPhone(false);
|
|
|
},
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
|
var _user$userInfo5;
|
|
|
var data, _user$userInfo6;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
if (PhoneValue) {
|
|
|
_context5.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('验证码不能为空');
|
|
|
return _context5.abrupt("return");
|
|
|
case 3:
|
|
|
_context5.next = 5;
|
|
|
return (0,fetch/* default */.ZP)("/api/users/accounts/".concat(user === null || user === void 0 || (_user$userInfo5 = user.userInfo) === null || _user$userInfo5 === void 0 ? void 0 : _user$userInfo5.login, "/phone_unbind.json"), {
|
|
|
method: 'POST',
|
|
|
body: {
|
|
|
code: PhoneValue
|
|
|
}
|
|
|
});
|
|
|
case 5:
|
|
|
data = _context5.sent;
|
|
|
if ((data === null || data === void 0 ? void 0 : data.status) === 0) {
|
|
|
message/* default */.ZP.info('解绑成功');
|
|
|
setCountdownFlag(false);
|
|
|
setIsShowPhone(false);
|
|
|
// setCountdown(60);
|
|
|
setPhoneValue('');
|
|
|
dispatch({
|
|
|
type: 'account/getBasicInfo',
|
|
|
payload: {
|
|
|
login: (_user$userInfo6 = user.userInfo) === null || _user$userInfo6 === void 0 ? void 0 : _user$userInfo6.login
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
})),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
padding: '8px 24px'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: "\u624B\u673A\u53F7\u89E3\u7ED1\u540E\uFF0C\u5C06\u65E0\u6CD5\u4F7F\u7528\u8BE5\u624B\u673A\u53F7\u767B\u5F55\u5E73\u53F0\uFF0C\u8BF7\u77E5\u6089"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
children: ["\u4F60\u7684\u624B\u673A\u53F7\uFF1A", (_account$basicInfo18 = account.basicInfo) === null || _account$basicInfo18 === void 0 ? void 0 : _account$basicInfo18.phone]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
children: ["\u624B\u673A\u9A8C\u8BC1\u7801\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
size: 'middle',
|
|
|
value: PhoneValue,
|
|
|
onChange: function onChange(e) {
|
|
|
return setPhoneValue(e.target.value);
|
|
|
},
|
|
|
style: {
|
|
|
width: '220px'
|
|
|
}
|
|
|
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
disabled: countdownFlag,
|
|
|
type: "primary",
|
|
|
size: 'middle',
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6() {
|
|
|
var _user$userInfo7;
|
|
|
var data;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
case 0:
|
|
|
_context6.next = 2;
|
|
|
return (0,fetch/* default */.ZP)("/api/users/accounts/".concat(user === null || user === void 0 || (_user$userInfo7 = user.userInfo) === null || _user$userInfo7 === void 0 ? void 0 : _user$userInfo7.login, "/get_phone_code.json"), {
|
|
|
method: 'get'
|
|
|
});
|
|
|
case 2:
|
|
|
data = _context6.sent;
|
|
|
if ((data === null || data === void 0 ? void 0 : data.status) === 0) {
|
|
|
message/* default */.ZP.info('验证码发送成功');
|
|
|
setCountdownFlag(true);
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context6.stop();
|
|
|
}
|
|
|
}, _callee6);
|
|
|
})),
|
|
|
children: countdownFlag ? "\u91CD\u65B0\u53D1\u9001".concat(countdown, "s") : '获取验证码'
|
|
|
})]
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
title: "\u5F3A\u5236\u89E3\u7ED1",
|
|
|
open: isShowUntie,
|
|
|
onCancel: function onCancel() {
|
|
|
return setIsShowUntie(false);
|
|
|
},
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7() {
|
|
|
var _user$userInfo8;
|
|
|
var data, _user$userInfo9;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
|
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
|
case 0:
|
|
|
if (UntieValue) {
|
|
|
_context7.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('验证码不能为空');
|
|
|
return _context7.abrupt("return");
|
|
|
case 3:
|
|
|
_context7.next = 5;
|
|
|
return (0,fetch/* default */.ZP)("/api/users/accounts/".concat(user === null || user === void 0 || (_user$userInfo8 = user.userInfo) === null || _user$userInfo8 === void 0 ? void 0 : _user$userInfo8.login, "/phone_force_unbind.json"), {
|
|
|
method: 'POST',
|
|
|
body: {
|
|
|
code: UntieValue,
|
|
|
phone: form.getFieldValue("phone")
|
|
|
}
|
|
|
});
|
|
|
case 5:
|
|
|
data = _context7.sent;
|
|
|
if ((data === null || data === void 0 ? void 0 : data.status) === 0) {
|
|
|
message/* default */.ZP.info('解绑成功');
|
|
|
setCountdownFlag(false);
|
|
|
setIsShowUntie(false);
|
|
|
setActive(null);
|
|
|
setUntieValue('');
|
|
|
dispatch({
|
|
|
type: 'account/getBasicInfo',
|
|
|
payload: {
|
|
|
login: (_user$userInfo9 = user.userInfo) === null || _user$userInfo9 === void 0 ? void 0 : _user$userInfo9.login
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context7.stop();
|
|
|
}
|
|
|
}, _callee7);
|
|
|
})),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
padding: '8px 24px'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: "\u82E5\u539F\u8D26\u53F7\u53EA\u6709\u7ED1\u5B9A\u4E86\u624B\u673A\u53F7\u4E00\u79CD\u767B\u5F55\u65B9\u5F0F\uFF0C\u5F3A\u5236\u89E3\u7ED1\u540E\u4F1A\u5BFC\u81F4\u539F\u8D26\u53F7\u65E0\u6CD5\u767B\u5F55\uFF0C\u8BF7\u786E\u5B9A\u662F\u5426\u5F3A\u5236\u89E3\u7ED1"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
children: ["\u4F60\u7684\u624B\u673A\u53F7\uFF1A", form.getFieldValue("phone")]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
children: ["\u624B\u673A\u9A8C\u8BC1\u7801\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
value: UntieValue,
|
|
|
size: 'middle',
|
|
|
onChange: function onChange(e) {
|
|
|
return setUntieValue(e.target.value);
|
|
|
},
|
|
|
style: {
|
|
|
width: '240px'
|
|
|
}
|
|
|
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
disabled: countdownFlag,
|
|
|
type: "primary",
|
|
|
size: 'middle',
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8() {
|
|
|
var smscode, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
|
|
|
while (1) switch (_context8.prev = _context8.next) {
|
|
|
case 0:
|
|
|
smscode = (0,util/* setmiyah */.M)(form.getFieldValue("phone"));
|
|
|
_context8.next = 3;
|
|
|
return dispatch({
|
|
|
type: 'account/getCode',
|
|
|
payload: {
|
|
|
login: form.getFieldValue("phone"),
|
|
|
type: 10,
|
|
|
smscode: smscode
|
|
|
}
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context8.sent;
|
|
|
if (res.status === 1) {
|
|
|
message/* default */.ZP.info('验证码已发送,请注意查收');
|
|
|
setCountdownFlag(true);
|
|
|
}
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context8.stop();
|
|
|
}
|
|
|
}, _callee8);
|
|
|
})),
|
|
|
children: countdownFlag ? "\u91CD\u65B0\u53D1\u9001".concat(countdown, "s") : '获取验证码'
|
|
|
})]
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
title: "\u63D0\u793A",
|
|
|
open: isShowPoint,
|
|
|
onCancel: function onCancel() {
|
|
|
setIsShowPoint(false);
|
|
|
},
|
|
|
okText: "\u8FDB\u884C\u5F3A\u5236\u89E3\u7ED1",
|
|
|
okButtonProps: {
|
|
|
type: "primary",
|
|
|
ghost: true,
|
|
|
style: {
|
|
|
width: "124px"
|
|
|
}
|
|
|
},
|
|
|
onOk: function onOk() {
|
|
|
setIsShowUntie(true);
|
|
|
setIsShowPoint(false);
|
|
|
}
|
|
|
// footer={<div>
|
|
|
// <Button style={{textAlign:'end'}} type="primary" onClick={()=>setIsShowModal(false)}>确 定</Button>
|
|
|
// </div>}
|
|
|
,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
padding: '7px 24px'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u8BE5\u624B\u673A\u53F7\u5DF2\u7ECF\u88AB\u7ED1\u5B9A\u8D26\u53F7\uFF0C\u5982\u679C\u9700\u8981\u5C06\u8BE5\u624B\u673A\u53F7\u7ED1\u5B9A\u5728\u5F53\u524D\u8D26\u53F7\u4E0A\uFF0C\u4F60\u53EF\u4EE5\u8FDB\u884C\u4E0B\u65B9\u4EFB\u610F\u4E00\u79CD\u89E3\u7ED1\u64CD\u4F5C\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
style: {
|
|
|
marginTop: '1em',
|
|
|
display: 'flex'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
flex: '1'
|
|
|
},
|
|
|
children: "1\u3001\u4F7F\u7528\u8BE5\u624B\u673A\u53F7\u767B\u5F55\u5E73\u53F0\u8FDB\u884C\u89E3\u7ED1\uFF0C\u518D\u5C06\u624B\u673A\u53F7\u7ED1\u5B9A\u5F53\u524D\u8D26\u53F7\u4E0A\u3002"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
style: {
|
|
|
marginTop: '1em',
|
|
|
display: 'flex'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
flex: '1'
|
|
|
},
|
|
|
children: "2\u3001\u5F3A\u5236\u89E3\u7ED1\uFF08\u5F3A\u5236\u89E3\u7ED1\u53EF\u80FD\u4F1A\u5BFC\u81F4\u89E3\u7ED1\u8D26\u53F7\u65E0\u6CD5\u767B\u5F55\uFF09"
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var Account_Secure = ((0,_umi_production_exports.connect)(function (_ref17) {
|
|
|
var user = _ref17.user,
|
|
|
account = _ref17.account,
|
|
|
loading = _ref17.loading,
|
|
|
globalSetting = _ref17.globalSetting;
|
|
|
return {
|
|
|
user: user,
|
|
|
account: account,
|
|
|
globalSetting: globalSetting,
|
|
|
loading: loading.models.index
|
|
|
};
|
|
|
})(Secure));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 78079:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./src/utils/hooks/useInterval.tsx ***!
|
|
|
\*****************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ Y: function() { return /* binding */ useInterval; }
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
|
|
|
|
function useInterval(callback, delay) {
|
|
|
var savedCallback = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
|
|
|
var savedId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
|
|
|
|
|
|
// 保存新回调
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
|
savedCallback.current = callback;
|
|
|
});
|
|
|
|
|
|
// 建立 interval
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
|
function tick() {
|
|
|
savedCallback.current();
|
|
|
}
|
|
|
if (delay !== null) {
|
|
|
var id = setInterval(tick, delay);
|
|
|
savedId.current = id;
|
|
|
return function () {
|
|
|
return clearInterval(id);
|
|
|
};
|
|
|
}
|
|
|
}, [delay]);
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 92832:
|
|
|
/*!*********************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/input/index.js + 3 modules ***!
|
|
|
\*********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ input; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.5.1@classnames/index.js
|
|
|
var _classnames_2_5_1_classnames = __webpack_require__(92310);
|
|
|
var _classnames_2_5_1_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_5_1_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(36355);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/context.js
|
|
|
var form_context = __webpack_require__(32441);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/style/index.js
|
|
|
var style = __webpack_require__(9937);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/input/Group.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Group = props => {
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction
|
|
|
} = (0,_react_17_0_2_react.useContext)(context/* ConfigContext */.E_);
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className
|
|
|
} = props;
|
|
|
const prefixCls = getPrefixCls('input-group', customizePrefixCls);
|
|
|
const inputPrefixCls = getPrefixCls('input');
|
|
|
const [wrapSSR, hashId] = (0,style/* default */.ZP)(inputPrefixCls);
|
|
|
const cls = _classnames_2_5_1_classnames_default()(prefixCls, {
|
|
|
[`${prefixCls}-lg`]: props.size === 'large',
|
|
|
[`${prefixCls}-sm`]: props.size === 'small',
|
|
|
[`${prefixCls}-compact`]: props.compact,
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
|
}, hashId, className);
|
|
|
const formItemContext = (0,_react_17_0_2_react.useContext)(form_context/* FormItemInputContext */.aM);
|
|
|
const groupFormItemContext = (0,_react_17_0_2_react.useMemo)(() => Object.assign(Object.assign({}, formItemContext), {
|
|
|
isFormItemInput: false
|
|
|
}), [formItemContext]);
|
|
|
if (false) {}
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: cls,
|
|
|
style: props.style,
|
|
|
onMouseEnter: props.onMouseEnter,
|
|
|
onMouseLeave: props.onMouseLeave,
|
|
|
onFocus: props.onFocus,
|
|
|
onBlur: props.onBlur
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(form_context/* FormItemInputContext */.aM.Provider, {
|
|
|
value: groupFormItemContext
|
|
|
}, props.children)));
|
|
|
};
|
|
|
/* harmony default export */ var input_Group = (Group);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/Input.js + 1 modules
|
|
|
var Input = __webpack_require__(9432);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/EyeInvisibleOutlined.js + 1 modules
|
|
|
var EyeInvisibleOutlined = __webpack_require__(73331);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/EyeOutlined.js + 1 modules
|
|
|
var EyeOutlined = __webpack_require__(15277);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/omit.js
|
|
|
var omit = __webpack_require__(2738);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.44.4@rc-util/es/ref.js
|
|
|
var es_ref = __webpack_require__(8654);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/hooks/useRemovePasswordTimeout.js
|
|
|
var useRemovePasswordTimeout = __webpack_require__(59412);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/input/Password.js
|
|
|
"use client";
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const defaultIconRender = visible => visible ? /*#__PURE__*/_react_17_0_2_react.createElement(EyeOutlined/* default */.Z, null) : /*#__PURE__*/_react_17_0_2_react.createElement(EyeInvisibleOutlined/* default */.Z, null);
|
|
|
const ActionMap = {
|
|
|
click: 'onClick',
|
|
|
hover: 'onMouseOver'
|
|
|
};
|
|
|
const Password = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
|
const {
|
|
|
visibilityToggle = true
|
|
|
} = props;
|
|
|
const visibilityControlled = typeof visibilityToggle === 'object' && visibilityToggle.visible !== undefined;
|
|
|
const [visible, setVisible] = (0,_react_17_0_2_react.useState)(() => visibilityControlled ? visibilityToggle.visible : false);
|
|
|
const inputRef = (0,_react_17_0_2_react.useRef)(null);
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if (visibilityControlled) {
|
|
|
setVisible(visibilityToggle.visible);
|
|
|
}
|
|
|
}, [visibilityControlled, visibilityToggle]);
|
|
|
// Remove Password value
|
|
|
const removePasswordTimeout = (0,useRemovePasswordTimeout/* default */.Z)(inputRef);
|
|
|
const onVisibleChange = () => {
|
|
|
const {
|
|
|
disabled
|
|
|
} = props;
|
|
|
if (disabled) {
|
|
|
return;
|
|
|
}
|
|
|
if (visible) {
|
|
|
removePasswordTimeout();
|
|
|
}
|
|
|
setVisible(prevState => {
|
|
|
var _a;
|
|
|
const newState = !prevState;
|
|
|
if (typeof visibilityToggle === 'object') {
|
|
|
(_a = visibilityToggle.onVisibleChange) === null || _a === void 0 ? void 0 : _a.call(visibilityToggle, newState);
|
|
|
}
|
|
|
return newState;
|
|
|
});
|
|
|
};
|
|
|
const getIcon = prefixCls => {
|
|
|
const {
|
|
|
action = 'click',
|
|
|
iconRender = defaultIconRender
|
|
|
} = props;
|
|
|
const iconTrigger = ActionMap[action] || '';
|
|
|
const icon = iconRender(visible);
|
|
|
const iconProps = {
|
|
|
[iconTrigger]: onVisibleChange,
|
|
|
className: `${prefixCls}-icon`,
|
|
|
key: 'passwordIcon',
|
|
|
onMouseDown: e => {
|
|
|
// Prevent focused state lost
|
|
|
// https://github.com/ant-design/ant-design/issues/15173
|
|
|
e.preventDefault();
|
|
|
},
|
|
|
onMouseUp: e => {
|
|
|
// Prevent caret position change
|
|
|
// https://github.com/ant-design/ant-design/issues/23524
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
};
|
|
|
return /*#__PURE__*/_react_17_0_2_react.cloneElement( /*#__PURE__*/_react_17_0_2_react.isValidElement(icon) ? icon : /*#__PURE__*/_react_17_0_2_react.createElement("span", null, icon), iconProps);
|
|
|
};
|
|
|
const {
|
|
|
className,
|
|
|
prefixCls: customizePrefixCls,
|
|
|
inputPrefixCls: customizeInputPrefixCls,
|
|
|
size
|
|
|
} = props,
|
|
|
restProps = __rest(props, ["className", "prefixCls", "inputPrefixCls", "size"]);
|
|
|
const {
|
|
|
getPrefixCls
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
|
|
|
const prefixCls = getPrefixCls('input-password', customizePrefixCls);
|
|
|
const suffixIcon = visibilityToggle && getIcon(prefixCls);
|
|
|
const inputClassName = _classnames_2_5_1_classnames_default()(prefixCls, className, {
|
|
|
[`${prefixCls}-${size}`]: !!size
|
|
|
});
|
|
|
const omittedProps = Object.assign(Object.assign({}, (0,omit/* default */.Z)(restProps, ['suffix', 'iconRender', 'visibilityToggle'])), {
|
|
|
type: visible ? 'text' : 'password',
|
|
|
className: inputClassName,
|
|
|
prefixCls: inputPrefixCls,
|
|
|
suffix: suffixIcon
|
|
|
});
|
|
|
if (size) {
|
|
|
omittedProps.size = size;
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(Input/* default */.Z, Object.assign({
|
|
|
ref: (0,es_ref/* composeRef */.sQ)(ref, inputRef)
|
|
|
}, omittedProps));
|
|
|
});
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var input_Password = (Password);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.6.1@@ant-design/icons/es/icons/SearchOutlined.js + 1 modules
|
|
|
var SearchOutlined = __webpack_require__(47472);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/reactNode.js
|
|
|
var reactNode = __webpack_require__(92343);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/hooks/useSize.js
|
|
|
var useSize = __webpack_require__(19716);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/Compact.js
|
|
|
var Compact = __webpack_require__(33234);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/input/Search.js
|
|
|
"use client";
|
|
|
|
|
|
var Search_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Search = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
inputPrefixCls: customizeInputPrefixCls,
|
|
|
className,
|
|
|
size: customizeSize,
|
|
|
suffix,
|
|
|
enterButton = false,
|
|
|
addonAfter,
|
|
|
loading,
|
|
|
disabled,
|
|
|
onSearch: customOnSearch,
|
|
|
onChange: customOnChange,
|
|
|
onCompositionStart,
|
|
|
onCompositionEnd
|
|
|
} = props,
|
|
|
restProps = Search_rest(props, ["prefixCls", "inputPrefixCls", "className", "size", "suffix", "enterButton", "addonAfter", "loading", "disabled", "onSearch", "onChange", "onCompositionStart", "onCompositionEnd"]);
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const composedRef = _react_17_0_2_react.useRef(false);
|
|
|
const prefixCls = getPrefixCls('input-search', customizePrefixCls);
|
|
|
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
|
|
|
const {
|
|
|
compactSize
|
|
|
} = (0,Compact/* useCompactItemContext */.ri)(prefixCls, direction);
|
|
|
const size = (0,useSize/* default */.Z)(ctx => {
|
|
|
var _a;
|
|
|
return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
|
|
|
});
|
|
|
const inputRef = _react_17_0_2_react.useRef(null);
|
|
|
const onChange = e => {
|
|
|
if (e && e.target && e.type === 'click' && customOnSearch) {
|
|
|
customOnSearch(e.target.value, e, {
|
|
|
source: 'clear'
|
|
|
});
|
|
|
}
|
|
|
if (customOnChange) {
|
|
|
customOnChange(e);
|
|
|
}
|
|
|
};
|
|
|
const onMouseDown = e => {
|
|
|
var _a;
|
|
|
if (document.activeElement === ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input)) {
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
};
|
|
|
const onSearch = e => {
|
|
|
var _a, _b;
|
|
|
if (customOnSearch) {
|
|
|
customOnSearch((_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.value, e, {
|
|
|
source: 'input'
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
const onPressEnter = e => {
|
|
|
if (composedRef.current || loading) {
|
|
|
return;
|
|
|
}
|
|
|
onSearch(e);
|
|
|
};
|
|
|
const searchIcon = typeof enterButton === 'boolean' ? /*#__PURE__*/_react_17_0_2_react.createElement(SearchOutlined/* default */.Z, null) : null;
|
|
|
const btnClassName = `${prefixCls}-button`;
|
|
|
let button;
|
|
|
const enterButtonAsElement = enterButton || {};
|
|
|
const isAntdButton = enterButtonAsElement.type && enterButtonAsElement.type.__ANT_BUTTON === true;
|
|
|
if (isAntdButton || enterButtonAsElement.type === 'button') {
|
|
|
button = (0,reactNode/* cloneElement */.Tm)(enterButtonAsElement, Object.assign({
|
|
|
onMouseDown,
|
|
|
onClick: e => {
|
|
|
var _a, _b;
|
|
|
(_b = (_a = enterButtonAsElement === null || enterButtonAsElement === void 0 ? void 0 : enterButtonAsElement.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
|
onSearch(e);
|
|
|
},
|
|
|
key: 'enterButton'
|
|
|
}, isAntdButton ? {
|
|
|
className: btnClassName,
|
|
|
size
|
|
|
} : {}));
|
|
|
} else {
|
|
|
button = /*#__PURE__*/_react_17_0_2_react.createElement(es_button/* default */.ZP, {
|
|
|
className: btnClassName,
|
|
|
type: enterButton ? 'primary' : undefined,
|
|
|
size: size,
|
|
|
disabled: disabled,
|
|
|
key: "enterButton",
|
|
|
onMouseDown: onMouseDown,
|
|
|
onClick: onSearch,
|
|
|
loading: loading,
|
|
|
icon: searchIcon
|
|
|
}, enterButton);
|
|
|
}
|
|
|
if (addonAfter) {
|
|
|
button = [button, (0,reactNode/* cloneElement */.Tm)(addonAfter, {
|
|
|
key: 'addonAfter'
|
|
|
})];
|
|
|
}
|
|
|
const cls = _classnames_2_5_1_classnames_default()(prefixCls, {
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
|
[`${prefixCls}-${size}`]: !!size,
|
|
|
[`${prefixCls}-with-button`]: !!enterButton
|
|
|
}, className);
|
|
|
const handleOnCompositionStart = e => {
|
|
|
composedRef.current = true;
|
|
|
onCompositionStart === null || onCompositionStart === void 0 ? void 0 : onCompositionStart(e);
|
|
|
};
|
|
|
const handleOnCompositionEnd = e => {
|
|
|
composedRef.current = false;
|
|
|
onCompositionEnd === null || onCompositionEnd === void 0 ? void 0 : onCompositionEnd(e);
|
|
|
};
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(Input/* default */.Z, Object.assign({
|
|
|
ref: (0,es_ref/* composeRef */.sQ)(inputRef, ref),
|
|
|
onPressEnter: onPressEnter
|
|
|
}, restProps, {
|
|
|
size: size,
|
|
|
onCompositionStart: handleOnCompositionStart,
|
|
|
onCompositionEnd: handleOnCompositionEnd,
|
|
|
prefixCls: inputPrefixCls,
|
|
|
addonAfter: button,
|
|
|
suffix: suffix,
|
|
|
onChange: onChange,
|
|
|
className: cls,
|
|
|
disabled: disabled
|
|
|
}));
|
|
|
});
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var input_Search = (Search);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/TextArea.js
|
|
|
var TextArea = __webpack_require__(1643);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const input_Input = Input/* default */.Z;
|
|
|
if (false) {}
|
|
|
input_Input.Group = input_Group;
|
|
|
input_Input.Search = input_Search;
|
|
|
input_Input.TextArea = TextArea/* default */.Z;
|
|
|
input_Input.Password = input_Password;
|
|
|
/* harmony default export */ var input = (input_Input);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 8378:
|
|
|
/*!*******************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/style/motion/collapse.js ***!
|
|
|
\*******************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
|
|
const genCollapseMotion = token => ({
|
|
|
[token.componentCls]: {
|
|
|
// For common/openAnimation
|
|
|
[`${token.antCls}-motion-collapse-legacy`]: {
|
|
|
overflow: 'hidden',
|
|
|
'&-active': {
|
|
|
transition: `height ${token.motionDurationMid} ${token.motionEaseInOut},
|
|
|
opacity ${token.motionDurationMid} ${token.motionEaseInOut} !important`
|
|
|
}
|
|
|
},
|
|
|
[`${token.antCls}-motion-collapse`]: {
|
|
|
overflow: 'hidden',
|
|
|
transition: `height ${token.motionDurationMid} ${token.motionEaseInOut},
|
|
|
opacity ${token.motionDurationMid} ${token.motionEaseInOut} !important`
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
/* harmony default export */ __webpack_exports__.Z = (genCollapseMotion);
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |