|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[41717],{
|
|
|
|
|
|
/***/ 80045:
|
|
|
/*!*******************************************************************************************************************!*\
|
|
|
!*** ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ExclamationCircleOutlined.js + 1 modules ***!
|
|
|
\*******************************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ icons_ExclamationCircleOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(26508);
|
|
|
// 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.3.1@@ant-design/icons-svg/es/asn/ExclamationCircleOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var ExclamationCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { "tag": "path", "attrs": { "d": "M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" } }] }, "name": "exclamation-circle", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_ExclamationCircleOutlined = (ExclamationCircleOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/components/AntdIcon.js + 3 modules
|
|
|
var AntdIcon = __webpack_require__(91851);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/ExclamationCircleOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ExclamationCircleOutlined_ExclamationCircleOutlined = function ExclamationCircleOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_ExclamationCircleOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_ExclamationCircleOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(ExclamationCircleOutlined_ExclamationCircleOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 90897:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./src/layouts/index.tsx + 18 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 */ layouts; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(10574);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectSpread2.js
|
|
|
var objectSpread2 = __webpack_require__(26801);
|
|
|
var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(39343);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectWithoutProperties.js
|
|
|
var objectWithoutProperties = __webpack_require__(27161);
|
|
|
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: ./node_modules/_antd@5.9.0@antd/es/config-provider/index.js + 5 modules
|
|
|
var config_provider = __webpack_require__(92736);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
|
var modal = __webpack_require__(43418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/locale/zh_CN.js + 4 modules
|
|
|
var zh_CN = __webpack_require__(81863);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 8 modules
|
|
|
var _umi_production_exports = __webpack_require__(7181);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(11006);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// 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 + 5 modules
|
|
|
var input = __webpack_require__(1056);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules
|
|
|
var es_checkbox = __webpack_require__(24905);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./src/service/user.ts
|
|
|
var service_user = __webpack_require__(43916);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/CloseOutlined.js + 1 modules
|
|
|
var CloseOutlined = __webpack_require__(99174);
|
|
|
// EXTERNAL MODULE: ./src/components/User/UnlockLogin/index.tsx
|
|
|
var UnlockLogin = __webpack_require__(13430);
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/LoginPanel/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var LoginPanelmodules = ({"login-panel-wrapper2":"login-panel-wrapper2___HuMNJ","ant-form-item-explain":"ant-form-item-explain___c1FeE","ant-form-item":"ant-form-item___qb60e","ant-form-item-with-help":"ant-form-item-with-help___NeAwJ","login-panel-right-wrp":"login-panel-right-wrp___vWD_i","res-error-values":"res-error-values___hV1lz","tabs":"tabs___EwOAX"});
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/LoginPanel/LoginForm.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var inputStyle = {
|
|
|
height: 48,
|
|
|
borderRadius: 4
|
|
|
};
|
|
|
var LoginPopComponents = function LoginPopComponents(_ref) {
|
|
|
var dispatch = _ref.dispatch,
|
|
|
setType = _ref.setType,
|
|
|
user = _ref.user,
|
|
|
setusername = _ref.setusername;
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
|
searchParams = _useSearchParams2[0];
|
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
errorValue = _useState2[0],
|
|
|
setErrorValue = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
errorData = _useState4[0],
|
|
|
setErrorData = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)({}),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
formValue = _useState6[0],
|
|
|
setFormValue = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
openUnlockLogin = _useState8[0],
|
|
|
setOpenUnlockLogin = _useState8[1];
|
|
|
var password = /^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{8,16}$/;
|
|
|
var onFinish = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(values) {
|
|
|
var res, from;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
setOpenUnlockLogin(false);
|
|
|
if (!password.test(values.password)) {
|
|
|
setusername(values.login);
|
|
|
setErrorValue('系统检测您的密码强度过低,请及时修改');
|
|
|
// return
|
|
|
}
|
|
|
|
|
|
setFormValue(objectSpread2_default()({}, values));
|
|
|
_context.next = 5;
|
|
|
return (0,service_user/* LoginIn */.Es)(values);
|
|
|
case 5:
|
|
|
res = _context.sent;
|
|
|
if (!res.status) {
|
|
|
_context.next = 19;
|
|
|
break;
|
|
|
}
|
|
|
if (!(res.status === -4)) {
|
|
|
_context.next = 13;
|
|
|
break;
|
|
|
}
|
|
|
dispatch({
|
|
|
type: 'user/showPopLogin',
|
|
|
payload: {
|
|
|
showPopLogin: false
|
|
|
}
|
|
|
});
|
|
|
dispatch({
|
|
|
type: 'user/setBindAccountModal',
|
|
|
payload: {
|
|
|
bindAccountModalVisible: true,
|
|
|
userInfoForBindAccountModal: res.user,
|
|
|
loginInfo: values
|
|
|
}
|
|
|
});
|
|
|
return _context.abrupt("return");
|
|
|
case 13:
|
|
|
if (!(res.status === -5)) {
|
|
|
_context.next = 17;
|
|
|
break;
|
|
|
}
|
|
|
setErrorData([res === null || res === void 0 ? void 0 : res.message]);
|
|
|
setOpenUnlockLogin(true);
|
|
|
return _context.abrupt("return");
|
|
|
case 17:
|
|
|
setErrorValue(res === null || res === void 0 ? void 0 : res.message);
|
|
|
return _context.abrupt("return");
|
|
|
case 19:
|
|
|
if (res !== null && res !== void 0 && res.show) {
|
|
|
localStorage.setItem('extension-modal', 'exist');
|
|
|
localStorage.setItem('extension-date', res === null || res === void 0 ? void 0 : res.start_date);
|
|
|
} else {
|
|
|
localStorage.removeItem('extension-modal');
|
|
|
}
|
|
|
if (!(location.pathname === '/user/login' || location.pathname === '/login')) {
|
|
|
_context.next = 35;
|
|
|
break;
|
|
|
}
|
|
|
from = searchParams.get("form") || searchParams.get("back_url");
|
|
|
if (!from) {
|
|
|
_context.next = 26;
|
|
|
break;
|
|
|
}
|
|
|
window.location.href = decodeURIComponent(from);
|
|
|
_context.next = 33;
|
|
|
break;
|
|
|
case 26:
|
|
|
if (password.test(values.password)) {
|
|
|
_context.next = 31;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('系统检测您的密码强度过低,请及时修改');
|
|
|
window.location.href = '/account/secure';
|
|
|
_context.next = 33;
|
|
|
break;
|
|
|
case 31:
|
|
|
window.location.reload();
|
|
|
return _context.abrupt("return");
|
|
|
case 33:
|
|
|
_context.next = 43;
|
|
|
break;
|
|
|
case 35:
|
|
|
if (password.test(values.password)) {
|
|
|
_context.next = 41;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('系统检测您的密码强度过低,请及时修改');
|
|
|
window.location.href = '/account/secure?active=3';
|
|
|
dispatch({
|
|
|
type: 'user/showPopLogin',
|
|
|
payload: {
|
|
|
showPopLogin: false
|
|
|
}
|
|
|
});
|
|
|
_context.next = 43;
|
|
|
break;
|
|
|
case 41:
|
|
|
window.location.reload();
|
|
|
return _context.abrupt("return");
|
|
|
case 43:
|
|
|
form.resetFields();
|
|
|
case 44:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function onFinish(_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleClick = function handleClick() {
|
|
|
dispatch({
|
|
|
type: 'user/showPopLogin',
|
|
|
payload: {
|
|
|
showPopLogin: false
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
layout: "vertical",
|
|
|
form: form,
|
|
|
initialValues: {
|
|
|
autologin: true,
|
|
|
login: user.actionTabs.phone
|
|
|
},
|
|
|
onFinish: onFinish,
|
|
|
onValuesChange: function onValuesChange(changedValues) {
|
|
|
setErrorValue('');
|
|
|
var chineseRegex = /[\u4e00-\u9fa5]/g; // 中文字符的正则表达式
|
|
|
if ('password' in changedValues) {
|
|
|
var _password = changedValues.password.replace(chineseRegex, ''); // 将中文字符替换为空字符串
|
|
|
form.setFieldsValue({
|
|
|
password: _password
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
children: [!!errorValue && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: LoginPanelmodules['res-error-values'],
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: errorValue
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(CloseOutlined/* default */.Z, {
|
|
|
onClick: function onClick() {
|
|
|
return setErrorValue('');
|
|
|
}
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "login",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入用户名、手机号或邮箱'
|
|
|
}],
|
|
|
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/\u8D26\u53F7",
|
|
|
onBlur: function onBlur() {
|
|
|
dispatch({
|
|
|
type: 'user/setActionTabs',
|
|
|
payload: {
|
|
|
phone: form.getFieldValue("login")
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "password",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入8-16位密码,区分大小写、不能使用空格'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Password, {
|
|
|
style: inputStyle
|
|
|
// visibilityToggle={false}
|
|
|
,
|
|
|
size: 'middle',
|
|
|
placeholder: "\u5BC6\u7801"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "flex-container",
|
|
|
style: {
|
|
|
justifyContent: 'space-between'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "autologin",
|
|
|
noStyle: true,
|
|
|
valuePropName: "checked",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
children: "\u4E0B\u6B21\u81EA\u52A8\u767B\u5F55"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "current font14 c-blue",
|
|
|
onClick: function onClick() {
|
|
|
return setType(4);
|
|
|
},
|
|
|
children: "\u627E\u56DE\u5BC6\u7801"
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
size: 'middle',
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
block: true,
|
|
|
className: "font16",
|
|
|
style: inputStyle,
|
|
|
children: "\u767B\u5F55"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc",
|
|
|
style: {
|
|
|
paddingTop: 0,
|
|
|
paddingBottom: 20
|
|
|
},
|
|
|
children: ["\u767B\u5F55\u5373\u4EE3\u8868\u60A8\u5DF2\u9605\u8BFB\u5E76\u540C\u610F", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "https://engineer.educoder.net/help?index=4",
|
|
|
target: "_blank",
|
|
|
children: "\u300A\u670D\u52A1\u534F\u8BAE\u6761\u6B3E\u300B"
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(UnlockLogin/* default */.Z, {
|
|
|
open: openUnlockLogin,
|
|
|
data: errorData,
|
|
|
accountInfo: objectSpread2_default()({}, formValue)
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var LoginForm = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
|
var user = _ref3.user,
|
|
|
loading = _ref3.loading,
|
|
|
globalSetting = _ref3.globalSetting;
|
|
|
return {
|
|
|
user: user,
|
|
|
globalSetting: globalSetting,
|
|
|
loading: loading.models.index
|
|
|
};
|
|
|
})(LoginPopComponents));
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(87885);
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/LoginSmsPanel/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var LoginSmsPanel_inputStyle = {
|
|
|
height: 48,
|
|
|
borderRadius: 4
|
|
|
};
|
|
|
var loginRegex = /(^(1[0-9])\d{9}$)/i;
|
|
|
var initialState = {
|
|
|
timer: 0
|
|
|
};
|
|
|
var Types = /*#__PURE__*/function (Types) {
|
|
|
Types[Types["setTimer"] = 0] = "setTimer";
|
|
|
return Types;
|
|
|
}(Types || {});
|
|
|
function reducer(state, action) {
|
|
|
switch (action.type) {
|
|
|
case Types.setTimer:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
timer: action.payload
|
|
|
});
|
|
|
default:
|
|
|
throw new Error();
|
|
|
}
|
|
|
}
|
|
|
var RegisterComponent = function RegisterComponent(_ref) {
|
|
|
var _globalSetting$settin;
|
|
|
var user = _ref.user,
|
|
|
dispatch = _ref.dispatch,
|
|
|
validateName = _ref.validateName,
|
|
|
getCode = _ref.getCode,
|
|
|
register = _ref.register,
|
|
|
_ref$style = _ref.style,
|
|
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
|
_ref$buttonText = _ref.buttonText,
|
|
|
buttonText = _ref$buttonText === void 0 ? '注册' : _ref$buttonText,
|
|
|
globalSetting = _ref.globalSetting;
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useReducer = (0,_react_17_0_2_react.useReducer)(reducer, initialState),
|
|
|
_useReducer2 = slicedToArray_default()(_useReducer, 2),
|
|
|
state = _useReducer2[0],
|
|
|
dispatchs = _useReducer2[1];
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
codeLoading = _useState2[0],
|
|
|
setCodeLoading = _useState2[1];
|
|
|
var timer = state.timer;
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
isdisabled = _useState4[0],
|
|
|
setisdisabled = _useState4[1];
|
|
|
console.log("dispatchs:", dispatchs);
|
|
|
function onFinish(_x) {
|
|
|
return _onFinish.apply(this, arguments);
|
|
|
}
|
|
|
function _onFinish() {
|
|
|
_onFinish = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(values) {
|
|
|
var login, password, code, _yield$register, message, status;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
login = values.login, password = values.password, code = values.code;
|
|
|
_context2.next = 3;
|
|
|
return register({
|
|
|
login: login,
|
|
|
code: code
|
|
|
});
|
|
|
case 3:
|
|
|
_yield$register = _context2.sent;
|
|
|
message = _yield$register.message;
|
|
|
status = _yield$register.status;
|
|
|
if (!(status < 0)) {
|
|
|
_context2.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
form.setFields([{
|
|
|
name: 'code',
|
|
|
errors: [message]
|
|
|
}]);
|
|
|
return _context2.abrupt("return");
|
|
|
case 9:
|
|
|
window.location.reload();
|
|
|
// antdMessage.info('注册成功')
|
|
|
// history.replace('/')
|
|
|
case 10:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return _onFinish.apply(this, arguments);
|
|
|
}
|
|
|
function onValidateName() {
|
|
|
return _onValidateName.apply(this, arguments);
|
|
|
}
|
|
|
function _onValidateName() {
|
|
|
_onValidateName = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
var login, flag, _yield$validateName, status, message, isOk;
|
|
|
return regeneratorRuntime_default()().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: 1
|
|
|
});
|
|
|
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: ["该手机号码不存在,请先注册"]
|
|
|
}]);
|
|
|
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 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var login, res, _yield$getCode, status, message;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
login = form.getFieldValue('login');
|
|
|
if (loginRegex.test(login)) {
|
|
|
_context.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
form.validateFields(['login']);
|
|
|
_context.next = 20;
|
|
|
break;
|
|
|
case 5:
|
|
|
_context.next = 7;
|
|
|
return validateName({
|
|
|
login: login,
|
|
|
type: 1
|
|
|
});
|
|
|
case 7:
|
|
|
res = _context.sent;
|
|
|
if (!((res === null || res === void 0 ? void 0 : res.status) > 0)) {
|
|
|
_context.next = 11;
|
|
|
break;
|
|
|
}
|
|
|
form.setFields([{
|
|
|
name: 'login',
|
|
|
errors: ["该手机号码不存在,请先注册"]
|
|
|
}]);
|
|
|
return _context.abrupt("return");
|
|
|
case 11:
|
|
|
setCodeLoading(true);
|
|
|
_context.next = 14;
|
|
|
return getCode({
|
|
|
login: login,
|
|
|
type: 6,
|
|
|
smscode: (0,util/* setmiyah */.M)(login)
|
|
|
});
|
|
|
case 14:
|
|
|
_yield$getCode = _context.sent;
|
|
|
status = _yield$getCode.status;
|
|
|
message = _yield$getCode.message;
|
|
|
if (status < 0) {
|
|
|
form.setFields([{
|
|
|
name: 'code',
|
|
|
errors: [message]
|
|
|
}]);
|
|
|
}
|
|
|
dispatchs({
|
|
|
type: Types.setTimer,
|
|
|
payload: 60
|
|
|
});
|
|
|
setCodeLoading(false);
|
|
|
case 20:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function onGetCode() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
function validatePassword(_, value) {
|
|
|
if (!value) {
|
|
|
return Promise.resolve();
|
|
|
}
|
|
|
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位密码,区分大小写、不能使用空格');
|
|
|
}
|
|
|
}
|
|
|
var verifyValidate = function verifyValidate(_, value) {
|
|
|
return value ? Promise.resolve() : Promise.reject('请拖动滑块验证');
|
|
|
};
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (timer > 0) {
|
|
|
setTimeout(function () {
|
|
|
dispatchs({
|
|
|
type: Types.setTimer,
|
|
|
payload: timer - 1
|
|
|
});
|
|
|
}, 1000);
|
|
|
}
|
|
|
}, [timer]);
|
|
|
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__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
layout: "vertical",
|
|
|
form: form,
|
|
|
style: style,
|
|
|
initialValues: {
|
|
|
autologin: true,
|
|
|
protool: false,
|
|
|
login: user.actionTabs.phone
|
|
|
},
|
|
|
onFinish: onFinish,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "login",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入正确的手机号'
|
|
|
}, {
|
|
|
validator: LoginValidate
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
style: LoginSmsPanel_inputStyle,
|
|
|
autoComplete: "new-login",
|
|
|
size: 'middle',
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u624B\u673A\u53F7",
|
|
|
maxLength: 11,
|
|
|
onBlur: function onBlur() {
|
|
|
onValidateName();
|
|
|
dispatch({
|
|
|
type: 'user/setActionTabs',
|
|
|
payload: {
|
|
|
phone: form.getFieldValue("login")
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
onChange: function onChange() {
|
|
|
return form.setFieldsValue({
|
|
|
verify: 0
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
}), !(globalSetting !== null && globalSetting !== void 0 && (_globalSetting$settin = globalSetting.setting) !== null && _globalSetting$settin !== void 0 && _globalSetting$settin.is_local) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "code",
|
|
|
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 || isdisabled,
|
|
|
children: [" ", timer === 0 ? '获取验证码' : "".concat(timer, "\u79D2\u53EF\u91CD\u65B0\u83B7\u53D6")]
|
|
|
}),
|
|
|
style: {
|
|
|
paddingRight: 2,
|
|
|
height: 48
|
|
|
},
|
|
|
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)("div", {
|
|
|
className: "flex-container",
|
|
|
style: {
|
|
|
justifyContent: 'space-between'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "autologin",
|
|
|
noStyle: true,
|
|
|
valuePropName: "checked",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
children: "\u4E0B\u6B21\u81EA\u52A8\u767B\u5F55"
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
size: 'middle',
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
block: true,
|
|
|
style: LoginSmsPanel_inputStyle,
|
|
|
className: "font16",
|
|
|
children: [" ", buttonText, " "]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc",
|
|
|
style: {
|
|
|
paddingTop: 0,
|
|
|
paddingBottom: 20
|
|
|
},
|
|
|
children: ["\u767B\u5F55\u5373\u4EE3\u8868\u60A8\u5DF2\u9605\u8BFB\u5E76\u540C\u610F", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "https://engineer.educoder.net/help?index=4",
|
|
|
target: "_blank",
|
|
|
children: "\u300A\u670D\u52A1\u534F\u8BAE\u6761\u6B3E\u300B"
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var LoginSmsPanel = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
|
var globalSetting = _ref3.globalSetting,
|
|
|
user = _ref3.user;
|
|
|
return {
|
|
|
globalSetting: globalSetting,
|
|
|
user: user
|
|
|
};
|
|
|
})(RegisterComponent));
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(6848);
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/RegisterPanel/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var RegisterPanel_inputStyle = {
|
|
|
height: 48
|
|
|
};
|
|
|
var RegisterPanel_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 RegisterPanel_password = /^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{8,16}$/;
|
|
|
var RegisterPanel_initialState = {
|
|
|
timer: 0
|
|
|
};
|
|
|
var RegisterPanel_Types = /*#__PURE__*/function (Types) {
|
|
|
Types[Types["setTimer"] = 0] = "setTimer";
|
|
|
return Types;
|
|
|
}(RegisterPanel_Types || {});
|
|
|
function RegisterPanel_reducer(state, action) {
|
|
|
switch (action.type) {
|
|
|
case RegisterPanel_Types.setTimer:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
timer: action.payload
|
|
|
});
|
|
|
default:
|
|
|
throw new Error();
|
|
|
}
|
|
|
}
|
|
|
var RegisterPanel_RegisterComponent = function RegisterComponent(_ref) {
|
|
|
var _globalSetting$settin;
|
|
|
var validateName = _ref.validateName,
|
|
|
getCode = _ref.getCode,
|
|
|
register = _ref.register,
|
|
|
_ref$style = _ref.style,
|
|
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
|
_ref$buttonText = _ref.buttonText,
|
|
|
buttonText = _ref$buttonText === void 0 ? '注册' : _ref$buttonText,
|
|
|
globalSetting = _ref.globalSetting;
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useReducer = (0,_react_17_0_2_react.useReducer)(RegisterPanel_reducer, RegisterPanel_initialState),
|
|
|
_useReducer2 = slicedToArray_default()(_useReducer, 2),
|
|
|
state = _useReducer2[0],
|
|
|
dispatch = _useReducer2[1];
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
codeLoading = _useState2[0],
|
|
|
setCodeLoading = _useState2[1];
|
|
|
var timer = state.timer;
|
|
|
function onFinish(_x) {
|
|
|
return _onFinish.apply(this, arguments);
|
|
|
}
|
|
|
function _onFinish() {
|
|
|
_onFinish = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(values) {
|
|
|
var login, password, code, _yield$register, message, status;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
login = values.login, password = values.password, code = values.code;
|
|
|
_context2.next = 3;
|
|
|
return register({
|
|
|
login: login,
|
|
|
password: password,
|
|
|
code: code
|
|
|
});
|
|
|
case 3:
|
|
|
_yield$register = _context2.sent;
|
|
|
message = _yield$register.message;
|
|
|
status = _yield$register.status;
|
|
|
if (!(status < 0)) {
|
|
|
_context2.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
form.setFields([{
|
|
|
name: 'code',
|
|
|
errors: [message]
|
|
|
}]);
|
|
|
return _context2.abrupt("return");
|
|
|
case 9:
|
|
|
// antdMessage.info('注册成功')
|
|
|
// history.replace('/')
|
|
|
window.location.reload();
|
|
|
case 10:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return _onFinish.apply(this, arguments);
|
|
|
}
|
|
|
function onValidateName() {
|
|
|
return _onValidateName.apply(this, arguments);
|
|
|
}
|
|
|
function _onValidateName() {
|
|
|
_onValidateName = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
var login, flag, _yield$validateName, status, message, isOk;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
login = form.getFieldValue('login');
|
|
|
flag = 0;
|
|
|
if (!(!RegisterPanel_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: 1
|
|
|
});
|
|
|
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 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var verify, login, res, _yield$getCode, status, message;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
verify = form.getFieldValue('verify');
|
|
|
login = form.getFieldValue('login');
|
|
|
if (login) {
|
|
|
_context.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
form.validateFields(['login']);
|
|
|
_context.next = 21;
|
|
|
break;
|
|
|
case 6:
|
|
|
_context.next = 8;
|
|
|
return validateName({
|
|
|
login: login,
|
|
|
type: 1
|
|
|
});
|
|
|
case 8:
|
|
|
res = _context.sent;
|
|
|
if (!((res === null || res === void 0 ? void 0 : res.status) !== 1)) {
|
|
|
_context.next = 12;
|
|
|
break;
|
|
|
}
|
|
|
form.setFields([{
|
|
|
name: 'login',
|
|
|
errors: [res === null || res === void 0 ? void 0 : res.message]
|
|
|
}]);
|
|
|
return _context.abrupt("return");
|
|
|
case 12:
|
|
|
setCodeLoading(true);
|
|
|
_context.next = 15;
|
|
|
return getCode({
|
|
|
login: login,
|
|
|
type: 1,
|
|
|
smscode: (0,util/* setmiyah */.M)(login)
|
|
|
});
|
|
|
case 15:
|
|
|
_yield$getCode = _context.sent;
|
|
|
status = _yield$getCode.status;
|
|
|
message = _yield$getCode.message;
|
|
|
if (status < 0) {
|
|
|
form.setFields([{
|
|
|
name: 'code',
|
|
|
errors: [message]
|
|
|
}]);
|
|
|
}
|
|
|
dispatch({
|
|
|
type: RegisterPanel_Types.setTimer,
|
|
|
payload: 60
|
|
|
});
|
|
|
setCodeLoading(false);
|
|
|
case 21:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function onGetCode() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
function validatePassword(_, value) {
|
|
|
if (!value) {
|
|
|
return Promise.resolve();
|
|
|
}
|
|
|
if (!RegisterPanel_password.test(value)) {
|
|
|
return Promise.reject('请输入8~16位字符,字母、数字和特殊符号至少包含2种');
|
|
|
}
|
|
|
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位密码,区分大小写、不能使用空格');
|
|
|
}
|
|
|
}
|
|
|
var verifyValidate = function verifyValidate(_, value) {
|
|
|
return value ? Promise.resolve() : Promise.reject('请拖动滑块验证');
|
|
|
};
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (timer > 0) {
|
|
|
setTimeout(function () {
|
|
|
dispatch({
|
|
|
type: RegisterPanel_Types.setTimer,
|
|
|
payload: timer - 1
|
|
|
});
|
|
|
}, 1000);
|
|
|
}
|
|
|
}, [timer]);
|
|
|
var LoginValidate = function LoginValidate(_, value) {
|
|
|
if (!value) {
|
|
|
return Promise.resolve();
|
|
|
}
|
|
|
if (value.indexOf(" ") > -1) {
|
|
|
return Promise.reject('请输入正确的手机号或邮箱');
|
|
|
}
|
|
|
if (RegisterPanel_loginRegex.test(value)) {
|
|
|
return Promise.resolve();
|
|
|
} else {
|
|
|
return Promise.reject('请输入正确的手机号或邮箱');
|
|
|
}
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
layout: "vertical",
|
|
|
form: form,
|
|
|
style: style,
|
|
|
initialValues: {
|
|
|
autologin: true,
|
|
|
protool: false
|
|
|
},
|
|
|
onFinish: onFinish,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "login",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入正确的手机号或邮箱'
|
|
|
}, {
|
|
|
validator: LoginValidate
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
style: RegisterPanel_inputStyle,
|
|
|
autoComplete: "new-login",
|
|
|
size: 'middle',
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u624B\u673A\u53F7/\u90AE\u7BB1\u53F7",
|
|
|
onBlur: function onBlur() {
|
|
|
return onValidateName;
|
|
|
},
|
|
|
onChange: function onChange() {
|
|
|
return form.setFieldsValue({
|
|
|
verify: 0
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
}), !(globalSetting !== null && globalSetting !== void 0 && (_globalSetting$settin = globalSetting.setting) !== null && _globalSetting$settin !== void 0 && _globalSetting$settin.is_local) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "code",
|
|
|
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
|
|
|
},
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",
|
|
|
size: 'middle'
|
|
|
})
|
|
|
}), /*#__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: "topRight",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "password",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入8-16位密码,区分大小写、不能使用空格'
|
|
|
}, {
|
|
|
validator: validatePassword
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Password, {
|
|
|
autoComplete: "new-password",
|
|
|
style: RegisterPanel_inputStyle,
|
|
|
size: "middle",
|
|
|
placeholder: "\u8BF7\u8F93\u51658~16\u4F4D\u5B57\u7B26\uFF0C\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u7279\u6B8A\u7B26\u53F7\u81F3\u5C11\u5305\u542B2\u79CD"
|
|
|
// visibilityToggle={false}
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
size: 'middle',
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
block: true,
|
|
|
style: RegisterPanel_inputStyle,
|
|
|
className: "font16",
|
|
|
children: [" ", buttonText, " "]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc",
|
|
|
style: {
|
|
|
paddingTop: 0,
|
|
|
paddingBottom: 35
|
|
|
},
|
|
|
children: ["\u6CE8\u518C\u5E76\u767B\u5F55\u5373\u4EE3\u8868\u60A8\u5DF2\u9605\u8BFB\u5E76\u540C\u610F", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "https://engineer.educoder.net/help?index=4",
|
|
|
target: "_blank",
|
|
|
children: "\u300A\u670D\u52A1\u534F\u8BAE\u6761\u6B3E\u300B"
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var RegisterPanel = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
|
var globalSetting = _ref3.globalSetting;
|
|
|
return {
|
|
|
globalSetting: globalSetting
|
|
|
};
|
|
|
})(RegisterPanel_RegisterComponent));
|
|
|
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
|
|
|
var lodash = __webpack_require__(89392);
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/ResetPassword/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ResetPassword_inputStyle = {
|
|
|
height: 48
|
|
|
};
|
|
|
var ResetPassword_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 ResetPassword_password = /^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{8,16}$/;
|
|
|
var ResetPassword_initialState = {
|
|
|
timer: 0
|
|
|
};
|
|
|
var ResetPassword_Types = /*#__PURE__*/function (Types) {
|
|
|
Types[Types["setTimer"] = 0] = "setTimer";
|
|
|
return Types;
|
|
|
}(ResetPassword_Types || {});
|
|
|
function ResetPassword_reducer(state, action) {
|
|
|
switch (action.type) {
|
|
|
case ResetPassword_Types.setTimer:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
timer: action.payload
|
|
|
});
|
|
|
default:
|
|
|
throw new Error();
|
|
|
}
|
|
|
}
|
|
|
var ResetPassword_RegisterComponent = function RegisterComponent(_ref) {
|
|
|
var _globalSetting$settin;
|
|
|
var validateName = _ref.validateName,
|
|
|
getCode = _ref.getCode,
|
|
|
register = _ref.register,
|
|
|
_ref$style = _ref.style,
|
|
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
|
_ref$buttonText = _ref.buttonText,
|
|
|
buttonText = _ref$buttonText === void 0 ? '注册' : _ref$buttonText,
|
|
|
globalSetting = _ref.globalSetting;
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useReducer = (0,_react_17_0_2_react.useReducer)(ResetPassword_reducer, ResetPassword_initialState),
|
|
|
_useReducer2 = slicedToArray_default()(_useReducer, 2),
|
|
|
state = _useReducer2[0],
|
|
|
dispatch = _useReducer2[1];
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
codeLoading = _useState2[0],
|
|
|
setCodeLoading = _useState2[1];
|
|
|
var timer = state.timer;
|
|
|
function onFinish(_x) {
|
|
|
return _onFinish.apply(this, arguments);
|
|
|
}
|
|
|
function _onFinish() {
|
|
|
_onFinish = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(values) {
|
|
|
var login, new_password, code, _yield$register, message, status;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
login = values.login, new_password = values.new_password, code = values.code;
|
|
|
_context3.next = 3;
|
|
|
return register({
|
|
|
login: login,
|
|
|
new_password: new_password,
|
|
|
code: code
|
|
|
});
|
|
|
case 3:
|
|
|
_yield$register = _context3.sent;
|
|
|
message = _yield$register.message;
|
|
|
status = _yield$register.status;
|
|
|
if (!(status < 0)) {
|
|
|
_context3.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
form.setFields([{
|
|
|
name: 'code',
|
|
|
errors: [message]
|
|
|
}]);
|
|
|
return _context3.abrupt("return");
|
|
|
case 9:
|
|
|
location.reload();
|
|
|
// history.replace('/')
|
|
|
case 10:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return _onFinish.apply(this, arguments);
|
|
|
}
|
|
|
function onValidateName() {
|
|
|
return _onValidateName.apply(this, arguments);
|
|
|
}
|
|
|
function _onValidateName() {
|
|
|
_onValidateName = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
var login, flag, _yield$validateName2, status, message, isOk;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
login = form.getFieldValue('login');
|
|
|
flag = 0;
|
|
|
if (!(!ResetPassword_loginRegex.test(login) || login.indexOf(" ") > -1)) {
|
|
|
_context4.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
form.setFields([{
|
|
|
name: 'login',
|
|
|
errors: ['请输入正确的手机号或邮箱']
|
|
|
}]);
|
|
|
flag = 1;
|
|
|
return _context4.abrupt("return", flag);
|
|
|
case 6:
|
|
|
_context4.next = 8;
|
|
|
return validateName({
|
|
|
login: login,
|
|
|
type: 2
|
|
|
});
|
|
|
case 8:
|
|
|
_yield$validateName2 = _context4.sent;
|
|
|
status = _yield$validateName2.status;
|
|
|
message = _yield$validateName2.message;
|
|
|
isOk = status > 0;
|
|
|
if (isOk) {
|
|
|
flag = 2;
|
|
|
} else {
|
|
|
form.setFields([{
|
|
|
name: 'login',
|
|
|
errors: [message]
|
|
|
}]);
|
|
|
flag = 1;
|
|
|
}
|
|
|
return _context4.abrupt("return", flag);
|
|
|
case 14:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
return _onValidateName.apply(this, arguments);
|
|
|
}
|
|
|
var onGetCode = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var verify, login, _yield$getCode, status, message;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
verify = form.getFieldValue('verify');
|
|
|
login = form.getFieldValue('login');
|
|
|
_context.next = 4;
|
|
|
return form.validateFields(['login']);
|
|
|
case 4:
|
|
|
if (login) {
|
|
|
_context.next = 8;
|
|
|
break;
|
|
|
}
|
|
|
form.validateFields(['login']);
|
|
|
_context.next = 17;
|
|
|
break;
|
|
|
case 8:
|
|
|
setCodeLoading(true);
|
|
|
_context.next = 11;
|
|
|
return getCode({
|
|
|
login: login,
|
|
|
type: 2,
|
|
|
smscode: (0,util/* setmiyah */.M)(login)
|
|
|
});
|
|
|
case 11:
|
|
|
_yield$getCode = _context.sent;
|
|
|
status = _yield$getCode.status;
|
|
|
message = _yield$getCode.message;
|
|
|
if (status < 0) {
|
|
|
form.setFields([{
|
|
|
name: 'code',
|
|
|
errors: [message]
|
|
|
}]);
|
|
|
}
|
|
|
dispatch({
|
|
|
type: ResetPassword_Types.setTimer,
|
|
|
payload: 60
|
|
|
});
|
|
|
setCodeLoading(false);
|
|
|
case 17:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function onGetCode() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
function validatePassword(_, value) {
|
|
|
if (!value) {
|
|
|
return Promise.resolve();
|
|
|
}
|
|
|
if (!ResetPassword_password.test(value)) {
|
|
|
return Promise.reject('请输入8~16位字符,字母、数字和特殊符号至少包含2种');
|
|
|
}
|
|
|
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位新密码,区分大小写、不能使用空格');
|
|
|
}
|
|
|
}
|
|
|
var verifyValidate = function verifyValidate(_, value) {
|
|
|
return value ? Promise.resolve() : Promise.reject('请拖动滑块验证');
|
|
|
};
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (timer > 0) {
|
|
|
setTimeout(function () {
|
|
|
dispatch({
|
|
|
type: ResetPassword_Types.setTimer,
|
|
|
payload: timer - 1
|
|
|
});
|
|
|
}, 1000);
|
|
|
}
|
|
|
}, [timer]);
|
|
|
var LoginValidate = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(_, value) {
|
|
|
var _yield$validateName, status, message, isOk;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
if (value) {
|
|
|
_context2.next = 2;
|
|
|
break;
|
|
|
}
|
|
|
return _context2.abrupt("return", Promise.resolve());
|
|
|
case 2:
|
|
|
if (!(value.indexOf(" ") > -1)) {
|
|
|
_context2.next = 4;
|
|
|
break;
|
|
|
}
|
|
|
return _context2.abrupt("return", Promise.reject('请输入正确的手机号或邮箱'));
|
|
|
case 4:
|
|
|
if (!ResetPassword_loginRegex.test(value)) {
|
|
|
_context2.next = 18;
|
|
|
break;
|
|
|
}
|
|
|
_context2.next = 7;
|
|
|
return validateName({
|
|
|
login: value,
|
|
|
type: 2
|
|
|
});
|
|
|
case 7:
|
|
|
_yield$validateName = _context2.sent;
|
|
|
status = _yield$validateName.status;
|
|
|
message = _yield$validateName.message;
|
|
|
isOk = status > 0;
|
|
|
if (!isOk) {
|
|
|
_context2.next = 15;
|
|
|
break;
|
|
|
}
|
|
|
return _context2.abrupt("return", Promise.resolve());
|
|
|
case 15:
|
|
|
return _context2.abrupt("return", Promise.reject(message));
|
|
|
case 16:
|
|
|
_context2.next = 19;
|
|
|
break;
|
|
|
case 18:
|
|
|
return _context2.abrupt("return", Promise.reject('请输入正确的手机号或邮箱'));
|
|
|
case 19:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function LoginValidate(_x2, _x3) {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
layout: "vertical",
|
|
|
form: form,
|
|
|
style: style,
|
|
|
initialValues: {
|
|
|
autologin: true,
|
|
|
protool: false
|
|
|
},
|
|
|
onFinish: (0,lodash.throttle)(onFinish, 2000),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "login",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入正确的手机号或邮箱'
|
|
|
}, {
|
|
|
validator: (0,lodash.throttle)(LoginValidate, 400)
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
style: ResetPassword_inputStyle,
|
|
|
autoComplete: "new-login",
|
|
|
size: 'middle',
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u624B\u673A\u53F7/\u90AE\u7BB1\u53F7"
|
|
|
// onBlur={() => onValidateName}
|
|
|
,
|
|
|
onChange: function onChange() {
|
|
|
return form.setFieldsValue({
|
|
|
verify: 0
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
}), /*#__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: "topRight",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "new_password",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入8-16位新密码,区分大小写、不能使用空格'
|
|
|
}, {
|
|
|
validator: validatePassword
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Password, {
|
|
|
autoComplete: "new-password",
|
|
|
style: ResetPassword_inputStyle,
|
|
|
size: 'middle',
|
|
|
placeholder: "\u8F93\u51658\uFF5E16\u4F4D\u65B0\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199"
|
|
|
})
|
|
|
})
|
|
|
}), !(globalSetting !== null && globalSetting !== void 0 && (_globalSetting$settin = globalSetting.setting) !== null && _globalSetting$settin !== void 0 && _globalSetting$settin.is_local) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "code",
|
|
|
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
|
|
|
},
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",
|
|
|
size: 'middle'
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
size: 'middle',
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
block: true,
|
|
|
style: ResetPassword_inputStyle,
|
|
|
className: "font16",
|
|
|
children: [" ", buttonText, " "]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc",
|
|
|
style: {
|
|
|
paddingTop: 0,
|
|
|
paddingBottom: 20
|
|
|
},
|
|
|
children: ["\u4FEE\u6539\u5E76\u767B\u5F55\u5373\u4EE3\u8868\u60A8\u5DF2\u9605\u8BFB\u5E76\u540C\u610F", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "https://engineer.educoder.net/help?index=4",
|
|
|
target: "_blank",
|
|
|
children: "\u300A\u670D\u52A1\u534F\u8BAE\u6761\u6B3E\u300B"
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var ResetPassword = ((0,_umi_production_exports.connect)(function (_ref4) {
|
|
|
var globalSetting = _ref4.globalSetting;
|
|
|
return {
|
|
|
globalSetting: globalSetting
|
|
|
};
|
|
|
})(ResetPassword_RegisterComponent));
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/OauthPanel/wechat.svg
|
|
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var __defProp = Object.defineProperty;
|
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var __defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? __defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var __spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
|
if (__getOwnPropSymbols) {
|
|
|
var _iterator = _createForOfIteratorHelper(__getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgWechat = function SvgWechat(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", __spreadValues({
|
|
|
id: "wechat_svg__\\u56FE\\u5C42_1",
|
|
|
xmlns: "http://www.w3.org/2000/svg",
|
|
|
x: 0,
|
|
|
y: 0,
|
|
|
viewBox: "0 0 66 66",
|
|
|
style: {
|
|
|
enableBackground: "new 0 0 66 66"
|
|
|
},
|
|
|
xmlSpace: "preserve"
|
|
|
}, props), /* @__PURE__ */React.createElement("style", null, ".wechat_svg__st1{fill:#00b913}"), /* @__PURE__ */React.createElement("g", {
|
|
|
id: "wechat_svg__\\u9875\\u9762-1"
|
|
|
}, /* @__PURE__ */React.createElement("g", {
|
|
|
id: "wechat_svg__\\u767B\\u5F55_x2F_\\u6CE8\\u518C",
|
|
|
transform: "translate(-1081 -380)"
|
|
|
}, /* @__PURE__ */React.createElement("g", {
|
|
|
id: "wechat_svg__\\u7F16\\u7EC4-18\\u5907\\u4EFD",
|
|
|
transform: "translate(1063 238)"
|
|
|
}, /* @__PURE__ */React.createElement("g", {
|
|
|
id: "wechat_svg__\\u7F16\\u7EC4-12",
|
|
|
transform: "translate(18 142)"
|
|
|
}, /* @__PURE__ */React.createElement("g", {
|
|
|
id: "wechat_svg__\\u7F16\\u7EC4-10"
|
|
|
}, /* @__PURE__ */React.createElement("circle", {
|
|
|
id: "wechat_svg__\\u692D\\u5706\\u5F62",
|
|
|
cx: 33,
|
|
|
cy: 33,
|
|
|
r: 33,
|
|
|
style: {
|
|
|
fillRule: "evenodd",
|
|
|
clipRule: "evenodd",
|
|
|
fill: "#c6f4c9"
|
|
|
}
|
|
|
}), /* @__PURE__ */React.createElement("g", {
|
|
|
id: "wechat_svg__\\u7F16\\u7EC4",
|
|
|
transform: "translate(12 15.429)"
|
|
|
}, /* @__PURE__ */React.createElement("path", {
|
|
|
id: "wechat_svg__\\u8DEF\\u5F84",
|
|
|
className: "wechat_svg__st1",
|
|
|
d: "M16.3 22.8c0-6.6 6-12.1 13.7-12.1h.4C29.1 4.6 22.7 0 15.4 0 7.2 0 .4 5.8.4 13.1c0 4.3 2.2 7.7 6 10.5l-1.5 4.7 5.2-2.7c1.7.4 3.5.7 5.3.8.5 0 .9 0 1.4-.1l.1-.1c-.4-1.1-.6-2.3-.6-3.4z"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
id: "wechat_svg__\\u8DEF\\u5F84_1_",
|
|
|
className: "wechat_svg__st1",
|
|
|
d: "M42.4 22.4c0-6.2-5.8-11.2-12.4-11.2-7 0-12.4 5.1-12.4 11.2S23.1 33.6 30 33.6c1.5-.1 3-.3 4.4-.8l4 2.3-1-3.8c2.8-2.3 5-5.5 5-8.9z"
|
|
|
}), /* @__PURE__ */React.createElement("path", {
|
|
|
id: "wechat_svg__\\u5F62\\u72B6",
|
|
|
d: "M21.6 6c1-.1 1.8.7 1.9 1.7V8c.1 1-.7 1.9-1.6 2h-.2c-1.1.1-2.1-.8-2.2-2 0-1.2 1-2.1 2.1-2zM11.2 9.9C10.1 10 9.1 9.2 9 8c.1-1.2 1.1-2.1 2.2-2 1-.1 1.8.7 1.8 1.8V8c.1 1-.7 1.9-1.6 2h-.2zm15.2 10.7c-.8-.1-1.4-.7-1.5-1.6.1-.8.7-1.5 1.5-1.6.9-.1 1.7.6 1.9 1.6-.2 1-1 1.7-1.9 1.6zm8.2 0c-.8-.1-1.4-.7-1.5-1.6.1-.8.7-1.5 1.5-1.6.9-.1 1.7.6 1.9 1.6-.2 1-1 1.7-1.9 1.6z",
|
|
|
style: {
|
|
|
fill: "#fff"
|
|
|
}
|
|
|
}))))))));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var wechat = ("data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSLlm77lsYJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4PSIwIiB5PSIwIiB2aWV3Qm94PSIwIDAgNjYgNjYiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDY2IDY2IiB4bWw6c3BhY2U9InByZXNlcnZlIj48c3R5bGU+LnN0MXtmaWxsOiMwMGI5MTN9PC9zdHlsZT48ZyBpZD0i6aG16Z2iLTEiPjxnIGlkPSLnmbvlvZVfeDJGX+azqOWGjCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEwODEgLTM4MCkiPjxnIGlkPSLnvJbnu4QtMTjlpIfku70iIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwNjMgMjM4KSI+PGcgaWQ9Iue8lue7hC0xMiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTggMTQyKSI+PGcgaWQ9Iue8lue7hC0xMCI+PGNpcmNsZSBpZD0i5qSt5ZyG5b2iIiBjeD0iMzMiIGN5PSIzMyIgcj0iMzMiIHN0eWxlPSJmaWxsLXJ1bGU6ZXZlbm9kZDtjbGlwLXJ1bGU6ZXZlbm9kZDtmaWxsOiNjNmY0YzkiLz48ZyBpZD0i57yW57uEIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiAxNS40MjkpIj48cGF0aCBpZD0i6Lev5b6EIiBjbGFzcz0ic3QxIiBkPSJNMTYuMyAyMi44YzAtNi42IDYtMTIuMSAxMy43LTEyLjFoLjRDMjkuMSA0LjYgMjIuNyAwIDE1LjQgMCA3LjIgMCAuNCA1LjguNCAxMy4xYzAgNC4zIDIuMiA3LjcgNiAxMC41bC0xLjUgNC43IDUuMi0yLjdjMS43LjQgMy41LjcgNS4zLjguNSAwIC45IDAgMS40LS4xbC4xLS4xYy0uNC0xLjEtLjYtMi4zLS42LTMuNHoiLz48cGF0aCBpZD0i6Lev5b6EXzFfIiBjbGFzcz0ic3QxIiBkPSJNNDIuNCAyMi40YzAtNi4yLTUuOC0xMS4yLTEyLjQtMTEuMi03IDAtMTIuNCA1LjEtMTIuNCAxMS4yUzIzLjEgMzMuNiAzMCAzMy42YzEuNS0uMSAzLS4zIDQuNC0uOGw0IDIuMy0xLTMuOGMyLjgtMi4zIDUtNS41IDUtOC45eiIvPjxwYXRoIGlkPSLlvaLnirYiIGQ9Ik0yMS42IDZjMS0uMSAxLjguNyAxLjkgMS43VjhjLjEgMS0uNyAxLjktMS42IDJoLS4yYy0xLjEuMS0yLjEtLjgtMi4yLTIgMC0xLjIgMS0yLjEgMi4xLTJ6TTExLjIgOS45QzEwLjEgMTAgOS4xIDkuMiA5IDhjLjEtMS4yIDEuMS0yLjEgMi4yLTIgMS0uMSAxLjguNyAxLjggMS44VjhjLjEgMS0uNyAxLjktMS42IDJoLS4yem0xNS4yIDEwLjdjLS44LS4xLTEuNC0uNy0xLjUtMS42LjEtLjguNy0xLjUgMS41LTEuNi45LS4xIDEuNy42IDEuOSAxLjYtLjIgMS0xIDEuNy0xLjkgMS42em04LjIgMGMtLjgtLjEtMS40LS43LTEuNS0xLjYuMS0uOC43LTEuNSAxLjUtMS42LjktLjEgMS43LjYgMS45IDEuNi0uMiAxLTEgMS43LTEuOSAxLjZ6IiBzdHlsZT0iZmlsbDojZmZmIi8+PC9nPjwvZz48L2c+PC9nPjwvZz48L2c+PC9zdmc+");
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/OauthPanel/qq.svg
|
|
|
function qq_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = qq_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
|
function qq_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return qq_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return qq_arrayLikeToArray(o, minLen); }
|
|
|
function qq_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
|
var qq_defProp = Object.defineProperty;
|
|
|
var qq_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
var qq_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
var qq_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
|
var qq_defNormalProp = function __defNormalProp(obj, key, value) {
|
|
|
return key in obj ? qq_defProp(obj, key, {
|
|
|
enumerable: true,
|
|
|
configurable: true,
|
|
|
writable: true,
|
|
|
value: value
|
|
|
}) : obj[key] = value;
|
|
|
};
|
|
|
var qq_spreadValues = function __spreadValues(a, b) {
|
|
|
for (var prop in b || (b = {})) if (qq_hasOwnProp.call(b, prop)) qq_defNormalProp(a, prop, b[prop]);
|
|
|
if (qq_getOwnPropSymbols) {
|
|
|
var _iterator = qq_createForOfIteratorHelper(qq_getOwnPropSymbols(b)),
|
|
|
_step;
|
|
|
try {
|
|
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
|
var prop = _step.value;
|
|
|
if (qq_propIsEnum.call(b, prop)) qq_defNormalProp(a, prop, b[prop]);
|
|
|
}
|
|
|
} catch (err) {
|
|
|
_iterator.e(err);
|
|
|
} finally {
|
|
|
_iterator.f();
|
|
|
}
|
|
|
}
|
|
|
return a;
|
|
|
};
|
|
|
|
|
|
var SvgQq = function SvgQq(props) {
|
|
|
return /* @__PURE__ */React.createElement("svg", qq_spreadValues({
|
|
|
className: "qq_svg__icon",
|
|
|
viewBox: "0 0 1024 1024",
|
|
|
xmlns: "http://www.w3.org/2000/svg",
|
|
|
width: 200,
|
|
|
height: 200
|
|
|
}, props), /* @__PURE__ */React.createElement("path", {
|
|
|
d: "M512 0C229.356 0 0 229.356 0 512s229.356 512 512 512 512-229.356 512-512S794.644 0 512 0zm235.75 647.603c-10.7 5.417-27.417-6.963-43.34-30.157-6.267 25.262-21.673 47.95-43.607 66.253 23.244 8.505 38.123 22.17 38.123 37.898 0 25.519-40.99 46.403-91.387 46.403-45.43 0-83.287-17.014-90.076-38.927h-10.967C499.446 751.243 461.85 768 416.42 768c-50.396 0-91.387-20.623-91.387-46.403 0-15.728 15.145-29.388 38.118-37.898-21.929-18.304-37.596-41.252-43.602-66.253-15.667 23.194-32.634 35.83-43.34 30.157-15.668-7.987-12.534-51.046 7.05-96.159 15.145-35.317 36.03-61.614 51.697-67.287-.262-2.319-.262-4.638-.262-6.707 0-13.66 3.917-26.291 10.445-36.608v-2.314c0-6.19 1.567-12.119 4.178-17.275C353.23 329.216 414.07 256 512.241 256s159.006 73.216 162.923 165.253a38.374 38.374 0 0 1 4.178 17.275v2.32c6.528 10.311 10.445 22.942 10.445 36.607 0 2.32 0 4.64-.261 6.702 15.923 5.673 36.557 31.97 51.696 67.287 19.062 45.118 22.196 88.167 6.528 96.16z",
|
|
|
fill: "#378AFE"
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
/* harmony default export */ var qq = ("data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PHBhdGggZD0iTTUxMiAwQzIyOS4zNTYgMCAwIDIyOS4zNTYgMCA1MTJzMjI5LjM1NiA1MTIgNTEyIDUxMiA1MTItMjI5LjM1NiA1MTItNTEyUzc5NC42NDQgMCA1MTIgMHptMjM1Ljc1IDY0Ny42MDNjLTEwLjcgNS40MTctMjcuNDE3LTYuOTYzLTQzLjM0LTMwLjE1Ny02LjI2NyAyNS4yNjItMjEuNjczIDQ3Ljk1LTQzLjYwNyA2Ni4yNTMgMjMuMjQ0IDguNTA1IDM4LjEyMyAyMi4xNyAzOC4xMjMgMzcuODk4IDAgMjUuNTE5LTQwLjk5IDQ2LjQwMy05MS4zODcgNDYuNDAzLTQ1LjQzIDAtODMuMjg3LTE3LjAxNC05MC4wNzYtMzguOTI3aC0xMC45NjdDNDk5LjQ0NiA3NTEuMjQzIDQ2MS44NSA3NjggNDE2LjQyIDc2OGMtNTAuMzk2IDAtOTEuMzg3LTIwLjYyMy05MS4zODctNDYuNDAzIDAtMTUuNzI4IDE1LjE0NS0yOS4zODggMzguMTE4LTM3Ljg5OC0yMS45MjktMTguMzA0LTM3LjU5Ni00MS4yNTItNDMuNjAyLTY2LjI1My0xNS42NjcgMjMuMTk0LTMyLjYzNCAzNS44My00My4zNCAzMC4xNTctMTUuNjY4LTcuOTg3LTEyLjUzNC01MS4wNDYgNy4wNS05Ni4xNTkgMTUuMTQ1LTM1LjMxNyAzNi4wMy02MS42MTQgNTEuNjk3LTY3LjI4Ny0uMjYyLTIuMzE5LS4yNjItNC42MzgtLjI2Mi02LjcwNyAwLTEzLjY2IDMuOTE3LTI2LjI5MSAxMC40NDUtMzYuNjA4di0yLjMxNGMwLTYuMTkgMS41NjctMTIuMTE5IDQuMTc4LTE3LjI3NUMzNTMuMjMgMzI5LjIxNiA0MTQuMDcgMjU2IDUxMi4yNDEgMjU2czE1OS4wMDYgNzMuMjE2IDE2Mi45MjMgMTY1LjI1M2EzOC4zNzQgMzguMzc0IDAgMCAxIDQuMTc4IDE3LjI3NXYyLjMyYzYuNTI4IDEwLjMxMSAxMC40NDUgMjIuOTQyIDEwLjQ0NSAzNi42MDcgMCAyLjMyIDAgNC42NC0uMjYxIDYuNzAyIDE1LjkyMyA1LjY3MyAzNi41NTcgMzEuOTcgNTEuNjk2IDY3LjI4NyAxOS4wNjIgNDUuMTE4IDIyLjE5NiA4OC4xNjcgNi41MjggOTYuMTZ6IiBmaWxsPSIjMzc4QUZFIi8+PC9zdmc+");
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/OauthPanel/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var OauthPanelmodules = ({"other-login":"other-login___Jd48Z","btn-link":"btn-link___MhTA6","wechat-qrcode":"wechat-qrcode___bLWkh","driver":"driver___IuicK"});
|
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(26078);
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/OauthPanel/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var HOST = window.location.host;
|
|
|
var redirect_uri = env/* default */.Z.QQLoginCB;
|
|
|
/* harmony default export */ var OauthPanel = (function (_ref) {
|
|
|
var onWechatLogin = _ref.onWechatLogin,
|
|
|
setType = _ref.setType,
|
|
|
loginType = _ref.loginType;
|
|
|
function onQQLogin() {
|
|
|
if ((0,util/* isPc */.b9)()) {
|
|
|
window.location.href = "https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=".concat(redirect_uri, "%2fotherloginqq&state=null,").concat(HOST, "&response_type=code");
|
|
|
} else {
|
|
|
(0,util/* openNewWindow */.xg)("https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=".concat(redirect_uri, "%2fotherloginqq&state=null,").concat(HOST, "&response_type=code"));
|
|
|
}
|
|
|
}
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [(loginType === 1 || loginType === 2) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
marginTop: loginType === 4 ? 20 : 92,
|
|
|
marginBottom: 60
|
|
|
},
|
|
|
className: "font16 tc",
|
|
|
children: ["\u6CA1\u6709\u8D26\u53F7\uFF1F", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick() {
|
|
|
return setType(3);
|
|
|
},
|
|
|
className: "c-blue current",
|
|
|
children: "\u514D\u8D39\u6CE8\u518C"
|
|
|
})]
|
|
|
}), (loginType === 3 || loginType === 4 || loginType === 5) && /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
marginTop: 92,
|
|
|
marginBottom: 60
|
|
|
},
|
|
|
className: "font16 tc",
|
|
|
children: ["\u5DF2\u6709\u8D26\u53F7\uFF1F", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick() {
|
|
|
return setType(1);
|
|
|
},
|
|
|
className: "c-blue current",
|
|
|
children: "\u7ACB\u5373\u767B\u5F55"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
className: OauthPanelmodules.driver,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
color: '#444444'
|
|
|
},
|
|
|
children: "\u5FEB\u901F\u767B\u5F55"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: OauthPanelmodules['other-login'],
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
title: "\u5FAE\u4FE1\u767B\u5F55",
|
|
|
onClick: onWechatLogin,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: wechat,
|
|
|
alt: "\u5FAE\u4FE1",
|
|
|
width: 66
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
title: "qq\u767B\u5F55",
|
|
|
onClick: onQQLogin,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: qq,
|
|
|
alt: "QQ",
|
|
|
width: 66
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
});
|
|
|
function WechatQrcode(_ref2) {
|
|
|
var onBack = _ref2.onBack,
|
|
|
setType = _ref2.setType;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
overflow: "hidden",
|
|
|
width: 300,
|
|
|
height: 300,
|
|
|
margin: "20px auto 0 auto"
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", {
|
|
|
className: OauthPanelmodules['wechat-qrcode'],
|
|
|
frameBorder: "0",
|
|
|
sandbox: "allow-scripts allow-same-origin allow-top-navigation",
|
|
|
scrolling: "no",
|
|
|
src: "https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=".concat(redirect_uri, "%2fotherloginstart&response_type=code&scope=snsapi_login&state=null,").concat(HOST, "#wechat_redirect")
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
style: {
|
|
|
marginTop: 17,
|
|
|
marginBottom: 10
|
|
|
},
|
|
|
className: "font16 bold tc c-blue current",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
onClick: function onClick() {
|
|
|
return setType(1);
|
|
|
},
|
|
|
style: {
|
|
|
borderBottom: "2px solid #0152d9"
|
|
|
},
|
|
|
children: "\u8FD4\u56DE\u8D26\u53F7\u767B\u5F55"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc",
|
|
|
style: {
|
|
|
paddingTop: 14,
|
|
|
paddingBottom: 40
|
|
|
},
|
|
|
children: ["\u767B\u5F55\u5373\u4EE3\u8868\u60A8\u5DF2\u9605\u8BFB\u5E76\u540C\u610F", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "https://engineer.educoder.net/help?index=4",
|
|
|
target: "_blank",
|
|
|
children: "\u300A\u670D\u52A1\u534F\u8BAE\u6761\u6B3E\u300B"
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/ChangPassword/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ChangPassword_inputStyle = {
|
|
|
height: 48
|
|
|
};
|
|
|
var ChangPassword_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 ChangPassword_password = /^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{8,16}$/;
|
|
|
var ChangPassword_initialState = {
|
|
|
timer: 0
|
|
|
};
|
|
|
var ChangPassword_Types = /*#__PURE__*/function (Types) {
|
|
|
Types[Types["setTimer"] = 0] = "setTimer";
|
|
|
return Types;
|
|
|
}(ChangPassword_Types || {});
|
|
|
function ChangPassword_reducer(state, action) {
|
|
|
switch (action.type) {
|
|
|
case ChangPassword_Types.setTimer:
|
|
|
return objectSpread2_default()(objectSpread2_default()({}, state), {}, {
|
|
|
timer: action.payload
|
|
|
});
|
|
|
default:
|
|
|
throw new Error();
|
|
|
}
|
|
|
}
|
|
|
var ChangPassword_RegisterComponent = function RegisterComponent(_ref) {
|
|
|
var validateName = _ref.validateName,
|
|
|
getCode = _ref.getCode,
|
|
|
register = _ref.register,
|
|
|
_ref$style = _ref.style,
|
|
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
|
_ref$buttonText = _ref.buttonText,
|
|
|
buttonText = _ref$buttonText === void 0 ? '注册' : _ref$buttonText,
|
|
|
globalSetting = _ref.globalSetting;
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useReducer = (0,_react_17_0_2_react.useReducer)(ChangPassword_reducer, ChangPassword_initialState),
|
|
|
_useReducer2 = slicedToArray_default()(_useReducer, 2),
|
|
|
state = _useReducer2[0],
|
|
|
dispatch = _useReducer2[1];
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
codeLoading = _useState2[0],
|
|
|
setCodeLoading = _useState2[1];
|
|
|
var timer = state.timer;
|
|
|
function onFinish(_x) {
|
|
|
return _onFinish.apply(this, arguments);
|
|
|
}
|
|
|
function _onFinish() {
|
|
|
_onFinish = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(values) {
|
|
|
var old_password, newPassword, _yield$register, message, status;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
old_password = values.old_password, newPassword = values.newPassword;
|
|
|
_context.next = 3;
|
|
|
return register({
|
|
|
old_password: old_password,
|
|
|
newPassword: newPassword
|
|
|
});
|
|
|
case 3:
|
|
|
_yield$register = _context.sent;
|
|
|
message = _yield$register.message;
|
|
|
status = _yield$register.status;
|
|
|
if (!(status < 0)) {
|
|
|
_context.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
form.setFields([{
|
|
|
name: 'code',
|
|
|
errors: [message]
|
|
|
}]);
|
|
|
return _context.abrupt("return");
|
|
|
case 9:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return _onFinish.apply(this, arguments);
|
|
|
}
|
|
|
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 (!ChangPassword_password.test(value)) {
|
|
|
callback("请输入8~16位字符,字母、数字和特殊符号至少包含2种");
|
|
|
} else {
|
|
|
callback();
|
|
|
}
|
|
|
};
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (timer > 0) {
|
|
|
setTimeout(function () {
|
|
|
dispatch({
|
|
|
type: ChangPassword_Types.setTimer,
|
|
|
payload: timer - 1
|
|
|
});
|
|
|
}, 1000);
|
|
|
}
|
|
|
}, [timer]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
layout: "vertical",
|
|
|
form: form,
|
|
|
style: style,
|
|
|
initialValues: {
|
|
|
autologin: true,
|
|
|
protool: false
|
|
|
},
|
|
|
onFinish: onFinish,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "old_password",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入8~16位密码,区分大小写'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
style: ChangPassword_inputStyle,
|
|
|
autoComplete: "new-login",
|
|
|
size: 'middle',
|
|
|
type: "password",
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u65E7\u5BC6\u7801"
|
|
|
// onBlur={() => onValidateName}
|
|
|
,
|
|
|
onChange: function onChange() {
|
|
|
return form.setFieldsValue({
|
|
|
verify: 0
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
}), /*#__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: "topRight",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "newPassword",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入8-16位新密码,区分大小写、不能使用空格'
|
|
|
}, {
|
|
|
validator: inputNewPassword
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z.Password, {
|
|
|
autoComplete: "new-password",
|
|
|
style: ChangPassword_inputStyle,
|
|
|
size: 'middle',
|
|
|
placeholder: "\u8F93\u51658\uFF5E16\u4F4D\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: "topRight",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
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.Password, {
|
|
|
autoComplete: "new-password",
|
|
|
style: ChangPassword_inputStyle,
|
|
|
size: 'middle',
|
|
|
placeholder: "\u8BF7\u518D\u6B21\u8F93\u5165\u65B0\u5BC6\u7801"
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(es_button/* default */.ZP, {
|
|
|
size: 'middle',
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
block: true,
|
|
|
style: ChangPassword_inputStyle,
|
|
|
className: "font16",
|
|
|
children: [" ", buttonText, " "]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "tc",
|
|
|
style: {
|
|
|
paddingTop: 0,
|
|
|
paddingBottom: 20
|
|
|
},
|
|
|
children: ["\u4FEE\u6539\u5E76\u767B\u5F55\u5373\u4EE3\u8868\u60A8\u5DF2\u9605\u8BFB\u5E76\u540C\u610F", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "https://engineer.educoder.net/help?index=4",
|
|
|
target: "_blank",
|
|
|
children: "\u300A\u670D\u52A1\u534F\u8BAE\u6761\u6B3E\u300B"
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var ChangPassword = ((0,_umi_production_exports.connect)(function (_ref2) {
|
|
|
var globalSetting = _ref2.globalSetting;
|
|
|
return {
|
|
|
globalSetting: globalSetting
|
|
|
};
|
|
|
})(ChangPassword_RegisterComponent));
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tabs/index.js + 24 modules
|
|
|
var tabs = __webpack_require__(99313);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
|
|
var row = __webpack_require__(95237);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
|
|
|
var col = __webpack_require__(43604);
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/LoginPanel/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var TabPane = tabs/* default */.Z.TabPane;
|
|
|
/* harmony default export */ var LoginPanel = (function (_ref) {
|
|
|
var dispatch = _ref.dispatch,
|
|
|
is_main_site = _ref.is_main_site,
|
|
|
is_local = _ref.is_local,
|
|
|
_ref$style = _ref.style,
|
|
|
style = _ref$style === void 0 ? {} : _ref$style;
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
wechatQrcode = _useState2[0],
|
|
|
setWechatQrcode = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)("1"),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
type = _useState4[0],
|
|
|
setType = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(1),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
loginType = _useState6[0],
|
|
|
setLoginType = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
username = _useState8[0],
|
|
|
setusername = _useState8[1];
|
|
|
function onBack() {
|
|
|
setLoginType(1);
|
|
|
setWechatQrcode(false);
|
|
|
}
|
|
|
function onWechatLogin() {
|
|
|
setLoginType(2);
|
|
|
setWechatQrcode(true);
|
|
|
}
|
|
|
function callback(key) {
|
|
|
console.log(key);
|
|
|
setType(key);
|
|
|
}
|
|
|
var loginOption = {
|
|
|
buttonText: '登 录',
|
|
|
validateName: service_user/* validateName */.Ol,
|
|
|
getCode: service_user/* getValidateCode */.o1,
|
|
|
register: function () {
|
|
|
var _register = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(values) {
|
|
|
var response;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return (0,service_user/* LoginForPhone */.Gq)({
|
|
|
phone: values.login,
|
|
|
code: values.code
|
|
|
});
|
|
|
case 2:
|
|
|
response = _context.sent;
|
|
|
if (!(response.status === 0)) {
|
|
|
_context.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
// message.info('注册并绑定成功')
|
|
|
if (response !== null && response !== void 0 && response.show) {
|
|
|
localStorage.setItem('extension-modal', 'exist');
|
|
|
localStorage.setItem('extension-date', response === null || response === void 0 ? void 0 : response.start_date);
|
|
|
} else {
|
|
|
localStorage.removeItem('extension-modal');
|
|
|
}
|
|
|
return _context.abrupt("return", '/');
|
|
|
case 6:
|
|
|
return _context.abrupt("return", response);
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
function register(_x) {
|
|
|
return _register.apply(this, arguments);
|
|
|
}
|
|
|
return register;
|
|
|
}()
|
|
|
};
|
|
|
var registerOption = {
|
|
|
buttonText: '注册并登录',
|
|
|
validateName: service_user/* validateName */.Ol,
|
|
|
getCode: service_user/* getValidateCode */.o1,
|
|
|
register: function () {
|
|
|
var _register3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(values) {
|
|
|
var response, addinfo;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
_context2.next = 2;
|
|
|
return (0,service_user/* register */.z2)(objectSpread2_default()({}, values));
|
|
|
case 2:
|
|
|
response = _context2.sent;
|
|
|
if (!(response.status === 0)) {
|
|
|
_context2.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
//代表新注册用户
|
|
|
addinfo = localStorage.getItem('addinfo');
|
|
|
if (addinfo === '1') {
|
|
|
localStorage.setItem('addinfo', '2');
|
|
|
} else {
|
|
|
localStorage.setItem('registeruser', '1');
|
|
|
}
|
|
|
localStorage.removeItem('extension-modal');
|
|
|
message/* default */.ZP.info('注册并登陆成功');
|
|
|
return _context2.abrupt("return", '/');
|
|
|
case 9:
|
|
|
return _context2.abrupt("return", response);
|
|
|
case 10:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
function register(_x2) {
|
|
|
return _register3.apply(this, arguments);
|
|
|
}
|
|
|
return register;
|
|
|
}()
|
|
|
};
|
|
|
var Password = {
|
|
|
buttonText: '修改密码',
|
|
|
validateName: service_user/* validateName */.Ol,
|
|
|
getCode: service_user/* getValidateCode */.o1,
|
|
|
register: function () {
|
|
|
var _register4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(values) {
|
|
|
var response;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_context3.next = 2;
|
|
|
return (0,service_user/* changPassword */.Ex)(objectSpread2_default()({
|
|
|
login: username
|
|
|
}, values));
|
|
|
case 2:
|
|
|
response = _context3.sent;
|
|
|
message/* default */.ZP.info('修改密码成功');
|
|
|
return _context3.abrupt("return", response);
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
function register(_x3) {
|
|
|
return _register4.apply(this, arguments);
|
|
|
}
|
|
|
return register;
|
|
|
}()
|
|
|
};
|
|
|
var resetOption = {
|
|
|
buttonText: '修改并登录',
|
|
|
validateName: service_user/* validateName */.Ol,
|
|
|
getCode: service_user/* getValidateCode */.o1,
|
|
|
register: function () {
|
|
|
var _register5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5(values) {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
return _context5.abrupt("return", new Promise( /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(resolve) {
|
|
|
var response;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
values.new_password_confirmation = values.new_password;
|
|
|
_context4.next = 3;
|
|
|
return (0,service_user/* resetPassword */.c0)(objectSpread2_default()({}, values));
|
|
|
case 3:
|
|
|
response = _context4.sent;
|
|
|
if (!(response.status === 0)) {
|
|
|
_context4.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
if (response !== null && response !== void 0 && response.show) {
|
|
|
localStorage.setItem('extension-modal', 'exist');
|
|
|
localStorage.setItem('extension-date', response === null || response === void 0 ? void 0 : response.start_date);
|
|
|
} else {
|
|
|
localStorage.removeItem('extension-modal');
|
|
|
}
|
|
|
message/* default */.ZP.info('修改成功');
|
|
|
resolve("/");
|
|
|
return _context4.abrupt("return", '/');
|
|
|
case 9:
|
|
|
resolve(response);
|
|
|
return _context4.abrupt("return", response);
|
|
|
case 11:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
return function (_x5) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}()));
|
|
|
case 1:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
}));
|
|
|
function register(_x4) {
|
|
|
return _register5.apply(this, arguments);
|
|
|
}
|
|
|
return register;
|
|
|
}()
|
|
|
};
|
|
|
var loginDom = (0,_react_17_0_2_react.useCallback)(function () {
|
|
|
switch (loginType) {
|
|
|
case 1:
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(tabs/* default */.Z, {
|
|
|
defaultActiveKey: type,
|
|
|
onChange: callback,
|
|
|
className: LoginPanelmodules.tabs,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(TabPane, {
|
|
|
tab: "\u8D26\u53F7\u767B\u5F55",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt20",
|
|
|
children: type === '1' && /*#__PURE__*/(0,jsx_runtime.jsx)(LoginForm, {
|
|
|
setusername: setusername,
|
|
|
setType: setLoginType
|
|
|
})
|
|
|
})
|
|
|
}, "1"), /*#__PURE__*/(0,jsx_runtime.jsx)(TabPane, {
|
|
|
tab: "\u9A8C\u8BC1\u7801\u767B\u5F55",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "mt20",
|
|
|
children: type === '2' && /*#__PURE__*/(0,jsx_runtime.jsx)(LoginSmsPanel, objectSpread2_default()({}, loginOption))
|
|
|
})
|
|
|
}, "2")]
|
|
|
});
|
|
|
break;
|
|
|
case 2:
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(WechatQrcode, {
|
|
|
setType: setLoginType,
|
|
|
onBack: onBack
|
|
|
});
|
|
|
break;
|
|
|
case 3:
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "ml40",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h1", {
|
|
|
className: "font18 mb20 mt35",
|
|
|
children: "\u65B0\u7528\u6237\u6CE8\u518C"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(RegisterPanel, objectSpread2_default()({}, registerOption))]
|
|
|
});
|
|
|
break;
|
|
|
case 4:
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "ml40",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h1", {
|
|
|
className: "font18 mb20 mt35",
|
|
|
children: "\u627E\u56DE\u5BC6\u7801"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ResetPassword, objectSpread2_default()({}, resetOption))]
|
|
|
});
|
|
|
break;
|
|
|
case 5:
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "ml40",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h1", {
|
|
|
className: "font18 mb20 mt35",
|
|
|
children: "\u4FEE\u6539\u5BC6\u7801"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(ChangPassword, objectSpread2_default()({}, Password))]
|
|
|
});
|
|
|
break;
|
|
|
}
|
|
|
}, [loginType, type]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: LoginPanelmodules['login-panel-wrapper2'],
|
|
|
style: style,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "1",
|
|
|
children: loginDom()
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(col/* default */.Z, {
|
|
|
flex: "295px",
|
|
|
className: LoginPanelmodules['login-panel-right-wrp'],
|
|
|
children: !is_local && /*#__PURE__*/(0,jsx_runtime.jsx)(OauthPanel, {
|
|
|
loginType: loginType,
|
|
|
setType: setLoginType,
|
|
|
onWechatLogin: onWechatLogin
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
});
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/PopLogin.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var PopLoginmodules = ({"popLogin":"popLogin___R8wQQ"});
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/PopLogin.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var PopLogin_LoginPopComponents = function LoginPopComponents(_ref) {
|
|
|
var _globalSetting$settin, _globalSetting$settin2;
|
|
|
var user = _ref.user,
|
|
|
globalSetting = _ref.globalSetting,
|
|
|
loading = _ref.loading,
|
|
|
dispatch = _ref.dispatch;
|
|
|
var onCancel = function onCancel() {
|
|
|
dispatch({
|
|
|
type: 'user/showPopLogin',
|
|
|
payload: {
|
|
|
showPopLogin: false,
|
|
|
showClosable: false
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
var is_main_site = (_globalSetting$settin = globalSetting.setting) === null || _globalSetting$settin === void 0 ? void 0 : _globalSetting$settin.main_site;
|
|
|
var is_local = (_globalSetting$settin2 = globalSetting.setting) === null || _globalSetting$settin2 === void 0 ? void 0 : _globalSetting$settin2.is_local;
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
centered: true
|
|
|
// title={<div>
|
|
|
// <span>账号登录</span>
|
|
|
// <span className="ml50">验证码登录</span>
|
|
|
// </div>}
|
|
|
,
|
|
|
open: user.showPopLogin,
|
|
|
footer: null,
|
|
|
width: !is_local ? 765 : 420,
|
|
|
keyboard: false,
|
|
|
maskClosable: false,
|
|
|
wrapClassName: PopLoginmodules.popLogin,
|
|
|
closable: user.showClosable,
|
|
|
onCancel: onCancel,
|
|
|
children: user.showPopLogin && /*#__PURE__*/(0,jsx_runtime.jsx)(LoginPanel, {
|
|
|
is_main_site: is_main_site,
|
|
|
is_local: is_local
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var PopLogin = ((0,_umi_production_exports.connect)(function (_ref2) {
|
|
|
var user = _ref2.user,
|
|
|
loading = _ref2.loading,
|
|
|
globalSetting = _ref2.globalSetting;
|
|
|
return {
|
|
|
user: user,
|
|
|
globalSetting: globalSetting,
|
|
|
loading: loading.models.index
|
|
|
};
|
|
|
})(PopLogin_LoginPopComponents));
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
var fetch = __webpack_require__(4781);
|
|
|
;// CONCATENATED MODULE: ./src/components/User/BindAccountPanel/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var BindAccountPanelmodules = ({"popLogin":"popLogin___u08I8","tips":"tips___U2xQw"});
|
|
|
;// CONCATENATED MODULE: ./src/components/User/BindAccountPanel/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//手机号、邮箱、密码的正则
|
|
|
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 passwordReg = /^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{8,16}$/;
|
|
|
var BindAccountPanel = function BindAccountPanel(_ref) {
|
|
|
var user = _ref.user,
|
|
|
globalSetting = _ref.globalSetting,
|
|
|
dispatch = _ref.dispatch;
|
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
|
searchParams = _useSearchParams2[0];
|
|
|
var inputStyle = {
|
|
|
height: 48,
|
|
|
borderRadius: 4
|
|
|
};
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var onCancel = function onCancel() {
|
|
|
dispatch({
|
|
|
type: 'user/setBindAccountModal',
|
|
|
payload: {
|
|
|
bindAccountModalVisible: false
|
|
|
}
|
|
|
});
|
|
|
form.resetFields();
|
|
|
};
|
|
|
var Validate = function Validate(_, value) {
|
|
|
if (!value) {
|
|
|
return Promise.resolve();
|
|
|
}
|
|
|
if (value.indexOf(' ') > -1) {
|
|
|
return Promise.reject('请输入正确的手机号或邮箱');
|
|
|
}
|
|
|
if (phoneReg.test(value) || emailReg.test(value)) {
|
|
|
return Promise.resolve();
|
|
|
} else {
|
|
|
return Promise.reject('请输入正确的手机号或邮箱');
|
|
|
}
|
|
|
};
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(60),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
timer = _useState2[0],
|
|
|
setTimer = _useState2[1];
|
|
|
var getCodeBtnDisabled = (0,_react_17_0_2_react.useMemo)(function () {
|
|
|
return timer < 60 && timer > 0;
|
|
|
}, [timer]);
|
|
|
var intervalId = (0,_react_17_0_2_react.useRef)();
|
|
|
|
|
|
//处理验证码倒计时
|
|
|
var countDown = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
clearInterval(intervalId.current);
|
|
|
setTimer(60);
|
|
|
intervalId.current = setInterval(function fn() {
|
|
|
setTimer(function (t) {
|
|
|
return t - 1;
|
|
|
});
|
|
|
return fn;
|
|
|
}(), 1000);
|
|
|
case 3:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function countDown() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
|
|
|
//获取验证码
|
|
|
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
codeLoading = _useState4[0],
|
|
|
setCodeLoading = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
isshow = _useState6[0],
|
|
|
setisshow = _useState6[1];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (user.bindAccountModalVisible) {
|
|
|
setisshow(true);
|
|
|
} else {
|
|
|
setisshow(false);
|
|
|
}
|
|
|
}, [user]);
|
|
|
var handleGetCode = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2() {
|
|
|
var userInput, isPhone, isEmail, _user$userInfoForBind, data, _data, smscode, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
userInput = form.getFieldValue('userInput');
|
|
|
isPhone = phoneReg.test(userInput);
|
|
|
isEmail = emailReg.test(userInput);
|
|
|
if (!(!isPhone && !isEmail)) {
|
|
|
_context2.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.error('请输入有效的手机号/邮箱号');
|
|
|
return _context2.abrupt("return");
|
|
|
case 6:
|
|
|
setCodeLoading(true);
|
|
|
if (!isPhone) {
|
|
|
_context2.next = 20;
|
|
|
break;
|
|
|
}
|
|
|
_context2.next = 10;
|
|
|
return (0,fetch/* default */.ZP)("/api/users/accounts/".concat((_user$userInfoForBind = user.userInfoForBindAccountModal) === null || _user$userInfoForBind === void 0 ? void 0 : _user$userInfoForBind.login, "/valid_phone.json"), {
|
|
|
method: 'get',
|
|
|
params: {
|
|
|
phone: userInput
|
|
|
}
|
|
|
});
|
|
|
case 10:
|
|
|
data = _context2.sent;
|
|
|
if (!((data === null || data === void 0 ? void 0 : data.status) === -1)) {
|
|
|
_context2.next = 14;
|
|
|
break;
|
|
|
}
|
|
|
setCodeLoading(false);
|
|
|
return _context2.abrupt("return");
|
|
|
case 14:
|
|
|
if (!(data !== null && data !== void 0 && data.is_exists)) {
|
|
|
_context2.next = 18;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('该手机号已被其它账号绑定');
|
|
|
setCodeLoading(false);
|
|
|
return _context2.abrupt("return");
|
|
|
case 18:
|
|
|
_context2.next = 27;
|
|
|
break;
|
|
|
case 20:
|
|
|
_context2.next = 22;
|
|
|
return (0,fetch/* default */.ZP)("/api/accounts/valid_email_and_phone", {
|
|
|
method: 'get',
|
|
|
params: {
|
|
|
login: userInput,
|
|
|
type: 1
|
|
|
}
|
|
|
});
|
|
|
case 22:
|
|
|
_data = _context2.sent;
|
|
|
if (!((_data === null || _data === void 0 ? void 0 : _data.status) === -3)) {
|
|
|
_context2.next = 27;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('该邮箱已被注册');
|
|
|
setCodeLoading(false);
|
|
|
return _context2.abrupt("return");
|
|
|
case 27:
|
|
|
smscode = (0,util/* setmiyah */.M)(userInput);
|
|
|
_context2.next = 30;
|
|
|
return dispatch({
|
|
|
type: 'account/getCode',
|
|
|
payload: {
|
|
|
login: userInput,
|
|
|
type: isPhone ? 3 : 4,
|
|
|
smscode: smscode
|
|
|
}
|
|
|
});
|
|
|
case 30:
|
|
|
res = _context2.sent;
|
|
|
setCodeLoading(false);
|
|
|
if (res.status === 1) {
|
|
|
message/* default */.ZP.info('验证码已发送,请注意查收');
|
|
|
countDown();
|
|
|
}
|
|
|
case 33:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function handleGetCode() {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleBind = /*#__PURE__*/function () {
|
|
|
var _ref4 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3() {
|
|
|
var userInput, code, isPhone, isEmail, _user$userInfoForBind2, res, _user$userInfoForBind3, _res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_context3.next = 2;
|
|
|
return form.validateFields();
|
|
|
case 2:
|
|
|
userInput = form.getFieldValue('userInput');
|
|
|
code = form.getFieldValue('code');
|
|
|
isPhone = phoneReg.test(userInput);
|
|
|
isEmail = emailReg.test(userInput);
|
|
|
if (!(!isPhone && !isEmail)) {
|
|
|
_context3.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.error('请输入有效的手机号/邮箱号');
|
|
|
return _context3.abrupt("return");
|
|
|
case 9:
|
|
|
if (!isPhone) {
|
|
|
_context3.next = 16;
|
|
|
break;
|
|
|
}
|
|
|
_context3.next = 12;
|
|
|
return dispatch({
|
|
|
type: 'account/bindPhone',
|
|
|
payload: {
|
|
|
login: (_user$userInfoForBind2 = user.userInfoForBindAccountModal) === null || _user$userInfoForBind2 === void 0 ? void 0 : _user$userInfoForBind2.login,
|
|
|
phone: userInput,
|
|
|
code: code
|
|
|
}
|
|
|
});
|
|
|
case 12:
|
|
|
res = _context3.sent;
|
|
|
return _context3.abrupt("return", res.status === 0);
|
|
|
case 16:
|
|
|
_context3.next = 18;
|
|
|
return dispatch({
|
|
|
type: 'account/bindEmail',
|
|
|
payload: {
|
|
|
login: (_user$userInfoForBind3 = user.userInfoForBindAccountModal) === null || _user$userInfoForBind3 === void 0 ? void 0 : _user$userInfoForBind3.login,
|
|
|
email: userInput,
|
|
|
code: code
|
|
|
}
|
|
|
});
|
|
|
case 18:
|
|
|
_res = _context3.sent;
|
|
|
return _context3.abrupt("return", _res.status === 0);
|
|
|
case 20:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return function handleBind() {
|
|
|
return _ref4.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleLogin = /*#__PURE__*/function () {
|
|
|
var _ref5 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4() {
|
|
|
var loginInfo, res, from;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
loginInfo = user.loginInfo;
|
|
|
if (!passwordReg.test(loginInfo.password)) {
|
|
|
message/* default */.ZP.error('系统检测您的密码强度过低,请及时修改');
|
|
|
}
|
|
|
_context4.next = 4;
|
|
|
return (0,service_user/* LoginIn */.Es)(loginInfo);
|
|
|
case 4:
|
|
|
res = _context4.sent;
|
|
|
if (!res.status) {
|
|
|
_context4.next = 8;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.error(res === null || res === void 0 ? void 0 : res.message);
|
|
|
return _context4.abrupt("return");
|
|
|
case 8:
|
|
|
if (res !== null && res !== void 0 && res.show) {
|
|
|
localStorage.setItem('extension-modal', 'exist');
|
|
|
localStorage.setItem('extension-date', res === null || res === void 0 ? void 0 : res.start_date);
|
|
|
} else {
|
|
|
localStorage.removeItem('extension-modal');
|
|
|
}
|
|
|
if (location.pathname === '/user/login' || location.pathname === '/login') {
|
|
|
from = searchParams.get("from") || searchParams.get("back_url");
|
|
|
if (from) {
|
|
|
window.location.href = decodeURIComponent(from);
|
|
|
} else {
|
|
|
//判断 如果密码强度过低 跳转修改密码页
|
|
|
if (!passwordReg.test(loginInfo.password)) {
|
|
|
message/* default */.ZP.info('系统检测您的密码强度过低,请及时修改');
|
|
|
window.location.href = '/account/secure';
|
|
|
} else {
|
|
|
window.location.reload();
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
if (!passwordReg.test(loginInfo.password)) {
|
|
|
message/* default */.ZP.info('系统检测您的密码强度过低,请及时修改');
|
|
|
_umi_production_exports.history.replace('/account/secure?active=3');
|
|
|
dispatch({
|
|
|
type: 'user/setBindAccountModal',
|
|
|
payload: {
|
|
|
bindAccountModalVisible: false
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
window.location.reload();
|
|
|
}
|
|
|
}
|
|
|
form.resetFields();
|
|
|
case 11:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
return function handleLogin() {
|
|
|
return _ref5.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var bindAndLogin = /*#__PURE__*/function () {
|
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
|
var successFlag;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
_context5.next = 2;
|
|
|
return handleBind();
|
|
|
case 2:
|
|
|
successFlag = _context5.sent;
|
|
|
if (!successFlag) {
|
|
|
_context5.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
_context5.next = 6;
|
|
|
return handleLogin();
|
|
|
case 6:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
}));
|
|
|
return function bindAndLogin() {
|
|
|
return _ref6.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(modal/* default */.Z, {
|
|
|
centered: true
|
|
|
// title="手机号/邮箱绑定"
|
|
|
,
|
|
|
open: isshow,
|
|
|
footer: null,
|
|
|
width: 596,
|
|
|
keyboard: false,
|
|
|
maskClosable: true,
|
|
|
wrapClassName: BindAccountPanelmodules.popLogin,
|
|
|
closable: true,
|
|
|
onCancel: onCancel,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("h1", {
|
|
|
className: "font18 mb20",
|
|
|
children: "\u624B\u673A\u53F7/\u90AE\u7BB1\u7ED1\u5B9A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
layout: "vertical",
|
|
|
form: form,
|
|
|
autoComplete: "off",
|
|
|
preserve: false,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "userInput",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入正确的手机号/邮箱'
|
|
|
}, {
|
|
|
validator: Validate
|
|
|
}],
|
|
|
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"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "code",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入验证码'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
suffix: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
loading: codeLoading,
|
|
|
type: "link",
|
|
|
onClick: handleGetCode,
|
|
|
disabled: getCodeBtnDisabled,
|
|
|
children: getCodeBtnDisabled ? "".concat(timer, "\u79D2\u53EF\u91CD\u65B0\u83B7\u53D6") : '获取验证码'
|
|
|
}),
|
|
|
style: {
|
|
|
paddingRight: 2,
|
|
|
height: 48
|
|
|
},
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",
|
|
|
size: 'middle'
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: BindAccountPanelmodules.tips,
|
|
|
children: "\u4E3A\u4E86\u8D26\u53F7\u5B89\u5168\u6027\uFF0C\u7ED1\u5B9A\u540E\u53EF\u901A\u8FC7\u8BE5\u624B\u673A\u53F7\u6216\u90AE\u7BB1\u627E\u56DE\u5BC6\u7801"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
size: 'middle',
|
|
|
type: "primary",
|
|
|
block: true,
|
|
|
style: inputStyle,
|
|
|
className: "font16",
|
|
|
onClick: bindAndLogin,
|
|
|
children: "\u7ED1\u5B9A\u5E76\u767B\u5F55"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: BindAccountPanelmodules.tips,
|
|
|
children: ["\u767B\u5F55\u5373\u4EE3\u8868\u60A8\u5DF2\u9605\u8BFB\u5E76\u540C\u610F", /*#__PURE__*/(0,jsx_runtime.jsx)("a", {
|
|
|
href: "https://engineer.educoder.net/help?index=4",
|
|
|
target: "_blank",
|
|
|
children: "\u300A\u670D\u52A1\u534F\u8BAE\u6761\u6B3E\u300B"
|
|
|
})]
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var User_BindAccountPanel = ((0,_umi_production_exports.connect)(function (_ref7) {
|
|
|
var user = _ref7.user,
|
|
|
loading = _ref7.loading,
|
|
|
globalSetting = _ref7.globalSetting;
|
|
|
return {
|
|
|
user: user,
|
|
|
globalSetting: globalSetting,
|
|
|
loading: loading.models.index
|
|
|
};
|
|
|
})(BindAccountPanel));
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/spin/index.js + 1 modules
|
|
|
var spin = __webpack_require__(71418);
|
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/dayjs.min.js
|
|
|
var dayjs_min = __webpack_require__(9498);
|
|
|
var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
|
|
|
// EXTERNAL MODULE: ./src/components/Header/index.tsx + 11 modules
|
|
|
var Header = __webpack_require__(13429);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/toConsumableArray.js
|
|
|
var toConsumableArray = __webpack_require__(93923);
|
|
|
var toConsumableArray_default = /*#__PURE__*/__webpack_require__.n(toConsumableArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.2@@babel/runtime/helpers/objectDestructuringEmpty.js
|
|
|
var objectDestructuringEmpty = __webpack_require__(27223);
|
|
|
var objectDestructuringEmpty_default = /*#__PURE__*/__webpack_require__.n(objectDestructuringEmpty);
|
|
|
;// CONCATENATED MODULE: ./src/components/PodModal/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var PodModalmodules = ({"wrap":"wrap___q9xAc","list":"list___qjgdz","name":"name___ncYhC","tag":"tag___Paafn"});
|
|
|
// EXTERNAL MODULE: ./src/components/mediator.js
|
|
|
var mediator = __webpack_require__(14279);
|
|
|
;// CONCATENATED MODULE: ./src/components/PodModal/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var PodModal = function PodModal(_ref) {
|
|
|
objectDestructuringEmpty_default()(_ref);
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
visible = _useState2[0],
|
|
|
setVisible = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
list = _useState4[0],
|
|
|
setList = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)([]),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
checkboxList = _useState6[0],
|
|
|
setCheckboxList = _useState6[1];
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
all = _useState8[0],
|
|
|
setAll = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
loading = _useState10[0],
|
|
|
setLoading = _useState10[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 () {
|
|
|
mediator/* default */.Z.subscribe('pod-restrict-data', function (data) {
|
|
|
console.log(data, 'data');
|
|
|
setVisible(data.identifier || false);
|
|
|
setList(data.data_list || []);
|
|
|
setCheckboxList([]);
|
|
|
setAll(false);
|
|
|
});
|
|
|
}, []);
|
|
|
var del = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var del_pods, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
setLoading(true);
|
|
|
del_pods = list.filter(function (e) {
|
|
|
return checkboxList.includes(e.tpi_id);
|
|
|
});
|
|
|
_context.next = 4;
|
|
|
return (0,fetch/* default */.ZP)("/api/myshixuns/batch_del_pods.json", {
|
|
|
method: 'delete',
|
|
|
body: {
|
|
|
del_pods: del_pods
|
|
|
}
|
|
|
});
|
|
|
case 4:
|
|
|
res = _context.sent;
|
|
|
if (res.status === 0) {
|
|
|
window.location.reload();
|
|
|
}
|
|
|
setLoading(false);
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function del() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var cancel = function cancel() {
|
|
|
var _location$pathname;
|
|
|
console.log(location, 'location');
|
|
|
if ((_location$pathname = location.pathname) !== null && _location$pathname !== void 0 && _location$pathname.includes('/challenges')) {
|
|
|
window.location.href = "/shixuns";
|
|
|
return;
|
|
|
}
|
|
|
if (searchParams.get("type") === 'exercises') {
|
|
|
window.parent.postMessage('backExercise', '*');
|
|
|
mediator/* default */.Z.publish('pod-restrict-data', {
|
|
|
identifier: false,
|
|
|
data_list: []
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
window.location.href = "/shixuns/".concat(visible, "/challenges");
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
centered: true,
|
|
|
keyboard: false,
|
|
|
destroyOnClose: true,
|
|
|
open: visible,
|
|
|
title: "\u901A\u77E5",
|
|
|
width: "600px",
|
|
|
footer: /*#__PURE__*/(0,jsx_runtime.jsxs)(row/* default */.Z, {
|
|
|
align: "middle",
|
|
|
justify: "center",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
onChange: function onChange(k) {
|
|
|
console.log(k, 222);
|
|
|
setAll(k.target.checked);
|
|
|
if (k.target.checked) {
|
|
|
var _list$filter;
|
|
|
setCheckboxList(list === null || list === void 0 || (_list$filter = list.filter(function (e) {
|
|
|
return !e.is_current_shixun;
|
|
|
})) === null || _list$filter === void 0 ? void 0 : _list$filter.map(function (e) {
|
|
|
return e.tpi_id;
|
|
|
}));
|
|
|
} else {
|
|
|
setCheckboxList([]);
|
|
|
}
|
|
|
},
|
|
|
checked: all,
|
|
|
children: "\u5168\u9009"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
style: {
|
|
|
marginLeft: 'auto'
|
|
|
},
|
|
|
onClick: cancel,
|
|
|
children: "\u53D6\u6D88"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
disabled: !checkboxList.length,
|
|
|
loading: loading,
|
|
|
type: "primary",
|
|
|
onClick: del,
|
|
|
children: "\u5173\u95ED\u5B9E\u8BAD"
|
|
|
})]
|
|
|
}),
|
|
|
onCancel: cancel,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
|
|
|
spinning: loading,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: PodModalmodules.wrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: "\u5355\u4E2A\u8D26\u53F7\u6700\u591A\u53EF\u540C\u65F6\u5F00\u542F10\u4E2A\u5B9E\u9A8C\u73AF\u5883\uFF0C\u82E5\u60F3\u5F00\u542F\u8BE5\u5B9E\u8BAD\u8BF7\u5173\u95ED\u5176\u4ED6\u5B9E\u8BAD\u3002"
|
|
|
}), list === null || list === void 0 ? void 0 : list.map(function (e) {
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: PodModalmodules.list,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_checkbox/* default */.Z, {
|
|
|
disabled: e.is_current_shixun,
|
|
|
onChange: function onChange(k) {
|
|
|
var newList = toConsumableArray_default()(checkboxList);
|
|
|
if (k.target.checked) {
|
|
|
newList.push(e.tpi_id);
|
|
|
} else {
|
|
|
newList = checkboxList.filter(function (j) {
|
|
|
return j !== e.tpi_id;
|
|
|
});
|
|
|
}
|
|
|
setCheckboxList(newList);
|
|
|
setAll(newList.length === list.length);
|
|
|
},
|
|
|
checked: checkboxList === null || checkboxList === void 0 ? void 0 : checkboxList.includes(e.tpi_id)
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
className: PodModalmodules.name,
|
|
|
onClick: function onClick() {
|
|
|
return (0,util/* openNewWindow */.xg)("/shixuns/".concat(e.shixun_identifier, "/challenges"));
|
|
|
},
|
|
|
title: e.shixun_name,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("b", {
|
|
|
children: e.shixun_name
|
|
|
}), e.is_current_shixun && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: PodModalmodules.tag,
|
|
|
children: "\u5F53\u524D\u5B9E\u8BAD"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("span", {
|
|
|
style: {
|
|
|
color: '#53d1a3'
|
|
|
},
|
|
|
children: ["\u8FD0\u884C\u4E2D\u7684\u73AF\u5883\uFF1A", e.pod_num, "\u4E2A"]
|
|
|
})]
|
|
|
}, e.tpi_id);
|
|
|
})]
|
|
|
})
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var components_PodModal = (PodModal);
|
|
|
;// CONCATENATED MODULE: ./src/styles/antd.theme.ts
|
|
|
var theme = {
|
|
|
token: {
|
|
|
colorPrimary: '#3061D0',
|
|
|
colorInfo: '#3061D0',
|
|
|
colorLink: '#3061D0',
|
|
|
borderRadius: 2,
|
|
|
fontSizeLG: 14
|
|
|
},
|
|
|
components: {
|
|
|
Radio: {
|
|
|
radioSize: 16,
|
|
|
dotSize: 6
|
|
|
},
|
|
|
Modal: {
|
|
|
titleFontSize: 16,
|
|
|
// titleLineHeight: 1,
|
|
|
titleColor: "#000"
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
/* harmony default export */ var antd_theme = (theme);
|
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/locale/zh-cn.js
|
|
|
var zh_cn = __webpack_require__(46789);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_cssinjs@1.17.2@@ant-design/cssinjs/es/index.js + 31 modules
|
|
|
var es = __webpack_require__(84608);
|
|
|
;// CONCATENATED MODULE: ./src/layouts/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["loading", "globalSetting", "user", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dayjs_min_default().locale('zh-cn');
|
|
|
var SimpleLayouts = function SimpleLayouts(_ref) {
|
|
|
var loading = _ref.loading,
|
|
|
globalSetting = _ref.globalSetting,
|
|
|
user = _ref.user,
|
|
|
dispatch = _ref.dispatch,
|
|
|
props = objectWithoutProperties_default()(_ref, _excluded);
|
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
|
var payload = (0,Header/* getCourseParam */.g)();
|
|
|
var globalLoading = globalSetting.globalLoading;
|
|
|
var getData = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() {
|
|
|
var _res;
|
|
|
var res, game_id, path, subject_id, _game_id;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
path = location.pathname.split("/");
|
|
|
if (!(location !== null && location !== void 0 && location.search)) {
|
|
|
_context.next = 9;
|
|
|
break;
|
|
|
}
|
|
|
if (path.includes("paths")) {
|
|
|
subject_id = path[2];
|
|
|
} else if (path.includes("tasks")) {
|
|
|
_game_id = path[2];
|
|
|
}
|
|
|
;
|
|
|
_context.next = 6;
|
|
|
return dispatch({
|
|
|
type: 'user/getUserInfo',
|
|
|
payload: objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({}, payload), (0,util/* getJsonFromUrl */.oP)()), {}, {
|
|
|
subject_id: subject_id,
|
|
|
game_id: _game_id,
|
|
|
websiteName: 'educoder'
|
|
|
})
|
|
|
});
|
|
|
case 6:
|
|
|
res = _context.sent;
|
|
|
_context.next = 14;
|
|
|
break;
|
|
|
case 9:
|
|
|
if (path.includes("tasks")) {
|
|
|
game_id = path[2];
|
|
|
}
|
|
|
;
|
|
|
_context.next = 13;
|
|
|
return dispatch({
|
|
|
type: 'user/getUserInfo',
|
|
|
payload: objectSpread2_default()(objectSpread2_default()({}, payload), {}, {
|
|
|
game_id: game_id
|
|
|
})
|
|
|
});
|
|
|
case 13:
|
|
|
res = _context.sent;
|
|
|
case 14:
|
|
|
if ((_res = res) !== null && _res !== void 0 && _res.username && location.pathname === '/login') {
|
|
|
_umi_production_exports.history.push("/");
|
|
|
}
|
|
|
case 15:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function getData() {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
// window.less.modifyVars({
|
|
|
// ...themes[globalSetting.theme]
|
|
|
// })
|
|
|
config_provider/* default */.ZP.config({
|
|
|
prefixCls: 'ant',
|
|
|
iconPrefixCls: 'anticon',
|
|
|
theme: objectSpread2_default()({}, antd_theme)
|
|
|
});
|
|
|
}, [globalSetting.theme]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
getData();
|
|
|
}, []);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
dispatch({
|
|
|
type: 'globalSetting/query',
|
|
|
payload: {}
|
|
|
});
|
|
|
}, []);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var _window$location$href, _window$location$href2;
|
|
|
if (location.pathname.indexOf("classrooms") > -1 && location.pathname.indexOf("detail") === -1) {} else {
|
|
|
document.body.scrollIntoView();
|
|
|
}
|
|
|
// 教育部考试系统
|
|
|
if (location.pathname.indexOf("/classrooms/4RW9CYHY") > -1 && document.domain !== "localhost" && document.domain !== "kepukehuan.educoder.net") {
|
|
|
window.location.href = "https://kepukehuan.educoder.net/classrooms/4RW9CYHY/exercise";
|
|
|
return;
|
|
|
}
|
|
|
if (location.pathname.indexOf("/classrooms/qb4ft587") > -1 && document.domain !== "localhost" && document.domain !== "kepukehuan.educoder.net") {
|
|
|
window.location.href = "https://kepukehuan.educoder.net/classrooms/qb4ft587/exercise";
|
|
|
return;
|
|
|
}
|
|
|
if (location.pathname.indexOf("/classrooms/c5q9bsp2") > -1 && document.domain !== "localhost" && document.domain !== "kepukehuan.educoder.net") {
|
|
|
window.location.href = "https://kepukehuan.educoder.net/classrooms/c5q9bsp2/exercise";
|
|
|
return;
|
|
|
}
|
|
|
dispatch({
|
|
|
type: "globalSetting/setGlobalLoading",
|
|
|
payload: {
|
|
|
show: false,
|
|
|
text: ""
|
|
|
}
|
|
|
});
|
|
|
// dispatch({ type: "globalSetting/getSystemUpdate", payload: { show: false, text: "" } })
|
|
|
// http://localhost:8000
|
|
|
// https://jetcoder.educoder.net
|
|
|
if (window.location.href === 'https://jetcoder.educoder.net' || window.location.href === 'https://jetcoder.educoder.net/') {
|
|
|
window.location.href = 'https://www.educoder.net/problems';
|
|
|
return;
|
|
|
}
|
|
|
//在线刷题分享
|
|
|
if ((_window$location$href = window.location.href) !== null && _window$location$href !== void 0 && _window$location$href.includes('/problems') && (_window$location$href2 = window.location.href) !== null && _window$location$href2 !== void 0 && _window$location$href2.includes('/share')) {
|
|
|
var _window$location;
|
|
|
var ojId = (_window$location = window.location) === null || _window$location === void 0 || (_window$location = _window$location.pathname) === null || _window$location === void 0 || (_window$location = _window$location.split('/')) === null || _window$location === void 0 ? void 0 : _window$location[2];
|
|
|
var p = (0,fetch/* default */.ZP)("/api/practices/".concat(ojId, "/start"), {
|
|
|
method: 'get'
|
|
|
});
|
|
|
p.then(function (res) {
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
_umi_production_exports.history.replace("/problems/".concat(res === null || res === void 0 ? void 0 : res.identifier, "/oj/").concat(ojId));
|
|
|
}
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
if (location.pathname === '/admins' || location.pathname === '/sidekiq') {
|
|
|
var domain = document.domain;
|
|
|
if (domain.indexOf("educoder.net") > -1) {
|
|
|
switch (domain) {
|
|
|
case "www.educoder.net":
|
|
|
case "educoder.net":
|
|
|
window.location.href = "https://data.educoder.net".concat(location.pathname);
|
|
|
break;
|
|
|
default:
|
|
|
var str = document.domain.split(".");
|
|
|
str[0] = str[0] + "-data";
|
|
|
window.location.href = "https://".concat(str.join(".")).concat(location.pathname);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
modal/* default */.Z.destroyAll();
|
|
|
if ((0,util/* isLocalApp */.WX)()) {
|
|
|
if ((0,util/* compareVersion */.yC)("2.0.0") > 0) {
|
|
|
modal/* default */.Z.info({
|
|
|
title: "客户端版本过低",
|
|
|
centered: true,
|
|
|
content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-red",
|
|
|
children: "\u60A8\u7684\u5934\u6B4C\u8003\u8BD5\u7CFB\u7EDF\u67DC\u5BA2\u6237\u7AEF\u7248\u672C\u8FC7\u4F4E"
|
|
|
}), "\uFF0C\u8BF7\u5347\u7EA7\u81F3\u6700\u65B0\u7248\u672C\u540E\u518D\u4F7F\u7528\uFF0C\u70B9\u51FB\"\u786E\u5B9A\"\u540E\u5C06\u4E0B\u8F7D\u6700\u65B0\u7248\u672C\u7684\u5BA2\u6237\u7AEF,", /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "c-red",
|
|
|
children: "\u4E0B\u8F7D\u540E\u8BF7\u5148\u9000\u51FA\u5BA2\u6237\u7AEF\u518D\u5B89\u88C5"
|
|
|
})]
|
|
|
}),
|
|
|
okText: "立即升级",
|
|
|
visible: true,
|
|
|
maskClosable: false,
|
|
|
onOk: function onOk() {
|
|
|
(0,util/* downLoadFile */.FH)("Educoder.exe", "https://www-cdn.educoder.net/app/Educoder.exe");
|
|
|
return new Promise(function () {});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
;
|
|
|
}
|
|
|
|
|
|
// setLocale('zh-CN', false);
|
|
|
}, [location.pathname]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (globalSetting.updateData.system_update) {
|
|
|
// if(new Date().getTime() < new Date(globalSetting.updateData.end_time).getTime())
|
|
|
if (!localStorage.updateEndTime) {
|
|
|
if (new Date().getTime() < new Date(globalSetting.updateData.end_time).getTime()) modal/* default */.Z.info({
|
|
|
title: globalSetting.updateData.subject,
|
|
|
content: globalSetting.updateData.system_score,
|
|
|
onOk: function onOk() {
|
|
|
localStorage.updateEndTime = globalSetting.updateData.end_time;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
} else {
|
|
|
localStorage.removeItem("updateEndTime");
|
|
|
}
|
|
|
}, [globalSetting.updateData.system_update]);
|
|
|
var toTrackEvent = function toTrackEvent() {
|
|
|
var _user$userInfo;
|
|
|
var trackUserTime = localStorage.trackUserTime;
|
|
|
var trackUser = localStorage.trackUser;
|
|
|
if (trackUserTime && dayjs_min_default()(trackUserTime).isSame(dayjs_min_default()().startOf('day'), 'd') && trackUser == ((_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.login)) {} else {
|
|
|
var _user$userInfo2, _user$userInfo3, _user$userInfo4, _user$userInfo5;
|
|
|
localStorage.trackUserTime = new Date();
|
|
|
localStorage.trackUser = (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.login;
|
|
|
var text = '';
|
|
|
switch (user.userInfo.role) {
|
|
|
case 1:
|
|
|
text = '超管';
|
|
|
break;
|
|
|
case 2:
|
|
|
text = '运营';
|
|
|
break;
|
|
|
case 5:
|
|
|
text = '认证教师';
|
|
|
break;
|
|
|
case 12:
|
|
|
text = '未认证教师';
|
|
|
break;
|
|
|
case 15:
|
|
|
text = '学生';
|
|
|
break;
|
|
|
}
|
|
|
if (((_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.identity) !== 'student' && ((_user$userInfo4 = user.userInfo) === null || _user$userInfo4 === void 0 ? void 0 : _user$userInfo4.identity) !== 'teacher') {
|
|
|
text = '专业人士';
|
|
|
}
|
|
|
if ((_user$userInfo5 = user.userInfo) !== null && _user$userInfo5 !== void 0 && _user$userInfo5.user_school) {
|
|
|
var _user$userInfo6, _user$userInfo7, _user$userInfo8;
|
|
|
(0,util/* trackEvent */.L9)(['学校活跃用户', (_user$userInfo6 = user.userInfo) === null || _user$userInfo6 === void 0 ? void 0 : _user$userInfo6.user_school]);
|
|
|
(0,util/* trackEvent */.L9)(['用户访问明细', (_user$userInfo7 = user.userInfo) === null || _user$userInfo7 === void 0 ? void 0 : _user$userInfo7.login, (_user$userInfo8 = user.userInfo) === null || _user$userInfo8 === void 0 ? void 0 : _user$userInfo8.user_school]);
|
|
|
}
|
|
|
(0,util/* trackEvent */.L9)(['平台PC端', '总活跃用户数']);
|
|
|
(0,util/* trackEvent */.L9)(['平台PC端', text]);
|
|
|
}
|
|
|
};
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsx)(es.StyleProvider, {
|
|
|
transformers: [es.legacyLogicalPropertiesTransformer],
|
|
|
hashPriority: "high",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)(config_provider/* default */.ZP, {
|
|
|
locale: zh_CN/* default */.Z,
|
|
|
autoInsertSpaceInButton: false,
|
|
|
componentSize: "middle",
|
|
|
theme: antd_theme,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(PopLogin, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(User_BindAccountPanel, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(components_PodModal, {}), /*#__PURE__*/(0,jsx_runtime.jsx)(spin/* default */.Z, {
|
|
|
size: 'middle',
|
|
|
spinning: globalLoading.show,
|
|
|
tip: globalLoading.text,
|
|
|
className: "ant-spin-nested-loading-black",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Outlet, {})
|
|
|
})]
|
|
|
})
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var layouts = ((0,_umi_production_exports.connect)(function (_ref3) {
|
|
|
var loading = _ref3.loading,
|
|
|
globalSetting = _ref3.globalSetting,
|
|
|
user = _ref3.user;
|
|
|
return {
|
|
|
loading: loading,
|
|
|
globalSetting: globalSetting,
|
|
|
user: user
|
|
|
};
|
|
|
})(SimpleLayouts));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 44000:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/layout/index.js ***!
|
|
|
\**********************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./layout */ 84966);
|
|
|
/* harmony import */ var _Sider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Sider */ 37534);
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
const Layout = _layout__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .ZP;
|
|
|
Layout.Header = _layout__WEBPACK_IMPORTED_MODULE_0__/* .Header */ .h4;
|
|
|
Layout.Footer = _layout__WEBPACK_IMPORTED_MODULE_0__/* .Footer */ .$_;
|
|
|
Layout.Content = _layout__WEBPACK_IMPORTED_MODULE_0__/* .Content */ .VY;
|
|
|
Layout.Sider = _Sider__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z;
|
|
|
/* harmony default export */ __webpack_exports__.Z = (Layout);
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |