|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[41717,64802,34668,54512],{
|
|
|
|
|
|
/***/ 15997:
|
|
|
/*!*****************************************************************************************************!*\
|
|
|
!*** ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/EyeOutlined.js + 1 modules ***!
|
|
|
\*****************************************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ icons_EyeOutlined; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.5@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(61796);
|
|
|
// 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/EyeOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var EyeOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" } }] }, "name": "eye", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_EyeOutlined = (EyeOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.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/EyeOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var EyeOutlined_EyeOutlined = function EyeOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_EyeOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_EyeOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(EyeOutlined_EyeOutlined));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 47739:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./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
|
|
|
var _umi_production_exports = __webpack_require__(45295);
|
|
|
// 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__(12538);
|
|
|
// 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/utils/env.ts + 1 modules
|
|
|
var env = __webpack_require__(78130);
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/LoginPanel/index.less
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
|
|
|
// 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 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)(0),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
changeImgNum = _useState4[0],
|
|
|
setChangeImgNum = _useState4[1];
|
|
|
var password = /^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{8,16}$/;
|
|
|
var imgSrc = (0,_react_17_0_2_react.useMemo)(function () {
|
|
|
return '/rucaptcha?t=' + new Date().getTime();
|
|
|
}, [changeImgNum]);
|
|
|
var onFinish = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(values) {
|
|
|
var res, _location$query, _location$query2, from;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
_context.next = 2;
|
|
|
return (0,service_user/* LoginIn */.Es)(values);
|
|
|
case 2:
|
|
|
res = _context.sent;
|
|
|
if (!res.status) {
|
|
|
_context.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
setErrorValue(res === null || res === void 0 ? void 0 : res.message);
|
|
|
return _context.abrupt("return");
|
|
|
case 6:
|
|
|
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');
|
|
|
}
|
|
|
console.log(_umi_production_exports.history, 'history');
|
|
|
if (location.pathname === '/user/login' || location.pathname === '/login') {
|
|
|
from = ((_location$query = location.query) === null || _location$query === void 0 ? void 0 : _location$query.from) || ((_location$query2 = location.query) === null || _location$query2 === void 0 ? void 0 : _location$query2.back_url);
|
|
|
if (from) {
|
|
|
window.location.href = decodeURIComponent(from);
|
|
|
} else {
|
|
|
//判断 如果密码强度过低 跳转修改密码页
|
|
|
if (!password.test(values.password)) {
|
|
|
message/* default */.ZP.info('系统检测您的密码强度过低,请及时修改');
|
|
|
window.location.href = '/account/secure';
|
|
|
} else {
|
|
|
window.location.reload();
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
// if(!password.test(values.password)){
|
|
|
// message.info('系统检测您的密码强度过低,请及时修改')
|
|
|
// history.replace('/account/secure?active=3')
|
|
|
// dispatch({
|
|
|
// type: 'user/showPopLogin',
|
|
|
// payload: { showPopLogin: false },
|
|
|
// })
|
|
|
// }else{
|
|
|
window.location.reload();
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
form.resetFields();
|
|
|
case 10:
|
|
|
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)(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: "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: "large",
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u624B\u673A\u53F7/\u90AE\u7BB1\u53F7/\u8D26\u53F7/\u5DE5\u53F7/\u5B66\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: "large",
|
|
|
placeholder: "\u5BC6\u7801"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "code",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入验证码'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
display: 'flex'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
style: inputStyle
|
|
|
// visibilityToggle={false}
|
|
|
,
|
|
|
size: "large",
|
|
|
placeholder: "\u9A8C\u8BC1\u7801"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("img", {
|
|
|
src: (env/* default */.Z === null || env/* default */.Z === void 0 ? void 0 : env/* default */.Z.API_SERVER) + imgSrc,
|
|
|
style: {
|
|
|
height: '32px',
|
|
|
marginLeft: '10px'
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
// setImgsrc(ImgSrc)
|
|
|
setChangeImgNum(changeImgNum + 1);
|
|
|
// "this.src = '/rucaptcha/?t=' + Date.now();"
|
|
|
}
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__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",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
className: "c-grey-333 font14",
|
|
|
onClick: function onClick() {
|
|
|
return handleClick();
|
|
|
},
|
|
|
to: "/user/reset-password?from=".concat(location.pathname),
|
|
|
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: "large",
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
block: true,
|
|
|
className: "font16",
|
|
|
style: inputStyle,
|
|
|
children: "\u767B\u5F55"
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* 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: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(6848);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(22739);
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/RegisterPanel/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var RegisterPanel_inputStyle = {
|
|
|
height: 48
|
|
|
};
|
|
|
var loginRegex = /(\b[\w\.-]+@[\w\.-]+\.\w{2,4}\b)|(^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$)/i;
|
|
|
var RegisterPanel_password = /^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{8,16}$/;
|
|
|
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 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],
|
|
|
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 (!(!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: 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: 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
|
|
|
},
|
|
|
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
|
|
|
};
|
|
|
})(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"});
|
|
|
;// 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"
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
}
|
|
|
;// 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.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"});
|
|
|
;// 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 _callee4(values) {
|
|
|
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 = 8;
|
|
|
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('修改成功');
|
|
|
return _context4.abrupt("return", '/');
|
|
|
case 8:
|
|
|
return _context4.abrupt("return", response);
|
|
|
case 9:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
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.jsx)(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")
|
|
|
});
|
|
|
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>}
|
|
|
,
|
|
|
visible: 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__(91506);
|
|
|
;// 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 + 7 modules
|
|
|
var Header = __webpack_require__(44875);
|
|
|
// 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__(6655);
|
|
|
;// 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.18.0@@ant-design/cssinjs/es/index.js + 35 modules
|
|
|
var es = __webpack_require__(67937);
|
|
|
;// CONCATENATED MODULE: ./src/layouts/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["loading", "globalSetting", "user", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// import themes from '@/styles/';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
}, [location.pathname]);
|
|
|
(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/query',
|
|
|
payload: {}
|
|
|
});
|
|
|
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));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 24905:
|
|
|
/*!************************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js + 3 modules ***!
|
|
|
\************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ es_checkbox; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.3.2@classnames/index.js
|
|
|
var _classnames_2_3_2_classnames = __webpack_require__(12124);
|
|
|
var _classnames_2_3_2_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_2_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-checkbox@3.1.0@rc-checkbox/es/index.js
|
|
|
var es = __webpack_require__(5630);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
|
var config_provider_context = __webpack_require__(36355);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/DisabledContext.js
|
|
|
var DisabledContext = __webpack_require__(1684);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/context.js
|
|
|
var context = __webpack_require__(32441);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/GroupContext.js
|
|
|
|
|
|
const GroupContext = /*#__PURE__*/_react_17_0_2_react.createContext(null);
|
|
|
/* harmony default export */ var checkbox_GroupContext = (GroupContext);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/style/index.js
|
|
|
var checkbox_style = __webpack_require__(98447);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/wave/index.js + 4 modules
|
|
|
var wave = __webpack_require__(14088);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/wave/interface.js
|
|
|
var wave_interface = __webpack_require__(4572);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/Checkbox.js
|
|
|
"use client";
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalCheckbox = (props, ref) => {
|
|
|
var _a;
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
children,
|
|
|
indeterminate = false,
|
|
|
style,
|
|
|
onMouseEnter,
|
|
|
onMouseLeave,
|
|
|
skipGroup = false,
|
|
|
disabled
|
|
|
} = props,
|
|
|
restProps = __rest(props, ["prefixCls", "className", "rootClassName", "children", "indeterminate", "style", "onMouseEnter", "onMouseLeave", "skipGroup", "disabled"]);
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction,
|
|
|
checkbox
|
|
|
} = _react_17_0_2_react.useContext(config_provider_context/* ConfigContext */.E_);
|
|
|
const checkboxGroup = _react_17_0_2_react.useContext(checkbox_GroupContext);
|
|
|
const {
|
|
|
isFormItemInput
|
|
|
} = _react_17_0_2_react.useContext(context/* FormItemInputContext */.aM);
|
|
|
const contextDisabled = _react_17_0_2_react.useContext(DisabledContext/* default */.Z);
|
|
|
const mergedDisabled = (_a = (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.disabled) || disabled) !== null && _a !== void 0 ? _a : contextDisabled;
|
|
|
const prevValue = _react_17_0_2_react.useRef(restProps.value);
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
|
|
|
false ? 0 : void 0;
|
|
|
}, []);
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if (skipGroup) {
|
|
|
return;
|
|
|
}
|
|
|
if (restProps.value !== prevValue.current) {
|
|
|
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(prevValue.current);
|
|
|
checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);
|
|
|
prevValue.current = restProps.value;
|
|
|
}
|
|
|
return () => checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(restProps.value);
|
|
|
}, [restProps.value]);
|
|
|
const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
|
const [wrapSSR, hashId] = (0,checkbox_style/* default */.ZP)(prefixCls);
|
|
|
const checkboxProps = Object.assign({}, restProps);
|
|
|
if (checkboxGroup && !skipGroup) {
|
|
|
checkboxProps.onChange = function () {
|
|
|
if (restProps.onChange) {
|
|
|
restProps.onChange.apply(restProps, arguments);
|
|
|
}
|
|
|
if (checkboxGroup.toggleOption) {
|
|
|
checkboxGroup.toggleOption({
|
|
|
label: children,
|
|
|
value: restProps.value
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
checkboxProps.name = checkboxGroup.name;
|
|
|
checkboxProps.checked = checkboxGroup.value.includes(restProps.value);
|
|
|
}
|
|
|
const classString = _classnames_2_3_2_classnames_default()(`${prefixCls}-wrapper`, {
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
|
[`${prefixCls}-wrapper-checked`]: checkboxProps.checked,
|
|
|
[`${prefixCls}-wrapper-disabled`]: mergedDisabled,
|
|
|
[`${prefixCls}-wrapper-in-form-item`]: isFormItemInput
|
|
|
}, checkbox === null || checkbox === void 0 ? void 0 : checkbox.className, className, rootClassName, hashId);
|
|
|
const checkboxClass = _classnames_2_3_2_classnames_default()({
|
|
|
[`${prefixCls}-indeterminate`]: indeterminate
|
|
|
}, wave_interface/* TARGET_CLS */.A, hashId);
|
|
|
const ariaChecked = indeterminate ? 'mixed' : undefined;
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(wave/* default */.Z, {
|
|
|
component: "Checkbox",
|
|
|
disabled: mergedDisabled
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement("label", {
|
|
|
className: classString,
|
|
|
style: Object.assign(Object.assign({}, checkbox === null || checkbox === void 0 ? void 0 : checkbox.style), style),
|
|
|
onMouseEnter: onMouseEnter,
|
|
|
onMouseLeave: onMouseLeave
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(es/* default */.Z, Object.assign({
|
|
|
"aria-checked": ariaChecked
|
|
|
}, checkboxProps, {
|
|
|
prefixCls: prefixCls,
|
|
|
className: checkboxClass,
|
|
|
disabled: mergedDisabled,
|
|
|
ref: ref
|
|
|
})), children !== undefined && /*#__PURE__*/_react_17_0_2_react.createElement("span", null, children))));
|
|
|
};
|
|
|
const Checkbox = /*#__PURE__*/_react_17_0_2_react.forwardRef(InternalCheckbox);
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var checkbox_Checkbox = (Checkbox);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.5@@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
|
|
|
var toConsumableArray = __webpack_require__(40877);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/omit.js
|
|
|
var omit = __webpack_require__(99468);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/Group.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
var Group_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const InternalGroup = (props, ref) => {
|
|
|
const {
|
|
|
defaultValue,
|
|
|
children,
|
|
|
options = [],
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
style,
|
|
|
onChange
|
|
|
} = props,
|
|
|
restProps = Group_rest(props, ["defaultValue", "children", "options", "prefixCls", "className", "rootClassName", "style", "onChange"]);
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction
|
|
|
} = _react_17_0_2_react.useContext(config_provider_context/* ConfigContext */.E_);
|
|
|
const [value, setValue] = _react_17_0_2_react.useState(restProps.value || defaultValue || []);
|
|
|
const [registeredValues, setRegisteredValues] = _react_17_0_2_react.useState([]);
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if ('value' in restProps) {
|
|
|
setValue(restProps.value || []);
|
|
|
}
|
|
|
}, [restProps.value]);
|
|
|
const memoOptions = _react_17_0_2_react.useMemo(() => options.map(option => {
|
|
|
if (typeof option === 'string' || typeof option === 'number') {
|
|
|
return {
|
|
|
label: option,
|
|
|
value: option
|
|
|
};
|
|
|
}
|
|
|
return option;
|
|
|
}), [options]);
|
|
|
const cancelValue = val => {
|
|
|
setRegisteredValues(prevValues => prevValues.filter(v => v !== val));
|
|
|
};
|
|
|
const registerValue = val => {
|
|
|
setRegisteredValues(prevValues => [].concat((0,toConsumableArray/* default */.Z)(prevValues), [val]));
|
|
|
};
|
|
|
const toggleOption = option => {
|
|
|
const optionIndex = value.indexOf(option.value);
|
|
|
const newValue = (0,toConsumableArray/* default */.Z)(value);
|
|
|
if (optionIndex === -1) {
|
|
|
newValue.push(option.value);
|
|
|
} else {
|
|
|
newValue.splice(optionIndex, 1);
|
|
|
}
|
|
|
if (!('value' in restProps)) {
|
|
|
setValue(newValue);
|
|
|
}
|
|
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue.filter(val => registeredValues.includes(val)).sort((a, b) => {
|
|
|
const indexA = memoOptions.findIndex(opt => opt.value === a);
|
|
|
const indexB = memoOptions.findIndex(opt => opt.value === b);
|
|
|
return indexA - indexB;
|
|
|
}));
|
|
|
};
|
|
|
const prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
|
const groupPrefixCls = `${prefixCls}-group`;
|
|
|
const [wrapSSR, hashId] = (0,checkbox_style/* default */.ZP)(prefixCls);
|
|
|
const domProps = (0,omit/* default */.Z)(restProps, ['value', 'disabled']);
|
|
|
const childrenNode = options.length ? memoOptions.map(option => /*#__PURE__*/_react_17_0_2_react.createElement(checkbox_Checkbox, {
|
|
|
prefixCls: prefixCls,
|
|
|
key: option.value.toString(),
|
|
|
disabled: 'disabled' in option ? option.disabled : restProps.disabled,
|
|
|
value: option.value,
|
|
|
checked: value.includes(option.value),
|
|
|
onChange: option.onChange,
|
|
|
className: `${groupPrefixCls}-item`,
|
|
|
style: option.style,
|
|
|
title: option.title
|
|
|
}, option.label)) : children;
|
|
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
|
const context = {
|
|
|
toggleOption,
|
|
|
value,
|
|
|
disabled: restProps.disabled,
|
|
|
name: restProps.name,
|
|
|
// https://github.com/ant-design/ant-design/issues/16376
|
|
|
registerValue,
|
|
|
cancelValue
|
|
|
};
|
|
|
const classString = _classnames_2_3_2_classnames_default()(groupPrefixCls, {
|
|
|
[`${groupPrefixCls}-rtl`]: direction === 'rtl'
|
|
|
}, className, rootClassName, hashId);
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({
|
|
|
className: classString,
|
|
|
style: style
|
|
|
}, domProps, {
|
|
|
ref: ref
|
|
|
}), /*#__PURE__*/_react_17_0_2_react.createElement(checkbox_GroupContext.Provider, {
|
|
|
value: context
|
|
|
}, childrenNode)));
|
|
|
};
|
|
|
|
|
|
const CheckboxGroup = /*#__PURE__*/_react_17_0_2_react.forwardRef(InternalGroup);
|
|
|
/* harmony default export */ var Group = (/*#__PURE__*/_react_17_0_2_react.memo(CheckboxGroup));
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/checkbox/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
const es_checkbox_Checkbox = checkbox_Checkbox;
|
|
|
es_checkbox_Checkbox.Group = Group;
|
|
|
es_checkbox_Checkbox.__ANT_CHECKBOX = true;
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var es_checkbox = (es_checkbox_Checkbox);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 98447:
|
|
|
/*!******************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/checkbox/style/index.js ***!
|
|
|
\******************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ C2: function() { return /* binding */ getStyle; }
|
|
|
/* harmony export */ });
|
|
|
/* unused harmony export genCheckboxStyle */
|
|
|
/* harmony import */ var _style__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../style */ 17313);
|
|
|
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../theme/internal */ 37613);
|
|
|
/* harmony import */ var _theme_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/internal */ 83116);
|
|
|
|
|
|
|
|
|
// ============================== Styles ==============================
|
|
|
const genCheckboxStyle = token => {
|
|
|
const {
|
|
|
checkboxCls
|
|
|
} = token;
|
|
|
const wrapperCls = `${checkboxCls}-wrapper`;
|
|
|
return [
|
|
|
// ===================== Basic =====================
|
|
|
{
|
|
|
// Group
|
|
|
[`${checkboxCls}-group`]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .resetComponent */ .Wf)(token)), {
|
|
|
display: 'inline-flex',
|
|
|
flexWrap: 'wrap',
|
|
|
columnGap: token.marginXS,
|
|
|
// Group > Grid
|
|
|
[`> ${token.antCls}-row`]: {
|
|
|
flex: 1
|
|
|
}
|
|
|
}),
|
|
|
// Wrapper
|
|
|
[wrapperCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .resetComponent */ .Wf)(token)), {
|
|
|
display: 'inline-flex',
|
|
|
alignItems: 'baseline',
|
|
|
cursor: 'pointer',
|
|
|
// Fix checkbox & radio in flex align #30260
|
|
|
'&:after': {
|
|
|
display: 'inline-block',
|
|
|
width: 0,
|
|
|
overflow: 'hidden',
|
|
|
content: "'\\a0'"
|
|
|
},
|
|
|
// Checkbox near checkbox
|
|
|
[`& + ${wrapperCls}`]: {
|
|
|
marginInlineStart: 0
|
|
|
},
|
|
|
[`&${wrapperCls}-in-form-item`]: {
|
|
|
'input[type="checkbox"]': {
|
|
|
width: 14,
|
|
|
height: 14 // FIXME: magic
|
|
|
}
|
|
|
}
|
|
|
}),
|
|
|
|
|
|
// Wrapper > Checkbox
|
|
|
[checkboxCls]: Object.assign(Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .resetComponent */ .Wf)(token)), {
|
|
|
position: 'relative',
|
|
|
whiteSpace: 'nowrap',
|
|
|
lineHeight: 1,
|
|
|
cursor: 'pointer',
|
|
|
borderRadius: token.borderRadiusSM,
|
|
|
// To make alignment right when `controlHeight` is changed
|
|
|
// Ref: https://github.com/ant-design/ant-design/issues/41564
|
|
|
alignSelf: 'center',
|
|
|
// Wrapper > Checkbox > input
|
|
|
[`${checkboxCls}-input`]: {
|
|
|
position: 'absolute',
|
|
|
// Since baseline align will get additional space offset,
|
|
|
// we need to move input to top to make it align with text.
|
|
|
// Ref: https://github.com/ant-design/ant-design/issues/38926#issuecomment-1486137799
|
|
|
inset: 0,
|
|
|
zIndex: 1,
|
|
|
cursor: 'pointer',
|
|
|
opacity: 0,
|
|
|
margin: 0,
|
|
|
[`&:focus-visible + ${checkboxCls}-inner`]: Object.assign({}, (0,_style__WEBPACK_IMPORTED_MODULE_0__/* .genFocusOutline */ .oN)(token))
|
|
|
},
|
|
|
// Wrapper > Checkbox > inner
|
|
|
[`${checkboxCls}-inner`]: {
|
|
|
boxSizing: 'border-box',
|
|
|
position: 'relative',
|
|
|
top: 0,
|
|
|
insetInlineStart: 0,
|
|
|
display: 'block',
|
|
|
width: token.checkboxSize,
|
|
|
height: token.checkboxSize,
|
|
|
direction: 'ltr',
|
|
|
backgroundColor: token.colorBgContainer,
|
|
|
border: `${token.lineWidth}px ${token.lineType} ${token.colorBorder}`,
|
|
|
borderRadius: token.borderRadiusSM,
|
|
|
borderCollapse: 'separate',
|
|
|
transition: `all ${token.motionDurationSlow}`,
|
|
|
'&:after': {
|
|
|
boxSizing: 'border-box',
|
|
|
position: 'absolute',
|
|
|
top: '50%',
|
|
|
insetInlineStart: '21.5%',
|
|
|
display: 'table',
|
|
|
width: token.checkboxSize / 14 * 5,
|
|
|
height: token.checkboxSize / 14 * 8,
|
|
|
border: `${token.lineWidthBold}px solid ${token.colorWhite}`,
|
|
|
borderTop: 0,
|
|
|
borderInlineStart: 0,
|
|
|
transform: 'rotate(45deg) scale(0) translate(-50%,-50%)',
|
|
|
opacity: 0,
|
|
|
content: '""',
|
|
|
transition: `all ${token.motionDurationFast} ${token.motionEaseInBack}, opacity ${token.motionDurationFast}`
|
|
|
}
|
|
|
},
|
|
|
// Wrapper > Checkbox + Text
|
|
|
'& + span': {
|
|
|
paddingInlineStart: token.paddingXS,
|
|
|
paddingInlineEnd: token.paddingXS
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// ===================== Hover =====================
|
|
|
{
|
|
|
// Wrapper & Wrapper > Checkbox
|
|
|
[`
|
|
|
${wrapperCls}:not(${wrapperCls}-disabled),
|
|
|
${checkboxCls}:not(${checkboxCls}-disabled)
|
|
|
`]: {
|
|
|
[`&:hover ${checkboxCls}-inner`]: {
|
|
|
borderColor: token.colorPrimary
|
|
|
}
|
|
|
},
|
|
|
[`${wrapperCls}:not(${wrapperCls}-disabled)`]: {
|
|
|
[`&:hover ${checkboxCls}-checked:not(${checkboxCls}-disabled) ${checkboxCls}-inner`]: {
|
|
|
backgroundColor: token.colorPrimaryHover,
|
|
|
borderColor: 'transparent'
|
|
|
},
|
|
|
[`&:hover ${checkboxCls}-checked:not(${checkboxCls}-disabled):after`]: {
|
|
|
borderColor: token.colorPrimaryHover
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
// ==================== Checked ====================
|
|
|
{
|
|
|
// Wrapper > Checkbox
|
|
|
[`${checkboxCls}-checked`]: {
|
|
|
[`${checkboxCls}-inner`]: {
|
|
|
backgroundColor: token.colorPrimary,
|
|
|
borderColor: token.colorPrimary,
|
|
|
'&:after': {
|
|
|
opacity: 1,
|
|
|
transform: 'rotate(45deg) scale(1) translate(-50%,-50%)',
|
|
|
transition: `all ${token.motionDurationMid} ${token.motionEaseOutBack} ${token.motionDurationFast}`
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
[`
|
|
|
${wrapperCls}-checked:not(${wrapperCls}-disabled),
|
|
|
${checkboxCls}-checked:not(${checkboxCls}-disabled)
|
|
|
`]: {
|
|
|
[`&:hover ${checkboxCls}-inner`]: {
|
|
|
backgroundColor: token.colorPrimaryHover,
|
|
|
borderColor: 'transparent'
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
// ================= Indeterminate =================
|
|
|
{
|
|
|
[checkboxCls]: {
|
|
|
'&-indeterminate': {
|
|
|
// Wrapper > Checkbox > inner
|
|
|
[`${checkboxCls}-inner`]: {
|
|
|
backgroundColor: token.colorBgContainer,
|
|
|
borderColor: token.colorBorder,
|
|
|
'&:after': {
|
|
|
top: '50%',
|
|
|
insetInlineStart: '50%',
|
|
|
width: token.fontSizeLG / 2,
|
|
|
height: token.fontSizeLG / 2,
|
|
|
backgroundColor: token.colorPrimary,
|
|
|
border: 0,
|
|
|
transform: 'translate(-50%, -50%) scale(1)',
|
|
|
opacity: 1,
|
|
|
content: '""'
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
// ==================== Disable ====================
|
|
|
{
|
|
|
// Wrapper
|
|
|
[`${wrapperCls}-disabled`]: {
|
|
|
cursor: 'not-allowed'
|
|
|
},
|
|
|
// Wrapper > Checkbox
|
|
|
[`${checkboxCls}-disabled`]: {
|
|
|
// Wrapper > Checkbox > input
|
|
|
[`&, ${checkboxCls}-input`]: {
|
|
|
cursor: 'not-allowed',
|
|
|
// Disabled for native input to enable Tooltip event handler
|
|
|
// ref: https://github.com/ant-design/ant-design/issues/39822#issuecomment-1365075901
|
|
|
pointerEvents: 'none'
|
|
|
},
|
|
|
// Wrapper > Checkbox > inner
|
|
|
[`${checkboxCls}-inner`]: {
|
|
|
background: token.colorBgContainerDisabled,
|
|
|
borderColor: token.colorBorder,
|
|
|
'&:after': {
|
|
|
borderColor: token.colorTextDisabled
|
|
|
}
|
|
|
},
|
|
|
'&:after': {
|
|
|
display: 'none'
|
|
|
},
|
|
|
'& + span': {
|
|
|
color: token.colorTextDisabled
|
|
|
},
|
|
|
[`&${checkboxCls}-indeterminate ${checkboxCls}-inner::after`]: {
|
|
|
background: token.colorTextDisabled
|
|
|
}
|
|
|
}
|
|
|
}];
|
|
|
};
|
|
|
// ============================== Export ==============================
|
|
|
function getStyle(prefixCls, token) {
|
|
|
const checkboxToken = (0,_theme_internal__WEBPACK_IMPORTED_MODULE_1__/* .merge */ .TS)(token, {
|
|
|
checkboxCls: `.${prefixCls}`,
|
|
|
checkboxSize: token.controlInteractiveSize
|
|
|
});
|
|
|
return [genCheckboxStyle(checkboxToken)];
|
|
|
}
|
|
|
/* harmony default export */ __webpack_exports__.ZP = ((0,_theme_internal__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z)('Checkbox', (token, _ref) => {
|
|
|
let {
|
|
|
prefixCls
|
|
|
} = _ref;
|
|
|
return [getStyle(prefixCls, token)];
|
|
|
}));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 38854:
|
|
|
/*!************************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js + 1 modules ***!
|
|
|
\************************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ es_dropdown; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/dropdown.js
|
|
|
var dropdown = __webpack_require__(91857);
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.3.2@classnames/index.js
|
|
|
var _classnames_2_3_2_classnames = __webpack_require__(12124);
|
|
|
var _classnames_2_3_2_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_2_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/EllipsisOutlined.js + 1 modules
|
|
|
var EllipsisOutlined = __webpack_require__(93319);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(36355);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/index.js + 3 modules
|
|
|
var space = __webpack_require__(81327);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/Compact.js
|
|
|
var Compact = __webpack_require__(33234);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/style/index.js + 1 modules
|
|
|
var style = __webpack_require__(47211);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/dropdown-button.js
|
|
|
"use client";
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const DropdownButton = props => {
|
|
|
const {
|
|
|
getPopupContainer: getContextPopupContainer,
|
|
|
getPrefixCls,
|
|
|
direction
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
type = 'default',
|
|
|
danger,
|
|
|
disabled,
|
|
|
loading,
|
|
|
onClick,
|
|
|
htmlType,
|
|
|
children,
|
|
|
className,
|
|
|
menu,
|
|
|
arrow,
|
|
|
autoFocus,
|
|
|
overlay,
|
|
|
trigger,
|
|
|
align,
|
|
|
open,
|
|
|
onOpenChange,
|
|
|
placement,
|
|
|
getPopupContainer,
|
|
|
href,
|
|
|
icon = /*#__PURE__*/_react_17_0_2_react.createElement(EllipsisOutlined/* default */.Z, null),
|
|
|
title,
|
|
|
buttonsRender = buttons => buttons,
|
|
|
mouseEnterDelay,
|
|
|
mouseLeaveDelay,
|
|
|
overlayClassName,
|
|
|
overlayStyle,
|
|
|
destroyPopupOnHide,
|
|
|
dropdownRender
|
|
|
} = props,
|
|
|
restProps = __rest(props, ["prefixCls", "type", "danger", "disabled", "loading", "onClick", "htmlType", "children", "className", "menu", "arrow", "autoFocus", "overlay", "trigger", "align", "open", "onOpenChange", "placement", "getPopupContainer", "href", "icon", "title", "buttonsRender", "mouseEnterDelay", "mouseLeaveDelay", "overlayClassName", "overlayStyle", "destroyPopupOnHide", "dropdownRender"]);
|
|
|
const prefixCls = getPrefixCls('dropdown', customizePrefixCls);
|
|
|
const buttonPrefixCls = `${prefixCls}-button`;
|
|
|
const [wrapSSR, hashId] = (0,style/* default */.Z)(prefixCls);
|
|
|
const dropdownProps = {
|
|
|
menu,
|
|
|
arrow,
|
|
|
autoFocus,
|
|
|
align,
|
|
|
disabled,
|
|
|
trigger: disabled ? [] : trigger,
|
|
|
onOpenChange,
|
|
|
getPopupContainer: getPopupContainer || getContextPopupContainer,
|
|
|
mouseEnterDelay,
|
|
|
mouseLeaveDelay,
|
|
|
overlayClassName,
|
|
|
overlayStyle,
|
|
|
destroyPopupOnHide,
|
|
|
dropdownRender
|
|
|
};
|
|
|
const {
|
|
|
compactSize,
|
|
|
compactItemClassnames
|
|
|
} = (0,Compact/* useCompactItemContext */.ri)(prefixCls, direction);
|
|
|
const classes = _classnames_2_3_2_classnames_default()(buttonPrefixCls, compactItemClassnames, className, hashId);
|
|
|
if ('overlay' in props) {
|
|
|
dropdownProps.overlay = overlay;
|
|
|
}
|
|
|
if ('open' in props) {
|
|
|
dropdownProps.open = open;
|
|
|
}
|
|
|
if ('placement' in props) {
|
|
|
dropdownProps.placement = placement;
|
|
|
} else {
|
|
|
dropdownProps.placement = direction === 'rtl' ? 'bottomLeft' : 'bottomRight';
|
|
|
}
|
|
|
const leftButton = /*#__PURE__*/_react_17_0_2_react.createElement(es_button/* default */.ZP, {
|
|
|
type: type,
|
|
|
danger: danger,
|
|
|
disabled: disabled,
|
|
|
loading: loading,
|
|
|
onClick: onClick,
|
|
|
htmlType: htmlType,
|
|
|
href: href,
|
|
|
title: title
|
|
|
}, children);
|
|
|
const rightButton = /*#__PURE__*/_react_17_0_2_react.createElement(es_button/* default */.ZP, {
|
|
|
type: type,
|
|
|
danger: danger,
|
|
|
icon: icon
|
|
|
});
|
|
|
const [leftButtonToRender, rightButtonToRender] = buttonsRender([leftButton, rightButton]);
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement(space/* default */.Z.Compact, Object.assign({
|
|
|
className: classes,
|
|
|
size: compactSize,
|
|
|
block: true
|
|
|
}, restProps), leftButtonToRender, /*#__PURE__*/_react_17_0_2_react.createElement(dropdown/* default */.Z, Object.assign({}, dropdownProps), rightButtonToRender)));
|
|
|
};
|
|
|
DropdownButton.__ANT_BUTTON = true;
|
|
|
/* harmony default export */ var dropdown_button = (DropdownButton);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/dropdown/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
const Dropdown = dropdown/* default */.Z;
|
|
|
Dropdown.Button = dropdown_button;
|
|
|
/* harmony default export */ var es_dropdown = (Dropdown);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 1056:
|
|
|
/*!*********************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/input/index.js + 5 modules ***!
|
|
|
\*********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ input; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.3.2@classnames/index.js
|
|
|
var _classnames_2_3_2_classnames = __webpack_require__(12124);
|
|
|
var _classnames_2_3_2_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_2_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(36355);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/form/context.js
|
|
|
var form_context = __webpack_require__(32441);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/style/index.js
|
|
|
var style = __webpack_require__(9937);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/input/Group.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Group = props => {
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction
|
|
|
} = (0,_react_17_0_2_react.useContext)(context/* ConfigContext */.E_);
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
className
|
|
|
} = props;
|
|
|
const prefixCls = getPrefixCls('input-group', customizePrefixCls);
|
|
|
const inputPrefixCls = getPrefixCls('input');
|
|
|
const [wrapSSR, hashId] = (0,style/* default */.ZP)(inputPrefixCls);
|
|
|
const cls = _classnames_2_3_2_classnames_default()(prefixCls, {
|
|
|
[`${prefixCls}-lg`]: props.size === 'large',
|
|
|
[`${prefixCls}-sm`]: props.size === 'small',
|
|
|
[`${prefixCls}-compact`]: props.compact,
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl'
|
|
|
}, hashId, className);
|
|
|
const formItemContext = (0,_react_17_0_2_react.useContext)(form_context/* FormItemInputContext */.aM);
|
|
|
const groupFormItemContext = (0,_react_17_0_2_react.useMemo)(() => Object.assign(Object.assign({}, formItemContext), {
|
|
|
isFormItemInput: false
|
|
|
}), [formItemContext]);
|
|
|
if (false) {}
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: cls,
|
|
|
style: props.style,
|
|
|
onMouseEnter: props.onMouseEnter,
|
|
|
onMouseLeave: props.onMouseLeave,
|
|
|
onFocus: props.onFocus,
|
|
|
onBlur: props.onBlur
|
|
|
}, /*#__PURE__*/_react_17_0_2_react.createElement(form_context/* FormItemInputContext */.aM.Provider, {
|
|
|
value: groupFormItemContext
|
|
|
}, props.children)));
|
|
|
};
|
|
|
/* harmony default export */ var input_Group = (Group);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/Input.js + 1 modules
|
|
|
var Input = __webpack_require__(9432);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.5@@babel/runtime/helpers/esm/extends.js
|
|
|
var esm_extends = __webpack_require__(61796);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_@ant-design_icons-svg@4.3.1@@ant-design/icons-svg/es/asn/EyeInvisibleOutlined.js
|
|
|
// This icon file is generated automatically.
|
|
|
var EyeInvisibleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" } }, { "tag": "path", "attrs": { "d": "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" } }] }, "name": "eye-invisible", "theme": "outlined" };
|
|
|
/* harmony default export */ var asn_EyeInvisibleOutlined = (EyeInvisibleOutlined);
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.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/EyeInvisibleOutlined.js
|
|
|
|
|
|
// GENERATE BY ./scripts/generate.ts
|
|
|
// DON NOT EDIT IT MANUALLY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var EyeInvisibleOutlined_EyeInvisibleOutlined = function EyeInvisibleOutlined(props, ref) {
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(AntdIcon/* default */.Z, (0,esm_extends/* default */.Z)({}, props, {
|
|
|
ref: ref,
|
|
|
icon: asn_EyeInvisibleOutlined
|
|
|
}));
|
|
|
};
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var icons_EyeInvisibleOutlined = (/*#__PURE__*/_react_17_0_2_react.forwardRef(EyeInvisibleOutlined_EyeInvisibleOutlined));
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/EyeOutlined.js + 1 modules
|
|
|
var EyeOutlined = __webpack_require__(15997);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/omit.js
|
|
|
var omit = __webpack_require__(99468);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/ref.js
|
|
|
var es_ref = __webpack_require__(88831);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/hooks/useRemovePasswordTimeout.js
|
|
|
var useRemovePasswordTimeout = __webpack_require__(59412);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/input/Password.js
|
|
|
"use client";
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const defaultIconRender = visible => visible ? /*#__PURE__*/_react_17_0_2_react.createElement(EyeOutlined/* default */.Z, null) : /*#__PURE__*/_react_17_0_2_react.createElement(icons_EyeInvisibleOutlined, null);
|
|
|
const ActionMap = {
|
|
|
click: 'onClick',
|
|
|
hover: 'onMouseOver'
|
|
|
};
|
|
|
const Password = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
|
const {
|
|
|
visibilityToggle = true
|
|
|
} = props;
|
|
|
const visibilityControlled = typeof visibilityToggle === 'object' && visibilityToggle.visible !== undefined;
|
|
|
const [visible, setVisible] = (0,_react_17_0_2_react.useState)(() => visibilityControlled ? visibilityToggle.visible : false);
|
|
|
const inputRef = (0,_react_17_0_2_react.useRef)(null);
|
|
|
_react_17_0_2_react.useEffect(() => {
|
|
|
if (visibilityControlled) {
|
|
|
setVisible(visibilityToggle.visible);
|
|
|
}
|
|
|
}, [visibilityControlled, visibilityToggle]);
|
|
|
// Remove Password value
|
|
|
const removePasswordTimeout = (0,useRemovePasswordTimeout/* default */.Z)(inputRef);
|
|
|
const onVisibleChange = () => {
|
|
|
const {
|
|
|
disabled
|
|
|
} = props;
|
|
|
if (disabled) {
|
|
|
return;
|
|
|
}
|
|
|
if (visible) {
|
|
|
removePasswordTimeout();
|
|
|
}
|
|
|
setVisible(prevState => {
|
|
|
var _a;
|
|
|
const newState = !prevState;
|
|
|
if (typeof visibilityToggle === 'object') {
|
|
|
(_a = visibilityToggle.onVisibleChange) === null || _a === void 0 ? void 0 : _a.call(visibilityToggle, newState);
|
|
|
}
|
|
|
return newState;
|
|
|
});
|
|
|
};
|
|
|
const getIcon = prefixCls => {
|
|
|
const {
|
|
|
action = 'click',
|
|
|
iconRender = defaultIconRender
|
|
|
} = props;
|
|
|
const iconTrigger = ActionMap[action] || '';
|
|
|
const icon = iconRender(visible);
|
|
|
const iconProps = {
|
|
|
[iconTrigger]: onVisibleChange,
|
|
|
className: `${prefixCls}-icon`,
|
|
|
key: 'passwordIcon',
|
|
|
onMouseDown: e => {
|
|
|
// Prevent focused state lost
|
|
|
// https://github.com/ant-design/ant-design/issues/15173
|
|
|
e.preventDefault();
|
|
|
},
|
|
|
onMouseUp: e => {
|
|
|
// Prevent caret position change
|
|
|
// https://github.com/ant-design/ant-design/issues/23524
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
};
|
|
|
return /*#__PURE__*/_react_17_0_2_react.cloneElement( /*#__PURE__*/_react_17_0_2_react.isValidElement(icon) ? icon : /*#__PURE__*/_react_17_0_2_react.createElement("span", null, icon), iconProps);
|
|
|
};
|
|
|
const {
|
|
|
className,
|
|
|
prefixCls: customizePrefixCls,
|
|
|
inputPrefixCls: customizeInputPrefixCls,
|
|
|
size
|
|
|
} = props,
|
|
|
restProps = __rest(props, ["className", "prefixCls", "inputPrefixCls", "size"]);
|
|
|
const {
|
|
|
getPrefixCls
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
|
|
|
const prefixCls = getPrefixCls('input-password', customizePrefixCls);
|
|
|
const suffixIcon = visibilityToggle && getIcon(prefixCls);
|
|
|
const inputClassName = _classnames_2_3_2_classnames_default()(prefixCls, className, {
|
|
|
[`${prefixCls}-${size}`]: !!size
|
|
|
});
|
|
|
const omittedProps = Object.assign(Object.assign({}, (0,omit/* default */.Z)(restProps, ['suffix', 'iconRender', 'visibilityToggle'])), {
|
|
|
type: visible ? 'text' : 'password',
|
|
|
className: inputClassName,
|
|
|
prefixCls: inputPrefixCls,
|
|
|
suffix: suffixIcon
|
|
|
});
|
|
|
if (size) {
|
|
|
omittedProps.size = size;
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(Input/* default */.Z, Object.assign({
|
|
|
ref: (0,es_ref/* composeRef */.sQ)(ref, inputRef)
|
|
|
}, omittedProps));
|
|
|
});
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var input_Password = (Password);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/SearchOutlined.js + 1 modules
|
|
|
var SearchOutlined = __webpack_require__(46820);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/_util/reactNode.js
|
|
|
var reactNode = __webpack_require__(92343);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/hooks/useSize.js
|
|
|
var useSize = __webpack_require__(19716);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/Compact.js
|
|
|
var Compact = __webpack_require__(33234);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/input/Search.js
|
|
|
"use client";
|
|
|
|
|
|
var Search_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Search = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
|
const {
|
|
|
prefixCls: customizePrefixCls,
|
|
|
inputPrefixCls: customizeInputPrefixCls,
|
|
|
className,
|
|
|
size: customizeSize,
|
|
|
suffix,
|
|
|
enterButton = false,
|
|
|
addonAfter,
|
|
|
loading,
|
|
|
disabled,
|
|
|
onSearch: customOnSearch,
|
|
|
onChange: customOnChange,
|
|
|
onCompositionStart,
|
|
|
onCompositionEnd
|
|
|
} = props,
|
|
|
restProps = Search_rest(props, ["prefixCls", "inputPrefixCls", "className", "size", "suffix", "enterButton", "addonAfter", "loading", "disabled", "onSearch", "onChange", "onCompositionStart", "onCompositionEnd"]);
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
direction
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const composedRef = _react_17_0_2_react.useRef(false);
|
|
|
const prefixCls = getPrefixCls('input-search', customizePrefixCls);
|
|
|
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
|
|
|
const {
|
|
|
compactSize
|
|
|
} = (0,Compact/* useCompactItemContext */.ri)(prefixCls, direction);
|
|
|
const size = (0,useSize/* default */.Z)(ctx => {
|
|
|
var _a;
|
|
|
return (_a = customizeSize !== null && customizeSize !== void 0 ? customizeSize : compactSize) !== null && _a !== void 0 ? _a : ctx;
|
|
|
});
|
|
|
const inputRef = _react_17_0_2_react.useRef(null);
|
|
|
const onChange = e => {
|
|
|
if (e && e.target && e.type === 'click' && customOnSearch) {
|
|
|
customOnSearch(e.target.value, e, {
|
|
|
source: 'clear'
|
|
|
});
|
|
|
}
|
|
|
if (customOnChange) {
|
|
|
customOnChange(e);
|
|
|
}
|
|
|
};
|
|
|
const onMouseDown = e => {
|
|
|
var _a;
|
|
|
if (document.activeElement === ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input)) {
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
};
|
|
|
const onSearch = e => {
|
|
|
var _a, _b;
|
|
|
if (customOnSearch) {
|
|
|
customOnSearch((_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.input) === null || _b === void 0 ? void 0 : _b.value, e, {
|
|
|
source: 'input'
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
const onPressEnter = e => {
|
|
|
if (composedRef.current || loading) {
|
|
|
return;
|
|
|
}
|
|
|
onSearch(e);
|
|
|
};
|
|
|
const searchIcon = typeof enterButton === 'boolean' ? /*#__PURE__*/_react_17_0_2_react.createElement(SearchOutlined/* default */.Z, null) : null;
|
|
|
const btnClassName = `${prefixCls}-button`;
|
|
|
let button;
|
|
|
const enterButtonAsElement = enterButton || {};
|
|
|
const isAntdButton = enterButtonAsElement.type && enterButtonAsElement.type.__ANT_BUTTON === true;
|
|
|
if (isAntdButton || enterButtonAsElement.type === 'button') {
|
|
|
button = (0,reactNode/* cloneElement */.Tm)(enterButtonAsElement, Object.assign({
|
|
|
onMouseDown,
|
|
|
onClick: e => {
|
|
|
var _a, _b;
|
|
|
(_b = (_a = enterButtonAsElement === null || enterButtonAsElement === void 0 ? void 0 : enterButtonAsElement.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
|
onSearch(e);
|
|
|
},
|
|
|
key: 'enterButton'
|
|
|
}, isAntdButton ? {
|
|
|
className: btnClassName,
|
|
|
size
|
|
|
} : {}));
|
|
|
} else {
|
|
|
button = /*#__PURE__*/_react_17_0_2_react.createElement(es_button/* default */.ZP, {
|
|
|
className: btnClassName,
|
|
|
type: enterButton ? 'primary' : undefined,
|
|
|
size: size,
|
|
|
disabled: disabled,
|
|
|
key: "enterButton",
|
|
|
onMouseDown: onMouseDown,
|
|
|
onClick: onSearch,
|
|
|
loading: loading,
|
|
|
icon: searchIcon
|
|
|
}, enterButton);
|
|
|
}
|
|
|
if (addonAfter) {
|
|
|
button = [button, (0,reactNode/* cloneElement */.Tm)(addonAfter, {
|
|
|
key: 'addonAfter'
|
|
|
})];
|
|
|
}
|
|
|
const cls = _classnames_2_3_2_classnames_default()(prefixCls, {
|
|
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
|
|
[`${prefixCls}-${size}`]: !!size,
|
|
|
[`${prefixCls}-with-button`]: !!enterButton
|
|
|
}, className);
|
|
|
const handleOnCompositionStart = e => {
|
|
|
composedRef.current = true;
|
|
|
onCompositionStart === null || onCompositionStart === void 0 ? void 0 : onCompositionStart(e);
|
|
|
};
|
|
|
const handleOnCompositionEnd = e => {
|
|
|
composedRef.current = false;
|
|
|
onCompositionEnd === null || onCompositionEnd === void 0 ? void 0 : onCompositionEnd(e);
|
|
|
};
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(Input/* default */.Z, Object.assign({
|
|
|
ref: (0,es_ref/* composeRef */.sQ)(inputRef, ref),
|
|
|
onPressEnter: onPressEnter
|
|
|
}, restProps, {
|
|
|
size: size,
|
|
|
onCompositionStart: handleOnCompositionStart,
|
|
|
onCompositionEnd: handleOnCompositionEnd,
|
|
|
prefixCls: inputPrefixCls,
|
|
|
addonAfter: button,
|
|
|
suffix: suffix,
|
|
|
onChange: onChange,
|
|
|
className: cls,
|
|
|
disabled: disabled
|
|
|
}));
|
|
|
});
|
|
|
if (false) {}
|
|
|
/* harmony default export */ var input_Search = (Search);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/input/TextArea.js
|
|
|
var TextArea = __webpack_require__(1643);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/input/index.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const input_Input = Input/* default */.Z;
|
|
|
if (false) {}
|
|
|
input_Input.Group = input_Group;
|
|
|
input_Input.Search = input_Search;
|
|
|
input_Input.TextArea = TextArea/* default */.Z;
|
|
|
input_Input.Password = input_Password;
|
|
|
/* harmony default export */ var input = (input_Input);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 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);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 81327:
|
|
|
/*!*********************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/space/index.js + 3 modules ***!
|
|
|
\*********************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
// EXPORTS
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
|
Z: function() { return /* binding */ space; }
|
|
|
});
|
|
|
|
|
|
// UNUSED EXPORTS: SpaceContext
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./node_modules/_classnames@2.3.2@classnames/index.js
|
|
|
var _classnames_2_3_2_classnames = __webpack_require__(12124);
|
|
|
var _classnames_2_3_2_classnames_default = /*#__PURE__*/__webpack_require__.n(_classnames_2_3_2_classnames);
|
|
|
// EXTERNAL MODULE: ./node_modules/_rc-util@5.38.1@rc-util/es/Children/toArray.js
|
|
|
var toArray = __webpack_require__(45659);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/config-provider/context.js
|
|
|
var context = __webpack_require__(36355);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/Compact.js
|
|
|
var Compact = __webpack_require__(33234);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/context.js
|
|
|
|
|
|
const SpaceContext = /*#__PURE__*/_react_17_0_2_react.createContext({
|
|
|
latestIndex: 0
|
|
|
});
|
|
|
const SpaceContextProvider = SpaceContext.Provider;
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/Item.js
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
|
|
const Item = _ref => {
|
|
|
let {
|
|
|
className,
|
|
|
index,
|
|
|
children,
|
|
|
split,
|
|
|
style
|
|
|
} = _ref;
|
|
|
const {
|
|
|
latestIndex
|
|
|
} = _react_17_0_2_react.useContext(SpaceContext);
|
|
|
if (children === null || children === undefined) {
|
|
|
return null;
|
|
|
}
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /*#__PURE__*/_react_17_0_2_react.createElement("div", {
|
|
|
className: className,
|
|
|
style: style
|
|
|
}, children), index < latestIndex && split && /*#__PURE__*/_react_17_0_2_react.createElement("span", {
|
|
|
className: `${className}-split`
|
|
|
}, split));
|
|
|
};
|
|
|
/* harmony default export */ var space_Item = (Item);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/space/style/index.js + 1 modules
|
|
|
var space_style = __webpack_require__(2856);
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/utils.js
|
|
|
function isPresetSize(size) {
|
|
|
return ['small', 'middle', 'large'].includes(size);
|
|
|
}
|
|
|
function isValidGapNumber(size) {
|
|
|
if (!size) {
|
|
|
// The case of size = 0 is deliberately excluded here, because the default value of the gap attribute in CSS is 0, so if the user passes 0 in, we can directly ignore it.
|
|
|
return false;
|
|
|
}
|
|
|
return typeof size === 'number' && !Number.isNaN(size);
|
|
|
}
|
|
|
;// CONCATENATED MODULE: ./node_modules/_antd@5.9.0@antd/es/space/index.js
|
|
|
"use client";
|
|
|
|
|
|
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
var t = {};
|
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
|
}
|
|
|
return t;
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Space = /*#__PURE__*/_react_17_0_2_react.forwardRef((props, ref) => {
|
|
|
var _a, _b;
|
|
|
const {
|
|
|
getPrefixCls,
|
|
|
space,
|
|
|
direction: directionConfig
|
|
|
} = _react_17_0_2_react.useContext(context/* ConfigContext */.E_);
|
|
|
const {
|
|
|
size = (space === null || space === void 0 ? void 0 : space.size) || 'small',
|
|
|
align,
|
|
|
className,
|
|
|
rootClassName,
|
|
|
children,
|
|
|
direction = 'horizontal',
|
|
|
prefixCls: customizePrefixCls,
|
|
|
split,
|
|
|
style,
|
|
|
wrap = false,
|
|
|
classNames: customClassNames,
|
|
|
styles
|
|
|
} = props,
|
|
|
otherProps = __rest(props, ["size", "align", "className", "rootClassName", "children", "direction", "prefixCls", "split", "style", "wrap", "classNames", "styles"]);
|
|
|
const [horizontalSize, verticalSize] = Array.isArray(size) ? size : [size, size];
|
|
|
const isPresetVerticalSize = isPresetSize(verticalSize);
|
|
|
const isPresetHorizontalSize = isPresetSize(horizontalSize);
|
|
|
const isValidVerticalSize = isValidGapNumber(verticalSize);
|
|
|
const isValidHorizontalSize = isValidGapNumber(horizontalSize);
|
|
|
const childNodes = (0,toArray/* default */.Z)(children, {
|
|
|
keepEmpty: true
|
|
|
});
|
|
|
const mergedAlign = align === undefined && direction === 'horizontal' ? 'center' : align;
|
|
|
const prefixCls = getPrefixCls('space', customizePrefixCls);
|
|
|
const [wrapSSR, hashId] = (0,space_style/* default */.Z)(prefixCls);
|
|
|
const cls = _classnames_2_3_2_classnames_default()(prefixCls, space === null || space === void 0 ? void 0 : space.className, hashId, `${prefixCls}-${direction}`, {
|
|
|
[`${prefixCls}-rtl`]: directionConfig === 'rtl',
|
|
|
[`${prefixCls}-align-${mergedAlign}`]: mergedAlign,
|
|
|
[`${prefixCls}-gap-row-${verticalSize}`]: isPresetVerticalSize,
|
|
|
[`${prefixCls}-gap-col-${horizontalSize}`]: isPresetHorizontalSize
|
|
|
}, className, rootClassName);
|
|
|
const itemClassName = _classnames_2_3_2_classnames_default()(`${prefixCls}-item`, (_a = customClassNames === null || customClassNames === void 0 ? void 0 : customClassNames.item) !== null && _a !== void 0 ? _a : (_b = space === null || space === void 0 ? void 0 : space.classNames) === null || _b === void 0 ? void 0 : _b.item);
|
|
|
// Calculate latest one
|
|
|
let latestIndex = 0;
|
|
|
const nodes = childNodes.map((child, i) => {
|
|
|
var _a, _b;
|
|
|
if (child !== null && child !== undefined) {
|
|
|
latestIndex = i;
|
|
|
}
|
|
|
const key = child && child.key || `${itemClassName}-${i}`;
|
|
|
return /*#__PURE__*/_react_17_0_2_react.createElement(space_Item, {
|
|
|
className: itemClassName,
|
|
|
key: key,
|
|
|
index: i,
|
|
|
split: split,
|
|
|
style: (_a = styles === null || styles === void 0 ? void 0 : styles.item) !== null && _a !== void 0 ? _a : (_b = space === null || space === void 0 ? void 0 : space.styles) === null || _b === void 0 ? void 0 : _b.item
|
|
|
}, child);
|
|
|
});
|
|
|
const spaceContext = _react_17_0_2_react.useMemo(() => ({
|
|
|
latestIndex
|
|
|
}), [latestIndex]);
|
|
|
// =========================== Render ===========================
|
|
|
if (childNodes.length === 0) {
|
|
|
return null;
|
|
|
}
|
|
|
const gapStyle = {};
|
|
|
if (wrap) {
|
|
|
gapStyle.flexWrap = 'wrap';
|
|
|
}
|
|
|
if (!isPresetHorizontalSize && isValidHorizontalSize) {
|
|
|
gapStyle.columnGap = horizontalSize;
|
|
|
}
|
|
|
if (!isPresetVerticalSize && isValidVerticalSize) {
|
|
|
gapStyle.rowGap = verticalSize;
|
|
|
}
|
|
|
return wrapSSR( /*#__PURE__*/_react_17_0_2_react.createElement("div", Object.assign({
|
|
|
ref: ref,
|
|
|
className: cls,
|
|
|
style: Object.assign(Object.assign(Object.assign({}, gapStyle), space === null || space === void 0 ? void 0 : space.style), style)
|
|
|
}, otherProps), /*#__PURE__*/_react_17_0_2_react.createElement(SpaceContextProvider, {
|
|
|
value: spaceContext
|
|
|
}, nodes)));
|
|
|
});
|
|
|
if (false) {}
|
|
|
const CompoundedSpace = Space;
|
|
|
CompoundedSpace.Compact = Compact/* default */.ZP;
|
|
|
/* harmony default export */ var space = (CompoundedSpace);
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 92899:
|
|
|
/*!***************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/style/motion/move.js ***!
|
|
|
\***************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ Fm: function() { return /* binding */ initMoveMotion; }
|
|
|
/* harmony export */ });
|
|
|
/* unused harmony exports moveDownIn, moveDownOut, moveLeftIn, moveLeftOut, moveRightIn, moveRightOut, moveUpIn, moveUpOut */
|
|
|
/* harmony import */ var _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ant-design/cssinjs */ 67937);
|
|
|
/* harmony import */ var _motion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./motion */ 95406);
|
|
|
|
|
|
|
|
|
const moveDownIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antMoveDownIn', {
|
|
|
'0%': {
|
|
|
transform: 'translate3d(0, 100%, 0)',
|
|
|
transformOrigin: '0 0',
|
|
|
opacity: 0
|
|
|
},
|
|
|
'100%': {
|
|
|
transform: 'translate3d(0, 0, 0)',
|
|
|
transformOrigin: '0 0',
|
|
|
opacity: 1
|
|
|
}
|
|
|
});
|
|
|
const moveDownOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antMoveDownOut', {
|
|
|
'0%': {
|
|
|
transform: 'translate3d(0, 0, 0)',
|
|
|
transformOrigin: '0 0',
|
|
|
opacity: 1
|
|
|
},
|
|
|
'100%': {
|
|
|
transform: 'translate3d(0, 100%, 0)',
|
|
|
transformOrigin: '0 0',
|
|
|
opacity: 0
|
|
|
}
|
|
|
});
|
|
|
const moveLeftIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antMoveLeftIn', {
|
|
|
'0%': {
|
|
|
transform: 'translate3d(-100%, 0, 0)',
|
|
|
transformOrigin: '0 0',
|
|
|
opacity: 0
|
|
|
},
|
|
|
'100%': {
|
|
|
transform: 'translate3d(0, 0, 0)',
|
|
|
transformOrigin: '0 0',
|
|
|
opacity: 1
|
|
|
}
|
|
|
});
|
|
|
const moveLeftOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antMoveLeftOut', {
|
|
|
'0%': {
|
|
|
transform: 'translate3d(0, 0, 0)',
|
|
|
transformOrigin: '0 0',
|
|
|
opacity: 1
|
|
|
},
|
|
|
'100%': {
|
|
|
transform: 'translate3d(-100%, 0, 0)',
|
|
|
transformOrigin: '0 0',
|
|
|
opacity: 0
|
|
|
}
|
|
|
});
|
|
|
const moveRightIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antMoveRightIn', {
|
|
|
'0%': {
|
|
|
transform: 'translate3d(100%, 0, 0)',
|
|
|
transformOrigin: '0 0',
|
|
|
opacity: 0
|
|
|
},
|
|
|
'100%': {
|
|
|
transform: 'translate3d(0, 0, 0)',
|
|
|
transformOrigin: '0 0',
|
|
|
opacity: 1
|
|
|
}
|
|
|
});
|
|
|
const moveRightOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antMoveRightOut', {
|
|
|
'0%': {
|
|
|
transform: 'translate3d(0, 0, 0)',
|
|
|
transformOrigin: '0 0',
|
|
|
opacity: 1
|
|
|
},
|
|
|
'100%': {
|
|
|
transform: 'translate3d(100%, 0, 0)',
|
|
|
transformOrigin: '0 0',
|
|
|
opacity: 0
|
|
|
}
|
|
|
});
|
|
|
const moveUpIn = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antMoveUpIn', {
|
|
|
'0%': {
|
|
|
transform: 'translate3d(0, -100%, 0)',
|
|
|
transformOrigin: '0 0',
|
|
|
opacity: 0
|
|
|
},
|
|
|
'100%': {
|
|
|
transform: 'translate3d(0, 0, 0)',
|
|
|
transformOrigin: '0 0',
|
|
|
opacity: 1
|
|
|
}
|
|
|
});
|
|
|
const moveUpOut = new _ant_design_cssinjs__WEBPACK_IMPORTED_MODULE_0__.Keyframes('antMoveUpOut', {
|
|
|
'0%': {
|
|
|
transform: 'translate3d(0, 0, 0)',
|
|
|
transformOrigin: '0 0',
|
|
|
opacity: 1
|
|
|
},
|
|
|
'100%': {
|
|
|
transform: 'translate3d(0, -100%, 0)',
|
|
|
transformOrigin: '0 0',
|
|
|
opacity: 0
|
|
|
}
|
|
|
});
|
|
|
const moveMotion = {
|
|
|
'move-up': {
|
|
|
inKeyframes: moveUpIn,
|
|
|
outKeyframes: moveUpOut
|
|
|
},
|
|
|
'move-down': {
|
|
|
inKeyframes: moveDownIn,
|
|
|
outKeyframes: moveDownOut
|
|
|
},
|
|
|
'move-left': {
|
|
|
inKeyframes: moveLeftIn,
|
|
|
outKeyframes: moveLeftOut
|
|
|
},
|
|
|
'move-right': {
|
|
|
inKeyframes: moveRightIn,
|
|
|
outKeyframes: moveRightOut
|
|
|
}
|
|
|
};
|
|
|
const initMoveMotion = (token, motionName) => {
|
|
|
const {
|
|
|
antCls
|
|
|
} = token;
|
|
|
const motionCls = `${antCls}-${motionName}`;
|
|
|
const {
|
|
|
inKeyframes,
|
|
|
outKeyframes
|
|
|
} = moveMotion[motionName];
|
|
|
return [(0,_motion__WEBPACK_IMPORTED_MODULE_1__/* .initMotion */ .R)(motionCls, inKeyframes, outKeyframes, token.motionDurationMid), {
|
|
|
[`
|
|
|
${motionCls}-enter,
|
|
|
${motionCls}-appear
|
|
|
`]: {
|
|
|
opacity: 0,
|
|
|
animationTimingFunction: token.motionEaseOutCirc
|
|
|
},
|
|
|
[`${motionCls}-leave`]: {
|
|
|
animationTimingFunction: token.motionEaseInOutCirc
|
|
|
}
|
|
|
}];
|
|
|
};
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 5630:
|
|
|
/*!*****************************************************************!*\
|
|
|
!*** ./node_modules/_rc-checkbox@3.1.0@rc-checkbox/es/index.js ***!
|
|
|
\*****************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* unused harmony export Checkbox */
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/extends */ 61796);
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ 36439);
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ 35005);
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/slicedToArray */ 61860);
|
|
|
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectWithoutProperties */ 20968);
|
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ 12124);
|
|
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
|
|
|
/* harmony import */ var rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rc-util/es/hooks/useMergedState */ 84381);
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ 59301);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["prefixCls", "className", "style", "checked", "disabled", "defaultChecked", "type", "title", "onChange"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var Checkbox = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(function (props, ref) {
|
|
|
var _classNames;
|
|
|
var _props$prefixCls = props.prefixCls,
|
|
|
prefixCls = _props$prefixCls === void 0 ? 'rc-checkbox' : _props$prefixCls,
|
|
|
className = props.className,
|
|
|
style = props.style,
|
|
|
checked = props.checked,
|
|
|
disabled = props.disabled,
|
|
|
_props$defaultChecked = props.defaultChecked,
|
|
|
defaultChecked = _props$defaultChecked === void 0 ? false : _props$defaultChecked,
|
|
|
_props$type = props.type,
|
|
|
type = _props$type === void 0 ? 'checkbox' : _props$type,
|
|
|
title = props.title,
|
|
|
onChange = props.onChange,
|
|
|
inputProps = (0,_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z)(props, _excluded);
|
|
|
var inputRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
|
|
|
var _useMergedState = (0,rc_util_es_hooks_useMergedState__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z)(defaultChecked, {
|
|
|
value: checked
|
|
|
}),
|
|
|
_useMergedState2 = (0,_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z)(_useMergedState, 2),
|
|
|
rawValue = _useMergedState2[0],
|
|
|
setRawValue = _useMergedState2[1];
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_2__.useImperativeHandle)(ref, function () {
|
|
|
return {
|
|
|
focus: function focus() {
|
|
|
var _inputRef$current;
|
|
|
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
|
},
|
|
|
blur: function blur() {
|
|
|
var _inputRef$current2;
|
|
|
(_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.blur();
|
|
|
},
|
|
|
input: inputRef.current
|
|
|
};
|
|
|
});
|
|
|
var classString = classnames__WEBPACK_IMPORTED_MODULE_0___default()(prefixCls, className, (_classNames = {}, (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)(_classNames, "".concat(prefixCls, "-checked"), rawValue), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z)(_classNames, "".concat(prefixCls, "-disabled"), disabled), _classNames));
|
|
|
var handleChange = function handleChange(e) {
|
|
|
if (disabled) {
|
|
|
return;
|
|
|
}
|
|
|
if (!('checked' in props)) {
|
|
|
setRawValue(e.target.checked);
|
|
|
}
|
|
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
|
target: (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Z)({}, props), {}, {
|
|
|
type: type,
|
|
|
checked: e.target.checked
|
|
|
}),
|
|
|
stopPropagation: function stopPropagation() {
|
|
|
e.stopPropagation();
|
|
|
},
|
|
|
preventDefault: function preventDefault() {
|
|
|
e.preventDefault();
|
|
|
},
|
|
|
nativeEvent: e.nativeEvent
|
|
|
});
|
|
|
};
|
|
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("span", {
|
|
|
className: classString,
|
|
|
title: title,
|
|
|
style: style
|
|
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("input", (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z)({}, inputProps, {
|
|
|
className: "".concat(prefixCls, "-input"),
|
|
|
ref: inputRef,
|
|
|
onChange: handleChange,
|
|
|
disabled: disabled,
|
|
|
checked: !!rawValue,
|
|
|
type: type
|
|
|
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2__.createElement("span", {
|
|
|
className: "".concat(prefixCls, "-inner")
|
|
|
}));
|
|
|
});
|
|
|
/* harmony default export */ __webpack_exports__.Z = (Checkbox);
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |