|
|
|
|
@ -1,9 +1,9 @@
|
|
|
|
|
"use strict";
|
|
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[27182],{
|
|
|
|
|
|
|
|
|
|
/***/ 69479:
|
|
|
|
|
/***/ 91444:
|
|
|
|
|
/*!************************************************************!*\
|
|
|
|
|
!*** ./src/pages/User/ResetPassword/index.tsx + 2 modules ***!
|
|
|
|
|
!*** ./src/pages/User/ResetPassword/index.tsx + 1 modules ***!
|
|
|
|
|
\************************************************************/
|
|
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
@ -41,9 +41,6 @@ var unlock = __webpack_require__(68666);
|
|
|
|
|
var util = __webpack_require__(49546);
|
|
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts
|
|
|
|
|
var _umi_production_exports = __webpack_require__(63407);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/components/User/ResetPasswordPanel/index.less?modules
|
|
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
/* harmony default export */ var ResetPasswordPanelmodules = ({"wrap":"wrap___jh1g8","formWrapper":"formWrapper___ac7hS","link":"link___eiEQu"});
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
|
|
;// CONCATENATED MODULE: ./src/components/User/ResetPasswordPanel/index.tsx
|
|
|
|
|
@ -58,12 +55,10 @@ var jsx_runtime = __webpack_require__(37712);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var inputStyle = {
|
|
|
|
|
height: 48,
|
|
|
|
|
borderRadius: 4
|
|
|
|
|
height: 40
|
|
|
|
|
};
|
|
|
|
|
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 loginRegex = /(\b[\w\.-]+@[\w\.-]+\.\w{2,4}\b)|([1][3,4,5,6,7,8,9][0-9]{9})/i;
|
|
|
|
|
var initialState = {
|
|
|
|
|
timer: 0,
|
|
|
|
|
verifyCodeMessage: '',
|
|
|
|
|
@ -100,9 +95,6 @@ function reducer(state, action) {
|
|
|
|
|
_ref$style = _ref.style,
|
|
|
|
|
style = _ref$style === void 0 ? {} : _ref$style;
|
|
|
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
|
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
|
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
|
|
|
searchParams = _useSearchParams2[0];
|
|
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
|
|
form = _Form$useForm2[0];
|
|
|
|
|
@ -122,7 +114,7 @@ function reducer(state, action) {
|
|
|
|
|
}
|
|
|
|
|
function _onFinish() {
|
|
|
|
|
_onFinish = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(values) {
|
|
|
|
|
var login, new_password, code, new_password_confirmation, _yield$callback, message, status, from;
|
|
|
|
|
var login, new_password, code, new_password_confirmation, _yield$callback, message, status, _location$query, from;
|
|
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
|
|
case 0:
|
|
|
|
|
@ -138,14 +130,8 @@ function reducer(state, action) {
|
|
|
|
|
_yield$callback = _context.sent;
|
|
|
|
|
message = _yield$callback.message;
|
|
|
|
|
status = _yield$callback.status;
|
|
|
|
|
if (status === 0) {
|
|
|
|
|
if (show) {
|
|
|
|
|
localStorage.setItem('extension-modal', 'exist');
|
|
|
|
|
localStorage.setItem('extension-date', start_date);
|
|
|
|
|
} else {
|
|
|
|
|
localStorage.removeItem('extension-modal');
|
|
|
|
|
}
|
|
|
|
|
from = searchParams.get("from");
|
|
|
|
|
if (status > 0) {
|
|
|
|
|
from = (_location$query = location.query) === null || _location$query === void 0 ? void 0 : _location$query.from;
|
|
|
|
|
if (from && from.indexOf('login') < 0) {
|
|
|
|
|
_umi_production_exports.history.replace(from);
|
|
|
|
|
} else {
|
|
|
|
|
@ -245,17 +231,6 @@ function reducer(state, action) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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();
|
|
|
|
|
@ -273,126 +248,127 @@ function reducer(state, action) {
|
|
|
|
|
}, 1000);
|
|
|
|
|
}
|
|
|
|
|
}, [timer]);
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
|
|
className: ResetPasswordPanelmodules.wrap,
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
|
|
layout: "vertical",
|
|
|
|
|
form: form,
|
|
|
|
|
style: style,
|
|
|
|
|
className: ResetPasswordPanelmodules.formWrapper,
|
|
|
|
|
initialValues: {
|
|
|
|
|
autologin: true,
|
|
|
|
|
protool: true
|
|
|
|
|
},
|
|
|
|
|
onFinish: onFinish,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
name: "login",
|
|
|
|
|
label: "\u8D26\u53F7",
|
|
|
|
|
required: false,
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请输入正确的手机号或邮箱'
|
|
|
|
|
}, {
|
|
|
|
|
validator: LoginValidate
|
|
|
|
|
}],
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
|
|
style: inputStyle,
|
|
|
|
|
size: 'middle',
|
|
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u624B\u673A\u53F7/\u90AE\u7BB1\u53F7",
|
|
|
|
|
onChange: function onChange() {
|
|
|
|
|
return form.setFieldsValue({
|
|
|
|
|
verify: 0
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
name: "verify",
|
|
|
|
|
rules: [{
|
|
|
|
|
validator: verifyValidate
|
|
|
|
|
}],
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(unlock/* default */.Z, {
|
|
|
|
|
onValidate: onValidateName
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
label: "\u5BC6\u7801",
|
|
|
|
|
required: false,
|
|
|
|
|
name: "new_password",
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请输入8-16位密码,区分大小写、不能使用空格'
|
|
|
|
|
}, {
|
|
|
|
|
validator: validatePassword
|
|
|
|
|
}],
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Password, {
|
|
|
|
|
style: inputStyle,
|
|
|
|
|
size: 'middle',
|
|
|
|
|
placeholder: "\u8F93\u51658\uFF5E16\u4F4D\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199",
|
|
|
|
|
visibilityToggle: false
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
name: "new_password_confirmation",
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请再次输入新密码'
|
|
|
|
|
}, function (_ref2) {
|
|
|
|
|
var getFieldValue = _ref2.getFieldValue;
|
|
|
|
|
return {
|
|
|
|
|
validator: function validator(_, value) {
|
|
|
|
|
if (!value || getFieldValue('new_password') === value) {
|
|
|
|
|
return Promise.resolve();
|
|
|
|
|
}
|
|
|
|
|
return Promise.reject('两次密码不一致');
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}],
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Password, {
|
|
|
|
|
style: inputStyle,
|
|
|
|
|
size: 'middle',
|
|
|
|
|
placeholder: "\u518D\u6B21\u8F93\u5165\u65B0\u5BC6\u7801",
|
|
|
|
|
visibilityToggle: false
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
name: "code",
|
|
|
|
|
label: "\u9A8C\u8BC1\u7801",
|
|
|
|
|
required: false,
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请输入验证码'
|
|
|
|
|
}],
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
|
|
suffix: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
|
|
loading: codeLoading,
|
|
|
|
|
type: "link",
|
|
|
|
|
onClick: onGetCode,
|
|
|
|
|
disabled: timer > 0,
|
|
|
|
|
children: [" ", timer === 0 ? '获取验证码' : "".concat(timer, "\u79D2\u53EF\u91CD\u65B0\u83B7\u53D6")]
|
|
|
|
|
}),
|
|
|
|
|
style: {
|
|
|
|
|
paddingRight: 2,
|
|
|
|
|
height: 48,
|
|
|
|
|
borderRadius: 4
|
|
|
|
|
},
|
|
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",
|
|
|
|
|
size: 'middle'
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
|
|
size: 'middle',
|
|
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
|
|
layout: "vertical",
|
|
|
|
|
form: form,
|
|
|
|
|
style: style,
|
|
|
|
|
initialValues: {
|
|
|
|
|
autologin: true,
|
|
|
|
|
protool: true
|
|
|
|
|
},
|
|
|
|
|
onFinish: onFinish,
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
name: "login",
|
|
|
|
|
extra: verifyNameMessage ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
className: "error",
|
|
|
|
|
children: verifyNameMessage
|
|
|
|
|
}) : null,
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请输入有效的手机号/邮箱'
|
|
|
|
|
}, {
|
|
|
|
|
pattern: loginRegex,
|
|
|
|
|
message: '手机号或者邮箱格式有误'
|
|
|
|
|
}],
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
|
|
style: inputStyle,
|
|
|
|
|
size: "large",
|
|
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u624B\u673A\u53F7/\u90AE\u7BB1\u53F7",
|
|
|
|
|
onChange: onResetVerify
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
name: "verify",
|
|
|
|
|
rules: [{
|
|
|
|
|
validator: function validator(_, value) {
|
|
|
|
|
return value ? Promise.resolve() : Promise.reject('请拖动滑块验证');
|
|
|
|
|
}
|
|
|
|
|
}],
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(unlock/* default */.Z, {
|
|
|
|
|
onValidate: onValidateName
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
extra: verifyCodeMessage ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
|
|
className: "error",
|
|
|
|
|
children: verifyCodeMessage
|
|
|
|
|
}) : null,
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
|
|
className: "flex-container",
|
|
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
name: "code",
|
|
|
|
|
noStyle: true,
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请输入验证码'
|
|
|
|
|
}],
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
|
|
style: {
|
|
|
|
|
width: 'calc(100% - 100px)',
|
|
|
|
|
height: 40,
|
|
|
|
|
marginRight: 6
|
|
|
|
|
},
|
|
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",
|
|
|
|
|
size: "large"
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
|
|
size: "large",
|
|
|
|
|
type: "primary",
|
|
|
|
|
htmlType: "submit",
|
|
|
|
|
block: true,
|
|
|
|
|
style: inputStyle,
|
|
|
|
|
children: " \u5B8C\u6210 "
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
className: "tc",
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
|
|
className: "font14",
|
|
|
|
|
to: "/user/login",
|
|
|
|
|
children: "\u8FD4\u56DE\u767B\u5F55"
|
|
|
|
|
})
|
|
|
|
|
})]
|
|
|
|
|
})
|
|
|
|
|
onClick: onGetCode,
|
|
|
|
|
disabled: timer > 0,
|
|
|
|
|
children: [' ', timer === 0 ? '获取验证码' : "\u91CD\u65B0\u53D1\u9001".concat(timer, "s")]
|
|
|
|
|
})]
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
name: "new_password",
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请输入密码'
|
|
|
|
|
}, {
|
|
|
|
|
validator: validatePassword
|
|
|
|
|
}],
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Password, {
|
|
|
|
|
style: inputStyle,
|
|
|
|
|
size: "large",
|
|
|
|
|
placeholder: "\u8F93\u51658\uFF5E16\u4F4D\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199",
|
|
|
|
|
visibilityToggle: false
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
name: "new_password_confirmation",
|
|
|
|
|
rules: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请再次输入新密码'
|
|
|
|
|
}, function (_ref2) {
|
|
|
|
|
var getFieldValue = _ref2.getFieldValue;
|
|
|
|
|
return {
|
|
|
|
|
validator: function validator(_, value) {
|
|
|
|
|
if (!value || getFieldValue('new_password') === value) {
|
|
|
|
|
return Promise.resolve();
|
|
|
|
|
}
|
|
|
|
|
return Promise.reject('两次密码不一致');
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}],
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Password, {
|
|
|
|
|
style: inputStyle,
|
|
|
|
|
size: "large",
|
|
|
|
|
placeholder: "\u518D\u6B21\u8F93\u5165\u65B0\u5BC6\u7801",
|
|
|
|
|
visibilityToggle: false
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
|
|
size: "large",
|
|
|
|
|
type: "primary",
|
|
|
|
|
htmlType: "submit",
|
|
|
|
|
block: true,
|
|
|
|
|
style: inputStyle,
|
|
|
|
|
children: [' ', "\u5B8C\u6210", ' ']
|
|
|
|
|
})
|
|
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
|
|
to: "/user/login",
|
|
|
|
|
children: "\u8FD4\u56DE\u767B\u5F55"
|
|
|
|
|
})
|
|
|
|
|
})]
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
// EXTERNAL MODULE: ./src/pages/User/Register/service.ts
|
|
|
|
|
|