|
|
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[267],{
|
|
|
|
|
|
/***/ "55Ip":
|
|
|
/*!***************************************************************!*\
|
|
|
!*** ./node_modules/react-router-dom/esm/react-router-dom.js ***!
|
|
|
\***************************************************************/
|
|
|
/*! exports provided: MemoryRouter, Prompt, Redirect, Route, Router, StaticRouter, Switch, generatePath, matchPath, useHistory, useLocation, useParams, useRouteMatch, withRouter, BrowserRouter, HashRouter, Link, NavLink */
|
|
|
/*! exports used: Link, NavLink */
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
/* unused harmony export BrowserRouter */
|
|
|
/* unused harmony export HashRouter */
|
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Link; });
|
|
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return NavLink; });
|
|
|
/* harmony import */ var react_router__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-router */ "Ty5D");
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inheritsLoose */ "dI71");
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "cDcd");
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
|
|
/* harmony import */ var history__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! history */ "YS25");
|
|
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "17x9");
|
|
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ "wx14");
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutPropertiesLoose */ "zLVn");
|
|
|
/* harmony import */ var tiny_invariant__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! tiny-invariant */ "9R94");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* The public API for a <Router> that uses HTML5 history.
|
|
|
*/
|
|
|
|
|
|
var BrowserRouter =
|
|
|
/*#__PURE__*/
|
|
|
function (_React$Component) {
|
|
|
Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(BrowserRouter, _React$Component);
|
|
|
|
|
|
function BrowserRouter() {
|
|
|
var _this;
|
|
|
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
|
args[_key] = arguments[_key];
|
|
|
}
|
|
|
|
|
|
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
|
_this.history = Object(history__WEBPACK_IMPORTED_MODULE_3__[/* createBrowserHistory */ "a"])(_this.props);
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
var _proto = BrowserRouter.prototype;
|
|
|
|
|
|
_proto.render = function render() {
|
|
|
return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_router__WEBPACK_IMPORTED_MODULE_0__[/* Router */ "c"], {
|
|
|
history: this.history,
|
|
|
children: this.props.children
|
|
|
});
|
|
|
};
|
|
|
|
|
|
return BrowserRouter;
|
|
|
}(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component);
|
|
|
|
|
|
if (false) {}
|
|
|
|
|
|
/**
|
|
|
* The public API for a <Router> that uses window.location.hash.
|
|
|
*/
|
|
|
|
|
|
var HashRouter =
|
|
|
/*#__PURE__*/
|
|
|
function (_React$Component) {
|
|
|
Object(_babel_runtime_helpers_esm_inheritsLoose__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(HashRouter, _React$Component);
|
|
|
|
|
|
function HashRouter() {
|
|
|
var _this;
|
|
|
|
|
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
|
args[_key] = arguments[_key];
|
|
|
}
|
|
|
|
|
|
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
|
|
|
_this.history = Object(history__WEBPACK_IMPORTED_MODULE_3__[/* createHashHistory */ "b"])(_this.props);
|
|
|
return _this;
|
|
|
}
|
|
|
|
|
|
var _proto = HashRouter.prototype;
|
|
|
|
|
|
_proto.render = function render() {
|
|
|
return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_router__WEBPACK_IMPORTED_MODULE_0__[/* Router */ "c"], {
|
|
|
history: this.history,
|
|
|
children: this.props.children
|
|
|
});
|
|
|
};
|
|
|
|
|
|
return HashRouter;
|
|
|
}(react__WEBPACK_IMPORTED_MODULE_2___default.a.Component);
|
|
|
|
|
|
if (false) {}
|
|
|
|
|
|
var resolveToLocation = function resolveToLocation(to, currentLocation) {
|
|
|
return typeof to === "function" ? to(currentLocation) : to;
|
|
|
};
|
|
|
var normalizeToLocation = function normalizeToLocation(to, currentLocation) {
|
|
|
return typeof to === "string" ? Object(history__WEBPACK_IMPORTED_MODULE_3__[/* createLocation */ "c"])(to, null, null, currentLocation) : to;
|
|
|
};
|
|
|
|
|
|
var forwardRefShim = function forwardRefShim(C) {
|
|
|
return C;
|
|
|
};
|
|
|
|
|
|
var forwardRef = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef;
|
|
|
|
|
|
if (typeof forwardRef === "undefined") {
|
|
|
forwardRef = forwardRefShim;
|
|
|
}
|
|
|
|
|
|
function isModifiedEvent(event) {
|
|
|
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
|
|
|
}
|
|
|
|
|
|
var LinkAnchor = forwardRef(function (_ref, forwardedRef) {
|
|
|
var innerRef = _ref.innerRef,
|
|
|
navigate = _ref.navigate,
|
|
|
_onClick = _ref.onClick,
|
|
|
rest = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(_ref, ["innerRef", "navigate", "onClick"]);
|
|
|
|
|
|
var target = rest.target;
|
|
|
|
|
|
var props = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])({}, rest, {
|
|
|
onClick: function onClick(event) {
|
|
|
try {
|
|
|
if (_onClick) _onClick(event);
|
|
|
} catch (ex) {
|
|
|
event.preventDefault();
|
|
|
throw ex;
|
|
|
}
|
|
|
|
|
|
if (!event.defaultPrevented && // onClick prevented default
|
|
|
event.button === 0 && ( // ignore everything but left clicks
|
|
|
!target || target === "_self") && // let browser handle "target=_blank" etc.
|
|
|
!isModifiedEvent(event) // ignore clicks with modifier keys
|
|
|
) {
|
|
|
event.preventDefault();
|
|
|
navigate();
|
|
|
}
|
|
|
}
|
|
|
}); // React 15 compat
|
|
|
|
|
|
|
|
|
if (forwardRefShim !== forwardRef) {
|
|
|
props.ref = forwardedRef || innerRef;
|
|
|
} else {
|
|
|
props.ref = innerRef;
|
|
|
}
|
|
|
/* eslint-disable-next-line jsx-a11y/anchor-has-content */
|
|
|
|
|
|
|
|
|
return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement("a", props);
|
|
|
});
|
|
|
|
|
|
if (false) {}
|
|
|
/**
|
|
|
* The public API for rendering a history-aware <a>.
|
|
|
*/
|
|
|
|
|
|
|
|
|
var Link = forwardRef(function (_ref2, forwardedRef) {
|
|
|
var _ref2$component = _ref2.component,
|
|
|
component = _ref2$component === void 0 ? LinkAnchor : _ref2$component,
|
|
|
replace = _ref2.replace,
|
|
|
to = _ref2.to,
|
|
|
innerRef = _ref2.innerRef,
|
|
|
rest = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(_ref2, ["component", "replace", "to", "innerRef"]);
|
|
|
|
|
|
return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_router__WEBPACK_IMPORTED_MODULE_0__[/* __RouterContext */ "e"].Consumer, null, function (context) {
|
|
|
!context ? false ? undefined : Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])(false) : void 0;
|
|
|
var history = context.history;
|
|
|
var location = normalizeToLocation(resolveToLocation(to, context.location), context.location);
|
|
|
var href = location ? history.createHref(location) : "";
|
|
|
|
|
|
var props = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])({}, rest, {
|
|
|
href: href,
|
|
|
navigate: function navigate() {
|
|
|
var location = resolveToLocation(to, context.location);
|
|
|
var method = replace ? history.replace : history.push;
|
|
|
method(location);
|
|
|
}
|
|
|
}); // React 15 compat
|
|
|
|
|
|
|
|
|
if (forwardRefShim !== forwardRef) {
|
|
|
props.ref = forwardedRef || innerRef;
|
|
|
} else {
|
|
|
props.innerRef = innerRef;
|
|
|
}
|
|
|
|
|
|
return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(component, props);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
if (false) { var refType, toType; }
|
|
|
|
|
|
var forwardRefShim$1 = function forwardRefShim(C) {
|
|
|
return C;
|
|
|
};
|
|
|
|
|
|
var forwardRef$1 = react__WEBPACK_IMPORTED_MODULE_2___default.a.forwardRef;
|
|
|
|
|
|
if (typeof forwardRef$1 === "undefined") {
|
|
|
forwardRef$1 = forwardRefShim$1;
|
|
|
}
|
|
|
|
|
|
function joinClassnames() {
|
|
|
for (var _len = arguments.length, classnames = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
|
classnames[_key] = arguments[_key];
|
|
|
}
|
|
|
|
|
|
return classnames.filter(function (i) {
|
|
|
return i;
|
|
|
}).join(" ");
|
|
|
}
|
|
|
/**
|
|
|
* A <Link> wrapper that knows if it's "active" or not.
|
|
|
*/
|
|
|
|
|
|
|
|
|
var NavLink = forwardRef$1(function (_ref, forwardedRef) {
|
|
|
var _ref$ariaCurrent = _ref["aria-current"],
|
|
|
ariaCurrent = _ref$ariaCurrent === void 0 ? "page" : _ref$ariaCurrent,
|
|
|
_ref$activeClassName = _ref.activeClassName,
|
|
|
activeClassName = _ref$activeClassName === void 0 ? "active" : _ref$activeClassName,
|
|
|
activeStyle = _ref.activeStyle,
|
|
|
classNameProp = _ref.className,
|
|
|
exact = _ref.exact,
|
|
|
isActiveProp = _ref.isActive,
|
|
|
locationProp = _ref.location,
|
|
|
sensitive = _ref.sensitive,
|
|
|
strict = _ref.strict,
|
|
|
styleProp = _ref.style,
|
|
|
to = _ref.to,
|
|
|
innerRef = _ref.innerRef,
|
|
|
rest = Object(_babel_runtime_helpers_esm_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(_ref, ["aria-current", "activeClassName", "activeStyle", "className", "exact", "isActive", "location", "sensitive", "strict", "style", "to", "innerRef"]);
|
|
|
|
|
|
return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(react_router__WEBPACK_IMPORTED_MODULE_0__[/* __RouterContext */ "e"].Consumer, null, function (context) {
|
|
|
!context ? false ? undefined : Object(tiny_invariant__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"])(false) : void 0;
|
|
|
var currentLocation = locationProp || context.location;
|
|
|
var toLocation = normalizeToLocation(resolveToLocation(to, currentLocation), currentLocation);
|
|
|
var path = toLocation.pathname; // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202
|
|
|
|
|
|
var escapedPath = path && path.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
|
|
|
var match = escapedPath ? Object(react_router__WEBPACK_IMPORTED_MODULE_0__[/* matchPath */ "f"])(currentLocation.pathname, {
|
|
|
path: escapedPath,
|
|
|
exact: exact,
|
|
|
sensitive: sensitive,
|
|
|
strict: strict
|
|
|
}) : null;
|
|
|
var isActive = !!(isActiveProp ? isActiveProp(match, currentLocation) : match);
|
|
|
var className = isActive ? joinClassnames(classNameProp, activeClassName) : classNameProp;
|
|
|
var style = isActive ? Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])({}, styleProp, {}, activeStyle) : styleProp;
|
|
|
|
|
|
var props = Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])({
|
|
|
"aria-current": isActive && ariaCurrent || null,
|
|
|
className: className,
|
|
|
style: style,
|
|
|
to: toLocation
|
|
|
}, rest); // React 15 compat
|
|
|
|
|
|
|
|
|
if (forwardRefShim$1 !== forwardRef$1) {
|
|
|
props.ref = forwardedRef || innerRef;
|
|
|
} else {
|
|
|
props.innerRef = innerRef;
|
|
|
}
|
|
|
|
|
|
return react__WEBPACK_IMPORTED_MODULE_2___default.a.createElement(Link, props);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
if (false) { var ariaCurrentType; }
|
|
|
|
|
|
|
|
|
//# sourceMappingURL=react-router-dom.js.map
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ "LsG1":
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./src/pages/User/ResetPassword/index.tsx + 1 modules ***!
|
|
|
\************************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/.umi-production/core/umiExports.ts */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/User/RegisterPanel/unlock.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/User/Register/service.ts */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/util.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react-router-dom/esm/react-router-dom.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react-router/esm/react-router.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with external "window.React" (<- Module is not an ECMAScript module) */
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
"use strict";
|
|
|
// ESM COMPAT FLAG
|
|
|
__webpack_require__.r(__webpack_exports__);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__("9og8");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js
|
|
|
var regenerator = __webpack_require__("WmNS");
|
|
|
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
|
|
|
|
|
// EXTERNAL MODULE: external "window.React"
|
|
|
var external_window_React_ = __webpack_require__("cDcd");
|
|
|
var external_window_React_default = /*#__PURE__*/__webpack_require__.n(external_window_React_);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/style/index.js
|
|
|
var button_style = __webpack_require__("+L6B");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/button/index.js
|
|
|
var es_button = __webpack_require__("2/Rp");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/style/index.js
|
|
|
var input_style = __webpack_require__("5NDa");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/input/index.js + 3 modules
|
|
|
var input = __webpack_require__("5rEg");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/style/index.js
|
|
|
var form_style = __webpack_require__("y8nQ");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/antd/es/form/index.js + 11 modules
|
|
|
var es_form = __webpack_require__("Vl3Y");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
|
|
var slicedToArray = __webpack_require__("tJVT");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__("k1fw");
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/components/User/RegisterPanel/unlock.tsx
|
|
|
var unlock = __webpack_require__("comi");
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx + 1 modules
|
|
|
var util = __webpack_require__("1vsH");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/react-router/esm/react-router.js
|
|
|
var react_router = __webpack_require__("Ty5D");
|
|
|
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/core/umiExports.ts + 17 modules
|
|
|
var umiExports = __webpack_require__("9kvl");
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/react-router-dom/esm/react-router-dom.js
|
|
|
var react_router_dom = __webpack_require__("55Ip");
|
|
|
|
|
|
// CONCATENATED MODULE: ./src/components/User/ResetPasswordPanel/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var inputStyle = {
|
|
|
height: 48
|
|
|
};
|
|
|
var loginRegex = /(\b[\w\.-]+@[\w\.-]+\.\w{2,4}\b)|(^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$)/i;
|
|
|
var initialState = {
|
|
|
timer: 0
|
|
|
};
|
|
|
var Types;
|
|
|
|
|
|
(function (Types) {
|
|
|
Types[Types["setTimer"] = 0] = "setTimer";
|
|
|
})(Types || (Types = {}));
|
|
|
|
|
|
function reducer(state, action) {
|
|
|
switch (action.type) {
|
|
|
case Types.setTimer:
|
|
|
return Object(objectSpread2["a" /* default */])(Object(objectSpread2["a" /* default */])({}, state), {}, {
|
|
|
timer: action.payload
|
|
|
});
|
|
|
|
|
|
default:
|
|
|
throw new Error();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/* harmony default export */ var ResetPasswordPanel = (function (_ref) {
|
|
|
var validateName = _ref.validateName,
|
|
|
getCode = _ref.getCode,
|
|
|
callback = _ref.callback,
|
|
|
_ref$style = _ref.style,
|
|
|
style = _ref$style === void 0 ? {} : _ref$style;
|
|
|
var location = Object(react_router["h" /* useLocation */])();
|
|
|
|
|
|
var _Form$useForm = es_form["a" /* default */].useForm(),
|
|
|
_Form$useForm2 = Object(slicedToArray["a" /* default */])(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
|
|
|
var _useReducer = Object(external_window_React_["useReducer"])(reducer, initialState),
|
|
|
_useReducer2 = Object(slicedToArray["a" /* default */])(_useReducer, 2),
|
|
|
state = _useReducer2[0],
|
|
|
dispatch = _useReducer2[1];
|
|
|
|
|
|
var _useState = Object(external_window_React_["useState"])(false),
|
|
|
_useState2 = Object(slicedToArray["a" /* default */])(_useState, 2),
|
|
|
codeLoading = _useState2[0],
|
|
|
setCodeLoading = _useState2[1];
|
|
|
|
|
|
var timer = state.timer;
|
|
|
|
|
|
function onFinish(_x) {
|
|
|
return _onFinish.apply(this, arguments);
|
|
|
}
|
|
|
|
|
|
function _onFinish() {
|
|
|
_onFinish = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regenerator_default.a.mark(function _callee2(values) {
|
|
|
var login, new_password, code, new_password_confirmation, _yield$callback, message, status, show, start_date, _location$query, from;
|
|
|
|
|
|
return regenerator_default.a.wrap(function _callee2$(_context2) {
|
|
|
while (1) {
|
|
|
switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
login = values.login, new_password = values.new_password, code = values.code, new_password_confirmation = values.new_password_confirmation;
|
|
|
_context2.next = 3;
|
|
|
return callback({
|
|
|
login: login,
|
|
|
new_password_confirmation: new_password_confirmation,
|
|
|
new_password: new_password,
|
|
|
code: code
|
|
|
});
|
|
|
|
|
|
case 3:
|
|
|
_yield$callback = _context2.sent;
|
|
|
message = _yield$callback.message;
|
|
|
status = _yield$callback.status;
|
|
|
show = _yield$callback.show;
|
|
|
start_date = _yield$callback.start_date;
|
|
|
|
|
|
if (status === 0) {
|
|
|
if (show) {
|
|
|
localStorage.setItem('extension-modal', 'exist');
|
|
|
localStorage.setItem('extension-date', start_date);
|
|
|
} else {
|
|
|
localStorage.removeItem('extension-modal');
|
|
|
}
|
|
|
|
|
|
from = (_location$query = location.query) === null || _location$query === void 0 ? void 0 : _location$query.from;
|
|
|
|
|
|
if (from && from.indexOf('login') < 0) {
|
|
|
umiExports["d" /* history */].replace(from);
|
|
|
} else {
|
|
|
umiExports["d" /* history */].replace('/');
|
|
|
}
|
|
|
} else {
|
|
|
form.setFields([{
|
|
|
name: 'code',
|
|
|
errors: [message]
|
|
|
}]);
|
|
|
}
|
|
|
|
|
|
case 9:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return _onFinish.apply(this, arguments);
|
|
|
}
|
|
|
|
|
|
function onValidateName() {
|
|
|
return _onValidateName.apply(this, arguments);
|
|
|
}
|
|
|
|
|
|
function _onValidateName() {
|
|
|
_onValidateName = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regenerator_default.a.mark(function _callee3() {
|
|
|
var login, flag, _yield$validateName, status, message, isOk;
|
|
|
|
|
|
return regenerator_default.a.wrap(function _callee3$(_context3) {
|
|
|
while (1) {
|
|
|
switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
login = form.getFieldValue('login');
|
|
|
flag = 0;
|
|
|
|
|
|
if (!(!loginRegex.test(login) || login.indexOf(" ") > -1)) {
|
|
|
_context3.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
form.setFields([{
|
|
|
name: 'login',
|
|
|
errors: ['请输入正确的手机号或邮箱']
|
|
|
}]);
|
|
|
flag = 1;
|
|
|
return _context3.abrupt("return", flag);
|
|
|
|
|
|
case 6:
|
|
|
_context3.next = 8;
|
|
|
return validateName({
|
|
|
login: login,
|
|
|
type: 2
|
|
|
});
|
|
|
|
|
|
case 8:
|
|
|
_yield$validateName = _context3.sent;
|
|
|
status = _yield$validateName.status;
|
|
|
message = _yield$validateName.message;
|
|
|
isOk = status > 0;
|
|
|
|
|
|
if (isOk) {
|
|
|
flag = 2;
|
|
|
} else {
|
|
|
form.setFields([{
|
|
|
name: 'login',
|
|
|
errors: [message]
|
|
|
}]);
|
|
|
flag = 1;
|
|
|
}
|
|
|
|
|
|
return _context3.abrupt("return", flag);
|
|
|
|
|
|
case 14:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return _onValidateName.apply(this, arguments);
|
|
|
}
|
|
|
|
|
|
var onGetCode = /*#__PURE__*/function () {
|
|
|
var _ref2 = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
|
|
|
var verify, login, _yield$getCode, status, message;
|
|
|
|
|
|
return regenerator_default.a.wrap(function _callee$(_context) {
|
|
|
while (1) {
|
|
|
switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
verify = form.getFieldValue('verify');
|
|
|
login = form.getFieldValue('login');
|
|
|
|
|
|
if (verify) {
|
|
|
_context.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
form.validateFields(['verify']);
|
|
|
_context.next = 15;
|
|
|
break;
|
|
|
|
|
|
case 6:
|
|
|
setCodeLoading(true);
|
|
|
_context.next = 9;
|
|
|
return getCode({
|
|
|
login: login,
|
|
|
type: 2,
|
|
|
smscode: Object(util["X" /* setmiyah */])(login)
|
|
|
});
|
|
|
|
|
|
case 9:
|
|
|
_yield$getCode = _context.sent;
|
|
|
status = _yield$getCode.status;
|
|
|
message = _yield$getCode.message;
|
|
|
|
|
|
if (status < 0) {
|
|
|
form.setFields([{
|
|
|
name: 'code',
|
|
|
errors: [message]
|
|
|
}]);
|
|
|
}
|
|
|
|
|
|
dispatch({
|
|
|
type: Types.setTimer,
|
|
|
payload: 60
|
|
|
});
|
|
|
setCodeLoading(false);
|
|
|
|
|
|
case 15:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
|
|
|
return function onGetCode() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
|
|
|
function validatePassword(_, value) {
|
|
|
var confirmationValue = form.getFieldValue('new_password_confirmation');
|
|
|
|
|
|
if (!value) {
|
|
|
return Promise.resolve();
|
|
|
}
|
|
|
|
|
|
form.setFields([{
|
|
|
name: 'new_password_confirmation',
|
|
|
errors: confirmationValue && confirmationValue !== value ? ['两次密码不一致'] : []
|
|
|
}]);
|
|
|
|
|
|
if (value.indexOf(" ") > -1) {
|
|
|
return Promise.reject('请输入8-16位密码,区分大小写、不能使用空格');
|
|
|
}
|
|
|
|
|
|
var len = value.length;
|
|
|
|
|
|
if (len >= 8 && len <= 16) {
|
|
|
return Promise.resolve();
|
|
|
} else {
|
|
|
return Promise.reject('请输入8-16位密码,区分大小写、不能使用空格');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
Object(external_window_React_["useEffect"])(function () {
|
|
|
if (timer > 0) {
|
|
|
setTimeout(function () {
|
|
|
dispatch({
|
|
|
type: Types.setTimer,
|
|
|
payload: timer - 1
|
|
|
});
|
|
|
}, 1000);
|
|
|
}
|
|
|
}, [timer]);
|
|
|
|
|
|
var verifyValidate = function verifyValidate(_, value) {
|
|
|
return value ? Promise.resolve() : Promise.reject('请拖动滑块验证');
|
|
|
};
|
|
|
|
|
|
var LoginValidate = function LoginValidate(_, value) {
|
|
|
if (!value) {
|
|
|
return Promise.resolve();
|
|
|
}
|
|
|
|
|
|
if (value.indexOf(" ") > -1) {
|
|
|
return Promise.reject('请输入正确的手机号或邮箱');
|
|
|
}
|
|
|
|
|
|
if (loginRegex.test(value)) {
|
|
|
return Promise.resolve();
|
|
|
} else {
|
|
|
return Promise.reject('请输入正确的手机号或邮箱');
|
|
|
}
|
|
|
};
|
|
|
|
|
|
return /*#__PURE__*/external_window_React_default.a.createElement(es_form["a" /* default */], {
|
|
|
layout: "vertical",
|
|
|
form: form,
|
|
|
style: style,
|
|
|
initialValues: {
|
|
|
autologin: true,
|
|
|
protool: true
|
|
|
},
|
|
|
onFinish: onFinish
|
|
|
}, /*#__PURE__*/external_window_React_default.a.createElement(es_form["a" /* default */].Item, {
|
|
|
name: "login",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入正确的手机号或邮箱'
|
|
|
}, {
|
|
|
validator: LoginValidate
|
|
|
}]
|
|
|
}, /*#__PURE__*/external_window_React_default.a.createElement(input["a" /* default */], {
|
|
|
style: inputStyle,
|
|
|
size: "large",
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u624B\u673A\u53F7/\u90AE\u7BB1\u53F7",
|
|
|
onChange: function onChange() {
|
|
|
return form.setFieldsValue({
|
|
|
verify: 0
|
|
|
});
|
|
|
}
|
|
|
})), /*#__PURE__*/external_window_React_default.a.createElement(es_form["a" /* default */].Item, {
|
|
|
name: "verify",
|
|
|
rules: [{
|
|
|
validator: verifyValidate
|
|
|
}]
|
|
|
}, /*#__PURE__*/external_window_React_default.a.createElement(unlock["a" /* default */], {
|
|
|
onValidate: onValidateName
|
|
|
})), /*#__PURE__*/external_window_React_default.a.createElement(es_form["a" /* default */].Item, {
|
|
|
name: "new_password",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入8-16位密码,区分大小写、不能使用空格'
|
|
|
}, {
|
|
|
validator: validatePassword
|
|
|
}]
|
|
|
}, /*#__PURE__*/external_window_React_default.a.createElement(input["a" /* default */].Password, {
|
|
|
style: inputStyle,
|
|
|
size: "large",
|
|
|
placeholder: "\u8F93\u51658\uFF5E16\u4F4D\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199",
|
|
|
visibilityToggle: false
|
|
|
})), /*#__PURE__*/external_window_React_default.a.createElement(es_form["a" /* default */].Item, {
|
|
|
name: "new_password_confirmation",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请再次输入新密码'
|
|
|
}, function (_ref3) {
|
|
|
var getFieldValue = _ref3.getFieldValue;
|
|
|
return {
|
|
|
validator: function validator(_, value) {
|
|
|
if (!value || getFieldValue('new_password') === value) {
|
|
|
return Promise.resolve();
|
|
|
}
|
|
|
|
|
|
return Promise.reject('两次密码不一致');
|
|
|
}
|
|
|
};
|
|
|
}]
|
|
|
}, /*#__PURE__*/external_window_React_default.a.createElement(input["a" /* default */].Password, {
|
|
|
style: inputStyle,
|
|
|
size: "large",
|
|
|
placeholder: "\u518D\u6B21\u8F93\u5165\u65B0\u5BC6\u7801",
|
|
|
visibilityToggle: false
|
|
|
})), /*#__PURE__*/external_window_React_default.a.createElement(es_form["a" /* default */].Item, {
|
|
|
name: "code",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入验证码'
|
|
|
}]
|
|
|
}, /*#__PURE__*/external_window_React_default.a.createElement(input["a" /* default */], {
|
|
|
suffix: /*#__PURE__*/external_window_React_default.a.createElement(es_button["a" /* default */], {
|
|
|
loading: codeLoading,
|
|
|
type: "link",
|
|
|
onClick: onGetCode,
|
|
|
disabled: timer > 0
|
|
|
}, " ", timer === 0 ? '获取验证码' : "".concat(timer, "\u79D2\u53EF\u91CD\u65B0\u83B7\u53D6")),
|
|
|
style: {
|
|
|
paddingRight: 2,
|
|
|
height: 48
|
|
|
},
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",
|
|
|
size: "large"
|
|
|
})), /*#__PURE__*/external_window_React_default.a.createElement(es_form["a" /* default */].Item, null, /*#__PURE__*/external_window_React_default.a.createElement(es_button["a" /* default */], {
|
|
|
size: "large",
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
block: true,
|
|
|
style: inputStyle
|
|
|
}, " \u5B8C\u6210 ")), /*#__PURE__*/external_window_React_default.a.createElement(es_form["a" /* default */].Item, {
|
|
|
className: "tc"
|
|
|
}, /*#__PURE__*/external_window_React_default.a.createElement(react_router_dom["a" /* Link */], {
|
|
|
to: "/user/login"
|
|
|
}, "\u8FD4\u56DE\u767B\u5F55")));
|
|
|
});
|
|
|
// EXTERNAL MODULE: ./src/pages/User/Register/service.ts
|
|
|
var service = __webpack_require__("YrPe");
|
|
|
|
|
|
// CONCATENATED MODULE: ./src/pages/User/ResetPassword/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* harmony default export */ var ResetPassword = __webpack_exports__["default"] = (function () {
|
|
|
var panelProps = {
|
|
|
getCode: service["a" /* getValidateCode */],
|
|
|
callback: function () {
|
|
|
var _callback = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/regenerator_default.a.mark(function _callee(values) {
|
|
|
var response;
|
|
|
return regenerator_default.a.wrap(function _callee$(_context) {
|
|
|
while (1) {
|
|
|
switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return Object(service["c" /* resetPassword */])(values);
|
|
|
|
|
|
case 2:
|
|
|
response = _context.sent;
|
|
|
return _context.abrupt("return", response);
|
|
|
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
|
|
|
function callback(_x) {
|
|
|
return _callback.apply(this, arguments);
|
|
|
}
|
|
|
|
|
|
return callback;
|
|
|
}(),
|
|
|
validateName: service["d" /* validateName */]
|
|
|
};
|
|
|
return /*#__PURE__*/external_window_React_default.a.createElement(ResetPasswordPanel, panelProps);
|
|
|
});
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |