You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2430 lines
109 KiB
2430 lines
109 KiB
"use strict";
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[1717],{
|
|
|
|
/***/ 28436:
|
|
/*!***************************************************!*\
|
|
!*** ./src/components/User/UnlockLogin/index.tsx ***!
|
|
\***************************************************/
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! antd */ 78241);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! antd */ 8591);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! antd */ 43418);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! antd */ 72315);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! antd */ 46400);
|
|
/* harmony import */ var antd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! antd */ 1056);
|
|
/* harmony import */ var _service_user__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/service/user */ 74208);
|
|
/* harmony import */ var umi__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! umi */ 87210);
|
|
var __defProp = Object.defineProperty;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
const inputStyle = { height: 48, borderRadius: 4 };
|
|
const LoginPopComponents = ({ dispatch, setType, data, accountInfo, open }) => {
|
|
const [form] = antd__WEBPACK_IMPORTED_MODULE_3__["default"].useForm();
|
|
const [searchParams] = (0,umi__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)();
|
|
const location = (0,umi__WEBPACK_IMPORTED_MODULE_2__.useLocation)();
|
|
const [openModal, setOpenModal] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
|
|
const [errorValue, setErrorValue] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");
|
|
const password = /^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{8,16}$/;
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
setOpenModal(open);
|
|
}, [open]);
|
|
const columns = [
|
|
{
|
|
title: "IP\u5730\u5740",
|
|
dataIndex: "ip",
|
|
key: "ip",
|
|
render: (text) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: text.indexOf("\u5F02\u5E38") > -1 || text.indexOf("\u767B\u5F55") > -1 ? "c-red" : "c-green" }, text)
|
|
},
|
|
{
|
|
title: "\u6D4F\u89C8\u5668",
|
|
dataIndex: "browser",
|
|
key: "browser",
|
|
render: (text) => /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: text.indexOf("\u5F02\u5E38") > -1 || text.indexOf("\u767B\u5F55") > -1 ? "c-red" : "c-green" }, text)
|
|
},
|
|
{
|
|
title: "\u4E0A\u6B21\u767B\u5F55\u65F6\u95F4",
|
|
dataIndex: "last_login_time",
|
|
key: "last_login_time"
|
|
}
|
|
];
|
|
const dataSource = [
|
|
{ "real_name": "edutest01", "student_id": "test0001", "last_login_time": "2023-05-20 13:53:10", "ip": "ip\u5730\u5740\u6B63\u5E38", "browser": "\u6D4F\u89C8\u5668\u6B63\u5E38" }
|
|
];
|
|
const onFinish = () => __async(void 0, null, function* () {
|
|
yield form.validateFields();
|
|
const res = yield (0,_service_user__WEBPACK_IMPORTED_MODULE_1__/* .LoginIn */ .Es)(__spreadValues(__spreadValues({}, accountInfo), form.getFieldValue()));
|
|
if (!!res.status) {
|
|
if (res.status === -4) {
|
|
dispatch({
|
|
type: "user/showPopLogin",
|
|
payload: { showPopLogin: false }
|
|
});
|
|
dispatch({
|
|
type: "user/setBindAccountModal",
|
|
payload: {
|
|
bindAccountModalVisible: true,
|
|
userInfoForBindAccountModal: res.user,
|
|
loginInfo: accountInfo
|
|
}
|
|
});
|
|
return;
|
|
}
|
|
setErrorValue(res == null ? void 0 : res.message);
|
|
return;
|
|
}
|
|
setOpenModal(false);
|
|
if (res == null ? void 0 : res.show) {
|
|
localStorage.setItem("extension-modal", "exist");
|
|
localStorage.setItem("extension-date", res == null ? void 0 : res.start_date);
|
|
} else {
|
|
localStorage.removeItem("extension-modal");
|
|
}
|
|
if (location.pathname === "/user/login" || location.pathname === "/login") {
|
|
let from = searchParams.get("form") || searchParams.get("back_url");
|
|
if (from) {
|
|
window.location.href = decodeURIComponent(from);
|
|
} else {
|
|
if (!password.test(accountInfo.password)) {
|
|
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.info("\u7CFB\u7EDF\u68C0\u6D4B\u60A8\u7684\u5BC6\u7801\u5F3A\u5EA6\u8FC7\u4F4E\uFF0C\u8BF7\u53CA\u65F6\u4FEE\u6539");
|
|
window.location.href = "/account/secure";
|
|
} else {
|
|
window.location.reload();
|
|
return;
|
|
}
|
|
}
|
|
} else {
|
|
if (!password.test(accountInfo.password)) {
|
|
antd__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .ZP.info("\u7CFB\u7EDF\u68C0\u6D4B\u60A8\u7684\u5BC6\u7801\u5F3A\u5EA6\u8FC7\u4F4E\uFF0C\u8BF7\u53CA\u65F6\u4FEE\u6539");
|
|
window.location.href = "/account/secure?active=3";
|
|
dispatch({
|
|
type: "user/showPopLogin",
|
|
payload: { showPopLogin: false }
|
|
});
|
|
} else {
|
|
window.location.reload();
|
|
return;
|
|
}
|
|
}
|
|
form.resetFields();
|
|
});
|
|
const handleClick = () => {
|
|
dispatch({
|
|
type: "user/showPopLogin",
|
|
payload: { showPopLogin: false }
|
|
});
|
|
};
|
|
return /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
antd__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
{
|
|
title: "\u767B\u5F55\u63D0\u793A",
|
|
width: 600,
|
|
onOk: onFinish,
|
|
onCancel: () => setOpenModal(false),
|
|
centered: true,
|
|
keyboard: false,
|
|
closable: false,
|
|
maskClosable: false,
|
|
open: openModal
|
|
},
|
|
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("p", { className: "tc" }, "\u8BE5\u8D26\u53F7\u5DF2\u7ECF\u5B58\u5728\u5F02\u5E38\u60C5\u51B5\uFF0C\u82E5\u975E\u672C\u4EBA\u64CD\u4F5C\uFF0C\u8BF7\u8054\u7CFB\u76D1\u8003\u8001\u5E08\u8BF4\u660E\u60C5\u51B5\u3002"),
|
|
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "mt20" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_6__["default"], { pagination: { hideOnSinglePage: true }, dataSource: data || [], columns })),
|
|
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "mt20 mb20" }, /* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z, { message: "\u8BF7\u76D1\u8003\u8001\u5E08\u8F93\u5165\u7684\u8003\u8BD5\u89E3\u9501\u7801\uFF0C\u6388\u6743\u5F53\u524D\u5B66\u751F\u767B\u5F55\u5E73\u53F0\u3002", type: "warning" })),
|
|
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
antd__WEBPACK_IMPORTED_MODULE_3__["default"],
|
|
{
|
|
name: "global_state",
|
|
autoComplete: "off",
|
|
form
|
|
},
|
|
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(
|
|
antd__WEBPACK_IMPORTED_MODULE_3__["default"].Item,
|
|
{
|
|
name: "unlock_key",
|
|
label: "\u8003\u8BD5\u89E3\u9501\u7801",
|
|
rules: [{ required: true, message: "\u8BF7\u8F93\u5165\u89E3\u9501\u7801" }]
|
|
},
|
|
/* @__PURE__ */ react__WEBPACK_IMPORTED_MODULE_0__.createElement(antd__WEBPACK_IMPORTED_MODULE_8__["default"].Password, { autoComplete: "off" })
|
|
)
|
|
)
|
|
);
|
|
};
|
|
/* harmony default export */ __webpack_exports__.Z = ((0,umi__WEBPACK_IMPORTED_MODULE_2__.connect)(
|
|
({
|
|
user,
|
|
loading,
|
|
globalSetting
|
|
}) => ({
|
|
user,
|
|
globalSetting,
|
|
loading: loading.models.index
|
|
})
|
|
)(LoginPopComponents));
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 36922:
|
|
/*!********************************************!*\
|
|
!*** ./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/_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 + 14 modules
|
|
var _umi_production_exports = __webpack_require__(87210);
|
|
// 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__(74208);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_icons@5.2.6@@ant-design/icons/es/icons/CloseOutlined.js + 1 modules
|
|
var CloseOutlined = __webpack_require__(99174);
|
|
// EXTERNAL MODULE: ./src/components/User/UnlockLogin/index.tsx
|
|
var UnlockLogin = __webpack_require__(28436);
|
|
;// 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/LoginForm.tsx
|
|
var __defProp = Object.defineProperty;
|
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var __spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (__hasOwnProp.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
if (__getOwnPropSymbols)
|
|
for (var prop of __getOwnPropSymbols(b)) {
|
|
if (__propIsEnum.call(b, prop))
|
|
__defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const inputStyle = { height: 48, borderRadius: 4 };
|
|
const LoginPopComponents = ({ dispatch, setType, user, setusername }) => {
|
|
const [form] = es_form["default"].useForm();
|
|
const [searchParams] = (0,_umi_production_exports.useSearchParams)();
|
|
const location = (0,_umi_production_exports.useLocation)();
|
|
const [errorValue, setErrorValue] = (0,_react_17_0_2_react.useState)("");
|
|
const [errorData, setErrorData] = (0,_react_17_0_2_react.useState)([]);
|
|
const [formValue, setFormValue] = (0,_react_17_0_2_react.useState)({});
|
|
const [openUnlockLogin, setOpenUnlockLogin] = (0,_react_17_0_2_react.useState)(false);
|
|
const password = /^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{8,16}$/;
|
|
const onFinish = (values) => __async(void 0, null, function* () {
|
|
setOpenUnlockLogin(false);
|
|
if (!password.test(values.password)) {
|
|
setusername(values.login);
|
|
setErrorValue("\u7CFB\u7EDF\u68C0\u6D4B\u60A8\u7684\u5BC6\u7801\u5F3A\u5EA6\u8FC7\u4F4E\uFF0C\u8BF7\u53CA\u65F6\u4FEE\u6539");
|
|
}
|
|
setFormValue(__spreadValues({}, values));
|
|
const res = yield (0,service_user/* LoginIn */.Es)(values);
|
|
if (!!res.status) {
|
|
if (res.status === -4) {
|
|
dispatch({
|
|
type: "user/showPopLogin",
|
|
payload: { showPopLogin: false }
|
|
});
|
|
dispatch({
|
|
type: "user/setBindAccountModal",
|
|
payload: {
|
|
bindAccountModalVisible: true,
|
|
userInfoForBindAccountModal: res.user,
|
|
loginInfo: values
|
|
}
|
|
});
|
|
return;
|
|
} else if (res.status === -5) {
|
|
setErrorData([res == null ? void 0 : res.message]);
|
|
setOpenUnlockLogin(true);
|
|
return;
|
|
}
|
|
setErrorValue(res == null ? void 0 : res.message);
|
|
return;
|
|
}
|
|
if (res == null ? void 0 : res.show) {
|
|
localStorage.setItem("extension-modal", "exist");
|
|
localStorage.setItem("extension-date", res == null ? void 0 : res.start_date);
|
|
} else {
|
|
localStorage.removeItem("extension-modal");
|
|
}
|
|
if (location.pathname === "/user/login" || location.pathname === "/login") {
|
|
let from = searchParams.get("form") || searchParams.get("back_url");
|
|
if (from) {
|
|
window.location.href = decodeURIComponent(from);
|
|
} else {
|
|
if (!password.test(values.password)) {
|
|
message/* default */.ZP.info("\u7CFB\u7EDF\u68C0\u6D4B\u60A8\u7684\u5BC6\u7801\u5F3A\u5EA6\u8FC7\u4F4E\uFF0C\u8BF7\u53CA\u65F6\u4FEE\u6539");
|
|
window.location.href = "/account/secure";
|
|
} else {
|
|
window.location.reload();
|
|
return;
|
|
}
|
|
}
|
|
} else {
|
|
if (!password.test(values.password)) {
|
|
message/* default */.ZP.info("\u7CFB\u7EDF\u68C0\u6D4B\u60A8\u7684\u5BC6\u7801\u5F3A\u5EA6\u8FC7\u4F4E\uFF0C\u8BF7\u53CA\u65F6\u4FEE\u6539");
|
|
window.location.href = "/account/secure?active=3";
|
|
dispatch({
|
|
type: "user/showPopLogin",
|
|
payload: { showPopLogin: false }
|
|
});
|
|
} else {
|
|
window.location.reload();
|
|
return;
|
|
}
|
|
}
|
|
form.resetFields();
|
|
});
|
|
const handleClick = () => {
|
|
dispatch({
|
|
type: "user/showPopLogin",
|
|
payload: { showPopLogin: false }
|
|
});
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"],
|
|
{
|
|
layout: "vertical",
|
|
form,
|
|
initialValues: { autologin: true, login: user.actionTabs.phone },
|
|
onFinish,
|
|
onValuesChange: (changedValues) => {
|
|
setErrorValue("");
|
|
const chineseRegex = /[\u4e00-\u9fa5]/g;
|
|
if ("password" in changedValues) {
|
|
const password2 = changedValues.password.replace(chineseRegex, "");
|
|
form.setFieldsValue({ password: password2 });
|
|
}
|
|
}
|
|
},
|
|
!!errorValue && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: LoginPanelmodules["res-error-values"] }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, errorValue), /* @__PURE__ */ _react_17_0_2_react.createElement(CloseOutlined/* default */.Z, { onClick: () => setErrorValue("") })),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "login",
|
|
rules: [{ required: true, message: "\u8BF7\u8F93\u5165\u7528\u6237\u540D\u3001\u624B\u673A\u53F7\u6216\u90AE\u7BB1" }]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"],
|
|
{
|
|
style: inputStyle,
|
|
size: "middle",
|
|
placeholder: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u624B\u673A\u53F7/\u90AE\u7BB1\u53F7/\u8D26\u53F7",
|
|
onBlur: () => {
|
|
dispatch({
|
|
type: "user/setActionTabs",
|
|
payload: { phone: form.getFieldValue("login") }
|
|
});
|
|
}
|
|
}
|
|
)
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "password",
|
|
rules: [{ required: true, message: "\u8BF7\u8F93\u51658-16\u4F4D\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199\u3001\u4E0D\u80FD\u4F7F\u7528\u7A7A\u683C" }]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"].Password,
|
|
{
|
|
style: inputStyle,
|
|
size: "middle",
|
|
placeholder: "\u5BC6\u7801"
|
|
}
|
|
)
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "flex-container", style: { justifyContent: "space-between" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: "autologin", noStyle: true, valuePropName: "checked" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_checkbox["default"], null, "\u4E0B\u6B21\u81EA\u52A8\u767B\u5F55")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "current font14 c-blue", onClick: () => setType(4) }, "\u627E\u56DE\u5BC6\u7801")))),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, null, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
size: "middle",
|
|
type: "primary",
|
|
htmlType: "submit",
|
|
block: true,
|
|
className: "font16",
|
|
style: inputStyle
|
|
},
|
|
"\u767B\u5F55"
|
|
)),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tc", style: { paddingTop: 0, paddingBottom: 20 } }, "\u767B\u5F55\u5373\u4EE3\u8868\u60A8\u5DF2\u9605\u8BFB\u5E76\u540C\u610F", /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: "https://engineer.educoder.net/help?index=4", target: "_blank" }, "\u300A\u670D\u52A1\u534F\u8BAE\u6761\u6B3E\u300B"))
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(UnlockLogin/* default */.Z, { open: openUnlockLogin, data: errorData, accountInfo: __spreadValues({}, formValue) }));
|
|
};
|
|
/* harmony default export */ var LoginForm = ((0,_umi_production_exports.connect)(
|
|
({
|
|
user,
|
|
loading,
|
|
globalSetting
|
|
}) => ({
|
|
user,
|
|
globalSetting,
|
|
loading: loading.models.index
|
|
})
|
|
)(LoginPopComponents));
|
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
var util = __webpack_require__(3163);
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/LoginSmsPanel/index.tsx
|
|
var LoginSmsPanel_defProp = Object.defineProperty;
|
|
var __defProps = Object.defineProperties;
|
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var LoginSmsPanel_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var LoginSmsPanel_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var LoginSmsPanel_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var LoginSmsPanel_defNormalProp = (obj, key, value) => key in obj ? LoginSmsPanel_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var LoginSmsPanel_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (LoginSmsPanel_hasOwnProp.call(b, prop))
|
|
LoginSmsPanel_defNormalProp(a, prop, b[prop]);
|
|
if (LoginSmsPanel_getOwnPropSymbols)
|
|
for (var prop of LoginSmsPanel_getOwnPropSymbols(b)) {
|
|
if (LoginSmsPanel_propIsEnum.call(b, prop))
|
|
LoginSmsPanel_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
var LoginSmsPanel_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
const LoginSmsPanel_inputStyle = { height: 48, borderRadius: 4 };
|
|
const loginRegex = /(^(1[0-9])\d{9}$)/i;
|
|
const initialState = {
|
|
timer: 0
|
|
};
|
|
var Types = /* @__PURE__ */ ((Types2) => {
|
|
Types2[Types2["setTimer"] = 0] = "setTimer";
|
|
return Types2;
|
|
})(Types || {});
|
|
function reducer(state, action) {
|
|
switch (action.type) {
|
|
case 0 /* setTimer */:
|
|
return __spreadProps(LoginSmsPanel_spreadValues({}, state), { timer: action.payload });
|
|
default:
|
|
throw new Error();
|
|
}
|
|
}
|
|
const RegisterComponent = ({ user, dispatch, validateName, getCode, register, style = {}, buttonText = "\u6CE8\u518C", globalSetting }) => {
|
|
var _a;
|
|
const [form] = es_form["default"].useForm();
|
|
const [state, dispatchs] = (0,_react_17_0_2_react.useReducer)(reducer, initialState);
|
|
const [codeLoading, setCodeLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const { timer } = state;
|
|
const [isdisabled, setisdisabled] = (0,_react_17_0_2_react.useState)(false);
|
|
console.log("dispatchs:", dispatchs);
|
|
function onFinish(values) {
|
|
return LoginSmsPanel_async(this, null, function* () {
|
|
const { login, password, code } = values;
|
|
const { message, status } = yield register({ login, code });
|
|
if (status < 0) {
|
|
form.setFields([{
|
|
name: "code",
|
|
errors: [message]
|
|
}]);
|
|
return;
|
|
}
|
|
window.location.reload();
|
|
});
|
|
}
|
|
function onValidateName() {
|
|
return LoginSmsPanel_async(this, null, function* () {
|
|
let login = form.getFieldValue("login");
|
|
let flag = 0;
|
|
if (!loginRegex.test(login) || login.indexOf(" ") > -1) {
|
|
form.setFields([{
|
|
name: "login",
|
|
errors: ["\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7"]
|
|
}]);
|
|
flag = 1;
|
|
return flag;
|
|
}
|
|
let { status, message } = yield validateName({ login, type: 1 });
|
|
const isOk = status < 0;
|
|
if (isOk) {
|
|
flag = 2;
|
|
} else {
|
|
form.setFields([{
|
|
name: "login",
|
|
errors: ["\u8BE5\u624B\u673A\u53F7\u7801\u4E0D\u5B58\u5728\uFF0C\u8BF7\u5148\u6CE8\u518C"]
|
|
}]);
|
|
flag = 1;
|
|
}
|
|
return flag;
|
|
});
|
|
}
|
|
const onGetCode = () => LoginSmsPanel_async(void 0, null, function* () {
|
|
const login = form.getFieldValue("login");
|
|
if (!loginRegex.test(login)) {
|
|
form.validateFields(["login"]);
|
|
} else {
|
|
let res = yield validateName({ login, type: 1 });
|
|
if ((res == null ? void 0 : res.status) > 0) {
|
|
form.setFields([{
|
|
name: "login",
|
|
errors: ["\u8BE5\u624B\u673A\u53F7\u7801\u4E0D\u5B58\u5728\uFF0C\u8BF7\u5148\u6CE8\u518C"]
|
|
}]);
|
|
return;
|
|
}
|
|
setCodeLoading(true);
|
|
const { status, message } = yield getCode({
|
|
login,
|
|
type: 6,
|
|
smscode: (0,util/* setmiyah */.M)(login)
|
|
});
|
|
if (status < 0) {
|
|
form.setFields([{
|
|
name: "code",
|
|
errors: [message]
|
|
}]);
|
|
}
|
|
dispatchs({
|
|
type: 0 /* setTimer */,
|
|
payload: 60
|
|
});
|
|
setCodeLoading(false);
|
|
}
|
|
});
|
|
function validatePassword(_, value) {
|
|
if (!value) {
|
|
return Promise.resolve();
|
|
}
|
|
if (value.indexOf(" ") > -1) {
|
|
return Promise.reject("\u8BF7\u8F93\u51658-16\u4F4D\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199\u3001\u4E0D\u80FD\u4F7F\u7528\u7A7A\u683C");
|
|
}
|
|
const len = value.length;
|
|
if (len >= 8 && len <= 16) {
|
|
return Promise.resolve();
|
|
} else {
|
|
return Promise.reject("\u8BF7\u8F93\u51658-16\u4F4D\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199\u3001\u4E0D\u80FD\u4F7F\u7528\u7A7A\u683C");
|
|
}
|
|
}
|
|
const verifyValidate = (_, value) => {
|
|
return value ? Promise.resolve() : Promise.reject("\u8BF7\u62D6\u52A8\u6ED1\u5757\u9A8C\u8BC1");
|
|
};
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (timer > 0) {
|
|
setTimeout(() => {
|
|
dispatchs({
|
|
type: 0 /* setTimer */,
|
|
payload: timer - 1
|
|
});
|
|
}, 1e3);
|
|
}
|
|
}, [timer]);
|
|
const LoginValidate = (_, value) => {
|
|
if (!value) {
|
|
return Promise.resolve();
|
|
}
|
|
if (value.indexOf(" ") > -1) {
|
|
return Promise.reject("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7");
|
|
}
|
|
if (loginRegex.test(value)) {
|
|
return Promise.resolve();
|
|
} else {
|
|
return Promise.reject("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7");
|
|
}
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"],
|
|
{
|
|
layout: "vertical",
|
|
form,
|
|
style,
|
|
initialValues: { autologin: true, protool: false, login: user.actionTabs.phone },
|
|
onFinish
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "login",
|
|
rules: [
|
|
{ required: true, message: "\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7" },
|
|
{ validator: LoginValidate }
|
|
]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"],
|
|
{
|
|
style: LoginSmsPanel_inputStyle,
|
|
autoComplete: "new-login",
|
|
size: "middle",
|
|
placeholder: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u624B\u673A\u53F7",
|
|
maxLength: 11,
|
|
onBlur: () => {
|
|
onValidateName();
|
|
dispatch({
|
|
type: "user/setActionTabs",
|
|
payload: { phone: form.getFieldValue("login") }
|
|
});
|
|
},
|
|
onChange: () => form.setFieldsValue({ verify: 0 })
|
|
}
|
|
)
|
|
),
|
|
!((_a = globalSetting == null ? void 0 : globalSetting.setting) == null ? void 0 : _a.is_local) && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "code",
|
|
rules: [{ required: true, message: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801" }]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"],
|
|
{
|
|
suffix: /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { loading: codeLoading, type: "link", onClick: onGetCode, disabled: timer > 0 || isdisabled }, " ", timer === 0 ? "\u83B7\u53D6\u9A8C\u8BC1\u7801" : `${timer}\u79D2\u53EF\u91CD\u65B0\u83B7\u53D6`),
|
|
style: { paddingRight: 2, height: 48 },
|
|
placeholder: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",
|
|
size: "middle"
|
|
}
|
|
)
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "flex-container", style: { justifyContent: "space-between" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: "autologin", noStyle: true, valuePropName: "checked" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_checkbox["default"], null, "\u4E0B\u6B21\u81EA\u52A8\u767B\u5F55")))),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, null, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { size: "middle", type: "primary", htmlType: "submit", block: true, style: LoginSmsPanel_inputStyle, className: "font16" }, " ", buttonText, " ")),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tc", style: { paddingTop: 0, paddingBottom: 20 } }, "\u767B\u5F55\u5373\u4EE3\u8868\u60A8\u5DF2\u9605\u8BFB\u5E76\u540C\u610F", /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: "https://engineer.educoder.net/help?index=4", target: "_blank" }, "\u300A\u670D\u52A1\u534F\u8BAE\u6761\u6B3E\u300B"))
|
|
);
|
|
};
|
|
/* harmony default export */ var LoginSmsPanel = ((0,_umi_production_exports.connect)(
|
|
({
|
|
globalSetting,
|
|
user
|
|
}) => ({
|
|
globalSetting,
|
|
user
|
|
})
|
|
)(RegisterComponent));
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
var tooltip = __webpack_require__(6848);
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/RegisterPanel/index.tsx
|
|
var RegisterPanel_defProp = Object.defineProperty;
|
|
var RegisterPanel_defProps = Object.defineProperties;
|
|
var RegisterPanel_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var RegisterPanel_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var RegisterPanel_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var RegisterPanel_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var RegisterPanel_defNormalProp = (obj, key, value) => key in obj ? RegisterPanel_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var RegisterPanel_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (RegisterPanel_hasOwnProp.call(b, prop))
|
|
RegisterPanel_defNormalProp(a, prop, b[prop]);
|
|
if (RegisterPanel_getOwnPropSymbols)
|
|
for (var prop of RegisterPanel_getOwnPropSymbols(b)) {
|
|
if (RegisterPanel_propIsEnum.call(b, prop))
|
|
RegisterPanel_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var RegisterPanel_spreadProps = (a, b) => RegisterPanel_defProps(a, RegisterPanel_getOwnPropDescs(b));
|
|
var RegisterPanel_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
const RegisterPanel_inputStyle = { height: 48 };
|
|
const RegisterPanel_loginRegex = /(\b[\w\.-]+@[\w\.-]+\.\w{2,4}\b)|(^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$)/i;
|
|
const RegisterPanel_password = /^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{8,16}$/;
|
|
const RegisterPanel_initialState = {
|
|
timer: 0
|
|
};
|
|
var RegisterPanel_Types = /* @__PURE__ */ ((Types2) => {
|
|
Types2[Types2["setTimer"] = 0] = "setTimer";
|
|
return Types2;
|
|
})(RegisterPanel_Types || {});
|
|
function RegisterPanel_reducer(state, action) {
|
|
switch (action.type) {
|
|
case 0 /* setTimer */:
|
|
return RegisterPanel_spreadProps(RegisterPanel_spreadValues({}, state), { timer: action.payload });
|
|
default:
|
|
throw new Error();
|
|
}
|
|
}
|
|
const RegisterPanel_RegisterComponent = ({ validateName, getCode, register, style = {}, buttonText = "\u6CE8\u518C", globalSetting }) => {
|
|
var _a;
|
|
const [form] = es_form["default"].useForm();
|
|
const [state, dispatch] = (0,_react_17_0_2_react.useReducer)(RegisterPanel_reducer, RegisterPanel_initialState);
|
|
const [codeLoading, setCodeLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const { timer } = state;
|
|
function onFinish(values) {
|
|
return RegisterPanel_async(this, null, function* () {
|
|
const { login, password: password2, code } = values;
|
|
const { message, status } = yield register({ login, password: password2, code });
|
|
if (status < 0) {
|
|
form.setFields([{
|
|
name: "code",
|
|
errors: [message]
|
|
}]);
|
|
return;
|
|
}
|
|
window.location.reload();
|
|
});
|
|
}
|
|
function onValidateName() {
|
|
return RegisterPanel_async(this, null, function* () {
|
|
let login = form.getFieldValue("login");
|
|
let flag = 0;
|
|
if (!RegisterPanel_loginRegex.test(login) || login.indexOf(" ") > -1) {
|
|
form.setFields([{
|
|
name: "login",
|
|
errors: ["\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u6216\u90AE\u7BB1"]
|
|
}]);
|
|
flag = 1;
|
|
return flag;
|
|
}
|
|
let { status, message } = yield validateName({ login, type: 1 });
|
|
const isOk = status > 0;
|
|
if (isOk) {
|
|
flag = 2;
|
|
} else {
|
|
form.setFields([{
|
|
name: "login",
|
|
errors: [message]
|
|
}]);
|
|
flag = 1;
|
|
}
|
|
return flag;
|
|
});
|
|
}
|
|
const onGetCode = () => RegisterPanel_async(void 0, null, function* () {
|
|
const verify = form.getFieldValue("verify");
|
|
const login = form.getFieldValue("login");
|
|
if (!login) {
|
|
form.validateFields(["login"]);
|
|
} else {
|
|
const res = yield validateName({ login, type: 1 });
|
|
if ((res == null ? void 0 : res.status) !== 1) {
|
|
form.setFields([{
|
|
name: "login",
|
|
errors: [res == null ? void 0 : res.message]
|
|
}]);
|
|
return;
|
|
}
|
|
setCodeLoading(true);
|
|
const { status, message } = yield getCode({
|
|
login,
|
|
type: 1,
|
|
smscode: (0,util/* setmiyah */.M)(login)
|
|
});
|
|
if (status < 0) {
|
|
form.setFields([{
|
|
name: "code",
|
|
errors: [message]
|
|
}]);
|
|
}
|
|
dispatch({
|
|
type: 0 /* setTimer */,
|
|
payload: 60
|
|
});
|
|
setCodeLoading(false);
|
|
}
|
|
});
|
|
function validatePassword(_, value) {
|
|
if (!value) {
|
|
return Promise.resolve();
|
|
}
|
|
if (!RegisterPanel_password.test(value)) {
|
|
return Promise.reject("\u8BF7\u8F93\u51658~16\u4F4D\u5B57\u7B26\uFF0C\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u7279\u6B8A\u7B26\u53F7\u81F3\u5C11\u5305\u542B2\u79CD");
|
|
}
|
|
if (value.indexOf(" ") > -1) {
|
|
return Promise.reject("\u8BF7\u8F93\u51658-16\u4F4D\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199\u3001\u4E0D\u80FD\u4F7F\u7528\u7A7A\u683C");
|
|
}
|
|
const len = value.length;
|
|
if (len >= 8 && len <= 16) {
|
|
return Promise.resolve();
|
|
} else {
|
|
return Promise.reject("\u8BF7\u8F93\u51658-16\u4F4D\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199\u3001\u4E0D\u80FD\u4F7F\u7528\u7A7A\u683C");
|
|
}
|
|
}
|
|
const verifyValidate = (_, value) => {
|
|
return value ? Promise.resolve() : Promise.reject("\u8BF7\u62D6\u52A8\u6ED1\u5757\u9A8C\u8BC1");
|
|
};
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (timer > 0) {
|
|
setTimeout(() => {
|
|
dispatch({
|
|
type: 0 /* setTimer */,
|
|
payload: timer - 1
|
|
});
|
|
}, 1e3);
|
|
}
|
|
}, [timer]);
|
|
const LoginValidate = (_, value) => {
|
|
if (!value) {
|
|
return Promise.resolve();
|
|
}
|
|
if (value.indexOf(" ") > -1) {
|
|
return Promise.reject("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u6216\u90AE\u7BB1");
|
|
}
|
|
if (RegisterPanel_loginRegex.test(value)) {
|
|
return Promise.resolve();
|
|
} else {
|
|
return Promise.reject("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u6216\u90AE\u7BB1");
|
|
}
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"],
|
|
{
|
|
layout: "vertical",
|
|
form,
|
|
style,
|
|
initialValues: { autologin: true, protool: false },
|
|
onFinish
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "login",
|
|
rules: [
|
|
{ required: true, message: "\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u6216\u90AE\u7BB1" },
|
|
{ validator: LoginValidate }
|
|
]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"],
|
|
{
|
|
style: RegisterPanel_inputStyle,
|
|
autoComplete: "new-login",
|
|
size: "middle",
|
|
placeholder: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u624B\u673A\u53F7/\u90AE\u7BB1\u53F7",
|
|
onBlur: () => onValidateName,
|
|
onChange: () => form.setFieldsValue({ verify: 0 })
|
|
}
|
|
)
|
|
),
|
|
!((_a = globalSetting == null ? void 0 : globalSetting.setting) == null ? void 0 : _a.is_local) && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "code",
|
|
rules: [{ required: true, message: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801" }]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"],
|
|
{
|
|
suffix: /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { loading: codeLoading, type: "link", onClick: onGetCode, disabled: timer > 0 }, " ", timer === 0 ? "\u83B7\u53D6\u9A8C\u8BC1\u7801" : `${timer}\u79D2\u53EF\u91CD\u65B0\u83B7\u53D6`),
|
|
style: { paddingRight: 2, height: 48 },
|
|
placeholder: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",
|
|
size: "middle"
|
|
}
|
|
)
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u957F\u5EA6\u4E3A8-16\u4F4D\u5B57\u7B26"), /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5B57\u6BCD/\u6570\u5B57\u4EE5\u53CA\u6807\u70B9\u7B26\u53F7\u81F3\u5C11\u5305\u542B2\u79CD"), /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u4E0D\u5141\u8BB8\u6709\u7A7A\u683C\u3001\u4E2D\u6587")), placement: "topRight" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: "password", rules: [
|
|
{ required: true, message: "\u8BF7\u8F93\u51658-16\u4F4D\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199\u3001\u4E0D\u80FD\u4F7F\u7528\u7A7A\u683C" },
|
|
{ validator: validatePassword }
|
|
] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"].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"
|
|
}
|
|
))),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, null, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { size: "middle", type: "primary", htmlType: "submit", block: true, style: RegisterPanel_inputStyle, className: "font16" }, " ", buttonText, " ")),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tc", style: { paddingTop: 0, paddingBottom: 35 } }, "\u6CE8\u518C\u5E76\u767B\u5F55\u5373\u4EE3\u8868\u60A8\u5DF2\u9605\u8BFB\u5E76\u540C\u610F", /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: "https://engineer.educoder.net/help?index=4", target: "_blank" }, "\u300A\u670D\u52A1\u534F\u8BAE\u6761\u6B3E\u300B"))
|
|
);
|
|
};
|
|
/* harmony default export */ var RegisterPanel = ((0,_umi_production_exports.connect)(
|
|
({
|
|
globalSetting
|
|
}) => ({
|
|
globalSetting
|
|
})
|
|
)(RegisterPanel_RegisterComponent));
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_lodash@4.17.21@lodash/lodash.js
|
|
var lodash = __webpack_require__(89392);
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/ResetPassword/index.tsx
|
|
var ResetPassword_defProp = Object.defineProperty;
|
|
var ResetPassword_defProps = Object.defineProperties;
|
|
var ResetPassword_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var ResetPassword_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var ResetPassword_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var ResetPassword_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var ResetPassword_defNormalProp = (obj, key, value) => key in obj ? ResetPassword_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var ResetPassword_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (ResetPassword_hasOwnProp.call(b, prop))
|
|
ResetPassword_defNormalProp(a, prop, b[prop]);
|
|
if (ResetPassword_getOwnPropSymbols)
|
|
for (var prop of ResetPassword_getOwnPropSymbols(b)) {
|
|
if (ResetPassword_propIsEnum.call(b, prop))
|
|
ResetPassword_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var ResetPassword_spreadProps = (a, b) => ResetPassword_defProps(a, ResetPassword_getOwnPropDescs(b));
|
|
var ResetPassword_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const ResetPassword_inputStyle = { height: 48 };
|
|
const 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;
|
|
const ResetPassword_password = /^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{8,16}$/;
|
|
const ResetPassword_initialState = {
|
|
timer: 0
|
|
};
|
|
var ResetPassword_Types = /* @__PURE__ */ ((Types2) => {
|
|
Types2[Types2["setTimer"] = 0] = "setTimer";
|
|
return Types2;
|
|
})(ResetPassword_Types || {});
|
|
function ResetPassword_reducer(state, action) {
|
|
switch (action.type) {
|
|
case 0 /* setTimer */:
|
|
return ResetPassword_spreadProps(ResetPassword_spreadValues({}, state), { timer: action.payload });
|
|
default:
|
|
throw new Error();
|
|
}
|
|
}
|
|
const ResetPassword_RegisterComponent = ({ validateName, getCode, register, style = {}, buttonText = "\u6CE8\u518C", globalSetting }) => {
|
|
var _a;
|
|
const [form] = es_form["default"].useForm();
|
|
const [state, dispatch] = (0,_react_17_0_2_react.useReducer)(ResetPassword_reducer, ResetPassword_initialState);
|
|
const [codeLoading, setCodeLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const { timer } = state;
|
|
function onFinish(values) {
|
|
return ResetPassword_async(this, null, function* () {
|
|
const { login, new_password, code } = values;
|
|
const { message, status } = yield register({ login, new_password, code });
|
|
if (status < 0) {
|
|
form.setFields([{
|
|
name: "code",
|
|
errors: [message]
|
|
}]);
|
|
return;
|
|
}
|
|
location.reload();
|
|
});
|
|
}
|
|
function onValidateName() {
|
|
return ResetPassword_async(this, null, function* () {
|
|
let login = form.getFieldValue("login");
|
|
let flag = 0;
|
|
if (!ResetPassword_loginRegex.test(login) || login.indexOf(" ") > -1) {
|
|
form.setFields([{
|
|
name: "login",
|
|
errors: ["\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u6216\u90AE\u7BB1"]
|
|
}]);
|
|
flag = 1;
|
|
return flag;
|
|
}
|
|
let { status, message } = yield validateName({ login, type: 2 });
|
|
const isOk = status > 0;
|
|
if (isOk) {
|
|
flag = 2;
|
|
} else {
|
|
form.setFields([{
|
|
name: "login",
|
|
errors: [message]
|
|
}]);
|
|
flag = 1;
|
|
}
|
|
return flag;
|
|
});
|
|
}
|
|
const onGetCode = () => ResetPassword_async(void 0, null, function* () {
|
|
const verify = form.getFieldValue("verify");
|
|
const login = form.getFieldValue("login");
|
|
yield form.validateFields(["login"]);
|
|
if (!login) {
|
|
form.validateFields(["login"]);
|
|
} else {
|
|
setCodeLoading(true);
|
|
const { status, message } = yield getCode({
|
|
login,
|
|
type: 2,
|
|
smscode: (0,util/* setmiyah */.M)(login)
|
|
});
|
|
if (status < 0) {
|
|
form.setFields([{
|
|
name: "code",
|
|
errors: [message]
|
|
}]);
|
|
}
|
|
dispatch({
|
|
type: 0 /* setTimer */,
|
|
payload: 60
|
|
});
|
|
setCodeLoading(false);
|
|
}
|
|
});
|
|
function validatePassword(_, value) {
|
|
if (!value) {
|
|
return Promise.resolve();
|
|
}
|
|
if (!ResetPassword_password.test(value)) {
|
|
return Promise.reject("\u8BF7\u8F93\u51658~16\u4F4D\u5B57\u7B26\uFF0C\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u7279\u6B8A\u7B26\u53F7\u81F3\u5C11\u5305\u542B2\u79CD");
|
|
}
|
|
if (value.indexOf(" ") > -1) {
|
|
return Promise.reject("\u8BF7\u8F93\u51658-16\u4F4D\u65B0\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199\u3001\u4E0D\u80FD\u4F7F\u7528\u7A7A\u683C");
|
|
}
|
|
const len = value.length;
|
|
if (len >= 8 && len <= 16) {
|
|
return Promise.resolve();
|
|
} else {
|
|
return Promise.reject("\u8BF7\u8F93\u51658-16\u4F4D\u65B0\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199\u3001\u4E0D\u80FD\u4F7F\u7528\u7A7A\u683C");
|
|
}
|
|
}
|
|
const verifyValidate = (_, value) => {
|
|
return value ? Promise.resolve() : Promise.reject("\u8BF7\u62D6\u52A8\u6ED1\u5757\u9A8C\u8BC1");
|
|
};
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (timer > 0) {
|
|
setTimeout(() => {
|
|
dispatch({
|
|
type: 0 /* setTimer */,
|
|
payload: timer - 1
|
|
});
|
|
}, 1e3);
|
|
}
|
|
}, [timer]);
|
|
const LoginValidate = (_, value) => ResetPassword_async(void 0, null, function* () {
|
|
if (!value) {
|
|
return Promise.resolve();
|
|
}
|
|
if (value.indexOf(" ") > -1) {
|
|
return Promise.reject("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u6216\u90AE\u7BB1");
|
|
}
|
|
if (ResetPassword_loginRegex.test(value)) {
|
|
let { status, message } = yield validateName({ login: value, type: 2 });
|
|
const isOk = status > 0;
|
|
if (isOk) {
|
|
return Promise.resolve();
|
|
} else {
|
|
return Promise.reject(message);
|
|
}
|
|
} else {
|
|
return Promise.reject("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u6216\u90AE\u7BB1");
|
|
}
|
|
});
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"],
|
|
{
|
|
layout: "vertical",
|
|
form,
|
|
style,
|
|
initialValues: { autologin: true, protool: false },
|
|
onFinish: (0,lodash.throttle)(onFinish, 2e3)
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "login",
|
|
rules: [
|
|
{ required: true, message: "\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u6216\u90AE\u7BB1" },
|
|
{ validator: (0,lodash.throttle)(LoginValidate, 400) }
|
|
]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"],
|
|
{
|
|
style: ResetPassword_inputStyle,
|
|
autoComplete: "new-login",
|
|
size: "middle",
|
|
placeholder: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u624B\u673A\u53F7/\u90AE\u7BB1\u53F7",
|
|
onChange: () => form.setFieldsValue({ verify: 0 })
|
|
}
|
|
)
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u957F\u5EA6\u4E3A8-16\u4F4D\u5B57\u7B26"), /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5B57\u6BCD/\u6570\u5B57\u4EE5\u53CA\u6807\u70B9\u7B26\u53F7\u81F3\u5C11\u5305\u542B2\u79CD"), /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u4E0D\u5141\u8BB8\u6709\u7A7A\u683C\u3001\u4E2D\u6587")), placement: "topRight" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: "new_password", rules: [
|
|
{ required: true, message: "\u8BF7\u8F93\u51658-16\u4F4D\u65B0\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199\u3001\u4E0D\u80FD\u4F7F\u7528\u7A7A\u683C" },
|
|
{ validator: validatePassword }
|
|
] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"].Password,
|
|
{
|
|
autoComplete: "new-password",
|
|
style: ResetPassword_inputStyle,
|
|
size: "middle",
|
|
placeholder: "\u8F93\u51658\uFF5E16\u4F4D\u65B0\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199"
|
|
}
|
|
))),
|
|
!((_a = globalSetting == null ? void 0 : globalSetting.setting) == null ? void 0 : _a.is_local) && /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "code",
|
|
rules: [{ required: true, message: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801" }]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"],
|
|
{
|
|
suffix: /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { loading: codeLoading, type: "link", onClick: onGetCode, disabled: timer > 0 }, " ", timer === 0 ? "\u83B7\u53D6\u9A8C\u8BC1\u7801" : `${timer}\u79D2\u53EF\u91CD\u65B0\u83B7\u53D6`),
|
|
style: { paddingRight: 2, height: 48 },
|
|
placeholder: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",
|
|
size: "middle"
|
|
}
|
|
)
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, null, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { size: "middle", type: "primary", htmlType: "submit", block: true, style: ResetPassword_inputStyle, className: "font16" }, " ", buttonText, " ")),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tc", style: { paddingTop: 0, paddingBottom: 20 } }, "\u4FEE\u6539\u5E76\u767B\u5F55\u5373\u4EE3\u8868\u60A8\u5DF2\u9605\u8BFB\u5E76\u540C\u610F", /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: "https://engineer.educoder.net/help?index=4", target: "_blank" }, "\u300A\u670D\u52A1\u534F\u8BAE\u6761\u6B3E\u300B"))
|
|
);
|
|
};
|
|
/* harmony default export */ var ResetPassword = ((0,_umi_production_exports.connect)(
|
|
({
|
|
globalSetting
|
|
}) => ({
|
|
globalSetting
|
|
})
|
|
)(ResetPassword_RegisterComponent));
|
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/OauthPanel/wechat.svg
|
|
var wechat_defProp = Object.defineProperty;
|
|
var wechat_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var wechat_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var wechat_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var wechat_defNormalProp = (obj, key, value) => key in obj ? wechat_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var wechat_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (wechat_hasOwnProp.call(b, prop))
|
|
wechat_defNormalProp(a, prop, b[prop]);
|
|
if (wechat_getOwnPropSymbols)
|
|
for (var prop of wechat_getOwnPropSymbols(b)) {
|
|
if (wechat_propIsEnum.call(b, prop))
|
|
wechat_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
const SvgWechat = (props) => /* @__PURE__ */ React.createElement("svg", wechat_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
|
|
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 = (obj, key, value) => key in obj ? qq_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var qq_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (qq_hasOwnProp.call(b, prop))
|
|
qq_defNormalProp(a, prop, b[prop]);
|
|
if (qq_getOwnPropSymbols)
|
|
for (var prop of qq_getOwnPropSymbols(b)) {
|
|
if (qq_propIsEnum.call(b, prop))
|
|
qq_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
|
|
const SvgQq = (props) => /* @__PURE__ */ React.createElement("svg", qq_spreadValues({ className: "qq_svg__icon", viewBox: "0 0 1024 1024", xmlns: "http://www.w3.org/2000/svg", width: 200, height: 200 }, props), /* @__PURE__ */ React.createElement("path", { d: "M512 0C229.356 0 0 229.356 0 512s229.356 512 512 512 512-229.356 512-512S794.644 0 512 0zm235.75 647.603c-10.7 5.417-27.417-6.963-43.34-30.157-6.267 25.262-21.673 47.95-43.607 66.253 23.244 8.505 38.123 22.17 38.123 37.898 0 25.519-40.99 46.403-91.387 46.403-45.43 0-83.287-17.014-90.076-38.927h-10.967C499.446 751.243 461.85 768 416.42 768c-50.396 0-91.387-20.623-91.387-46.403 0-15.728 15.145-29.388 38.118-37.898-21.929-18.304-37.596-41.252-43.602-66.253-15.667 23.194-32.634 35.83-43.34 30.157-15.668-7.987-12.534-51.046 7.05-96.159 15.145-35.317 36.03-61.614 51.697-67.287-.262-2.319-.262-4.638-.262-6.707 0-13.66 3.917-26.291 10.445-36.608v-2.314c0-6.19 1.567-12.119 4.178-17.275C353.23 329.216 414.07 256 512.241 256s159.006 73.216 162.923 165.253a38.374 38.374 0 0 1 4.178 17.275v2.32c6.528 10.311 10.445 22.942 10.445 36.607 0 2.32 0 4.64-.261 6.702 15.923 5.673 36.557 31.97 51.696 67.287 19.062 45.118 22.196 88.167 6.528 96.16z", fill: "#378AFE" }));
|
|
|
|
/* harmony default export */ var qq = ("data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+PHBhdGggZD0iTTUxMiAwQzIyOS4zNTYgMCAwIDIyOS4zNTYgMCA1MTJzMjI5LjM1NiA1MTIgNTEyIDUxMiA1MTItMjI5LjM1NiA1MTItNTEyUzc5NC42NDQgMCA1MTIgMHptMjM1Ljc1IDY0Ny42MDNjLTEwLjcgNS40MTctMjcuNDE3LTYuOTYzLTQzLjM0LTMwLjE1Ny02LjI2NyAyNS4yNjItMjEuNjczIDQ3Ljk1LTQzLjYwNyA2Ni4yNTMgMjMuMjQ0IDguNTA1IDM4LjEyMyAyMi4xNyAzOC4xMjMgMzcuODk4IDAgMjUuNTE5LTQwLjk5IDQ2LjQwMy05MS4zODcgNDYuNDAzLTQ1LjQzIDAtODMuMjg3LTE3LjAxNC05MC4wNzYtMzguOTI3aC0xMC45NjdDNDk5LjQ0NiA3NTEuMjQzIDQ2MS44NSA3NjggNDE2LjQyIDc2OGMtNTAuMzk2IDAtOTEuMzg3LTIwLjYyMy05MS4zODctNDYuNDAzIDAtMTUuNzI4IDE1LjE0NS0yOS4zODggMzguMTE4LTM3Ljg5OC0yMS45MjktMTguMzA0LTM3LjU5Ni00MS4yNTItNDMuNjAyLTY2LjI1My0xNS42NjcgMjMuMTk0LTMyLjYzNCAzNS44My00My4zNCAzMC4xNTctMTUuNjY4LTcuOTg3LTEyLjUzNC01MS4wNDYgNy4wNS05Ni4xNTkgMTUuMTQ1LTM1LjMxNyAzNi4wMy02MS42MTQgNTEuNjk3LTY3LjI4Ny0uMjYyLTIuMzE5LS4yNjItNC42MzgtLjI2Mi02LjcwNyAwLTEzLjY2IDMuOTE3LTI2LjI5MSAxMC40NDUtMzYuNjA4di0yLjMxNGMwLTYuMTkgMS41NjctMTIuMTE5IDQuMTc4LTE3LjI3NUMzNTMuMjMgMzI5LjIxNiA0MTQuMDcgMjU2IDUxMi4yNDEgMjU2czE1OS4wMDYgNzMuMjE2IDE2Mi45MjMgMTY1LjI1M2EzOC4zNzQgMzguMzc0IDAgMCAxIDQuMTc4IDE3LjI3NXYyLjMyYzYuNTI4IDEwLjMxMSAxMC40NDUgMjIuOTQyIDEwLjQ0NSAzNi42MDcgMCAyLjMyIDAgNC42NC0uMjYxIDYuNzAyIDE1LjkyMyA1LjY3MyAzNi41NTcgMzEuOTcgNTEuNjk2IDY3LjI4NyAxOS4wNjIgNDUuMTE4IDIyLjE5NiA4OC4xNjcgNi41MjggOTYuMTZ6IiBmaWxsPSIjMzc4QUZFIi8+PC9zdmc+");
|
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/OauthPanel/index.less?modules
|
|
// extracted by mini-css-extract-plugin
|
|
/* harmony default export */ var OauthPanelmodules = ({"other-login":"other-login___Jd48Z","btn-link":"btn-link___MhTA6","wechat-qrcode":"wechat-qrcode___bLWkh","driver":"driver___IuicK"});
|
|
// EXTERNAL MODULE: ./src/utils/env.ts + 1 modules
|
|
var env = __webpack_require__(64741);
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/OauthPanel/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const HOST = window.location.host;
|
|
const redirect_uri = env/* default */.Z.QQLoginCB;
|
|
/* harmony default export */ var OauthPanel = (({ onWechatLogin, setType, 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=${redirect_uri}%2fotherloginqq&state=null,${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=${redirect_uri}%2fotherloginqq&state=null,${HOST}&response_type=code`
|
|
);
|
|
}
|
|
}
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, (loginType === 1 || loginType === 2) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginTop: loginType === 4 ? 20 : 92, marginBottom: 60 }, className: "font16 tc" }, "\u6CA1\u6709\u8D26\u53F7\uFF1F", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: () => setType(3), className: "c-blue current" }, "\u514D\u8D39\u6CE8\u518C")), (loginType === 3 || loginType === 4 || loginType === 5) && /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginTop: 92, marginBottom: 60 }, className: "font16 tc" }, "\u5DF2\u6709\u8D26\u53F7\uFF1F", /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: () => setType(1), className: "c-blue current" }, "\u7ACB\u5373\u767B\u5F55")), /* @__PURE__ */ _react_17_0_2_react.createElement("p", { className: OauthPanelmodules.driver }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#444444" } }, "\u5FEB\u901F\u767B\u5F55")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: OauthPanelmodules["other-login"] }, /* @__PURE__ */ _react_17_0_2_react.createElement("a", { title: "\u5FAE\u4FE1\u767B\u5F55", onClick: onWechatLogin }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: wechat, alt: "\u5FAE\u4FE1", width: 66 })), /* @__PURE__ */ _react_17_0_2_react.createElement("a", { title: "qq\u767B\u5F55", onClick: onQQLogin }, /* @__PURE__ */ _react_17_0_2_react.createElement("img", { src: qq, alt: "QQ", width: 66 }))));
|
|
});
|
|
function WechatQrcode({
|
|
onBack,
|
|
setType
|
|
}) {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(_react_17_0_2_react.Fragment, null, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { overflow: "hidden", width: 300, height: 300, margin: "20px auto 0 auto" } }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
"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=${redirect_uri}%2fotherloginstart&response_type=code&scope=snsapi_login&state=null,${HOST}#wechat_redirect`
|
|
}
|
|
)), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { style: { marginTop: 17, marginBottom: 10 }, className: "font16 bold tc c-blue current" }, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { onClick: () => setType(1), style: { borderBottom: "2px solid #0152d9" } }, "\u8FD4\u56DE\u8D26\u53F7\u767B\u5F55")), /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tc", style: { paddingTop: 14, paddingBottom: 40 } }, "\u767B\u5F55\u5373\u4EE3\u8868\u60A8\u5DF2\u9605\u8BFB\u5E76\u540C\u610F", /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: "https://engineer.educoder.net/help?index=4", target: "_blank" }, "\u300A\u670D\u52A1\u534F\u8BAE\u6761\u6B3E\u300B")));
|
|
}
|
|
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/ChangPassword/index.tsx
|
|
var ChangPassword_defProp = Object.defineProperty;
|
|
var ChangPassword_defProps = Object.defineProperties;
|
|
var ChangPassword_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var ChangPassword_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var ChangPassword_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var ChangPassword_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var ChangPassword_defNormalProp = (obj, key, value) => key in obj ? ChangPassword_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var ChangPassword_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (ChangPassword_hasOwnProp.call(b, prop))
|
|
ChangPassword_defNormalProp(a, prop, b[prop]);
|
|
if (ChangPassword_getOwnPropSymbols)
|
|
for (var prop of ChangPassword_getOwnPropSymbols(b)) {
|
|
if (ChangPassword_propIsEnum.call(b, prop))
|
|
ChangPassword_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var ChangPassword_spreadProps = (a, b) => ChangPassword_defProps(a, ChangPassword_getOwnPropDescs(b));
|
|
var ChangPassword_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
const ChangPassword_inputStyle = { height: 48 };
|
|
const 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;
|
|
const ChangPassword_password = /^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{8,16}$/;
|
|
const ChangPassword_initialState = {
|
|
timer: 0
|
|
};
|
|
var ChangPassword_Types = /* @__PURE__ */ ((Types2) => {
|
|
Types2[Types2["setTimer"] = 0] = "setTimer";
|
|
return Types2;
|
|
})(ChangPassword_Types || {});
|
|
function ChangPassword_reducer(state, action) {
|
|
switch (action.type) {
|
|
case 0 /* setTimer */:
|
|
return ChangPassword_spreadProps(ChangPassword_spreadValues({}, state), { timer: action.payload });
|
|
default:
|
|
throw new Error();
|
|
}
|
|
}
|
|
const ChangPassword_RegisterComponent = ({ validateName, getCode, register, style = {}, buttonText = "\u6CE8\u518C", globalSetting }) => {
|
|
const [form] = es_form["default"].useForm();
|
|
const [state, dispatch] = (0,_react_17_0_2_react.useReducer)(ChangPassword_reducer, ChangPassword_initialState);
|
|
const [codeLoading, setCodeLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const { timer } = state;
|
|
function onFinish(values) {
|
|
return ChangPassword_async(this, null, function* () {
|
|
const { old_password, newPassword } = values;
|
|
const { message, status } = yield register({ old_password, newPassword });
|
|
if (status < 0) {
|
|
form.setFields([{
|
|
name: "code",
|
|
errors: [message]
|
|
}]);
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
const inputNewPassword = (rule, value, callback) => {
|
|
if (!value) {
|
|
callback("\u8BF7\u8F93\u51658-16\u4F4D\u5B57\u7B26\u7684\u65B0\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199\uFF01");
|
|
} else if (value.indexOf(" ") > -1) {
|
|
callback("\u8BF7\u8F93\u51658-16\u4F4D\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199\u3001\u4E0D\u80FD\u4F7F\u7528\u7A7A\u683C");
|
|
} else if (value.length < 8 || value.length > 16) {
|
|
callback("\u8BF7\u8F93\u51658-16\u4F4D\u5B57\u7B26\u7684\u65B0\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199\uFF01");
|
|
} else if (!ChangPassword_password.test(value)) {
|
|
callback("\u8BF7\u8F93\u51658~16\u4F4D\u5B57\u7B26\uFF0C\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u7279\u6B8A\u7B26\u53F7\u81F3\u5C11\u5305\u542B2\u79CD");
|
|
} else {
|
|
callback();
|
|
}
|
|
};
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (timer > 0) {
|
|
setTimeout(() => {
|
|
dispatch({
|
|
type: 0 /* setTimer */,
|
|
payload: timer - 1
|
|
});
|
|
}, 1e3);
|
|
}
|
|
}, [timer]);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"],
|
|
{
|
|
layout: "vertical",
|
|
form,
|
|
style,
|
|
initialValues: { autologin: true, protool: false },
|
|
onFinish
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "old_password",
|
|
rules: [
|
|
{ required: true, message: "\u8BF7\u8F93\u51658\uFF5E16\u4F4D\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199" }
|
|
]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"],
|
|
{
|
|
style: ChangPassword_inputStyle,
|
|
autoComplete: "new-login",
|
|
size: "middle",
|
|
type: "password",
|
|
placeholder: "\u8BF7\u8F93\u5165\u65E7\u5BC6\u7801",
|
|
onChange: () => form.setFieldsValue({ verify: 0 })
|
|
}
|
|
)
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u957F\u5EA6\u4E3A8-16\u4F4D\u5B57\u7B26"), /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5B57\u6BCD/\u6570\u5B57\u4EE5\u53CA\u6807\u70B9\u7B26\u53F7\u81F3\u5C11\u5305\u542B2\u79CD"), /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u4E0D\u5141\u8BB8\u6709\u7A7A\u683C\u3001\u4E2D\u6587")), placement: "topRight" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: "newPassword", rules: [
|
|
{ required: true, message: "\u8BF7\u8F93\u51658-16\u4F4D\u65B0\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199\u3001\u4E0D\u80FD\u4F7F\u7528\u7A7A\u683C" },
|
|
{ validator: inputNewPassword }
|
|
] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"].Password,
|
|
{
|
|
autoComplete: "new-password",
|
|
style: ChangPassword_inputStyle,
|
|
size: "middle",
|
|
placeholder: "\u8F93\u51658\uFF5E16\u4F4D\u65B0\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199"
|
|
}
|
|
))),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(tooltip/* default */.Z, { title: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u957F\u5EA6\u4E3A8-16\u4F4D\u5B57\u7B26"), /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u5B57\u6BCD/\u6570\u5B57\u4EE5\u53CA\u6807\u70B9\u7B26\u53F7\u81F3\u5C11\u5305\u542B2\u79CD"), /* @__PURE__ */ _react_17_0_2_react.createElement("br", null), /* @__PURE__ */ _react_17_0_2_react.createElement("span", null, "\u4E0D\u5141\u8BB8\u6709\u7A7A\u683C\u3001\u4E2D\u6587")), placement: "topRight" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, { name: "againPassword", rules: [
|
|
{ required: true, message: "\u8BF7\u518D\u6B21\u8F93\u5165\u65B0\u5BC6\u7801" },
|
|
{ validator: (rule, value, callback) => {
|
|
if (value != form.getFieldsValue().newPassword) {
|
|
callback("\u4E24\u6B21\u8F93\u5165\u7684\u65B0\u5BC6\u7801\u5FC5\u987B\u4E00\u81F4\uFF01");
|
|
} else {
|
|
callback();
|
|
}
|
|
} }
|
|
] }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"].Password,
|
|
{
|
|
autoComplete: "new-password",
|
|
style: ChangPassword_inputStyle,
|
|
size: "middle",
|
|
placeholder: "\u8BF7\u518D\u6B21\u8F93\u5165\u65B0\u5BC6\u7801"
|
|
}
|
|
))),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"].Item, null, /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { size: "middle", type: "primary", htmlType: "submit", block: true, style: ChangPassword_inputStyle, className: "font16" }, " ", buttonText, " ")),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "tc", style: { paddingTop: 0, paddingBottom: 20 } }, "\u4FEE\u6539\u5E76\u767B\u5F55\u5373\u4EE3\u8868\u60A8\u5DF2\u9605\u8BFB\u5E76\u540C\u610F", /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: "https://engineer.educoder.net/help?index=4", target: "_blank" }, "\u300A\u670D\u52A1\u534F\u8BAE\u6761\u6B3E\u300B"))
|
|
);
|
|
};
|
|
/* harmony default export */ var ChangPassword = ((0,_umi_production_exports.connect)(
|
|
({
|
|
globalSetting
|
|
}) => ({
|
|
globalSetting
|
|
})
|
|
)(ChangPassword_RegisterComponent));
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tabs/index.js + 24 modules
|
|
var tabs = __webpack_require__(99313);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/row/index.js
|
|
var row = __webpack_require__(95237);
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/col/index.js
|
|
var col = __webpack_require__(43604);
|
|
;// CONCATENATED MODULE: ./src/components/User/PopLoginRegister/components/LoginPanel/index.tsx
|
|
var LoginPanel_defProp = Object.defineProperty;
|
|
var LoginPanel_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var LoginPanel_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var LoginPanel_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var LoginPanel_defNormalProp = (obj, key, value) => key in obj ? LoginPanel_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var LoginPanel_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (LoginPanel_hasOwnProp.call(b, prop))
|
|
LoginPanel_defNormalProp(a, prop, b[prop]);
|
|
if (LoginPanel_getOwnPropSymbols)
|
|
for (var prop of LoginPanel_getOwnPropSymbols(b)) {
|
|
if (LoginPanel_propIsEnum.call(b, prop))
|
|
LoginPanel_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var LoginPanel_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { TabPane } = tabs["default"];
|
|
/* harmony default export */ var LoginPanel = (({ dispatch, is_main_site, is_local, style = {} }) => {
|
|
const [wechatQrcode, setWechatQrcode] = (0,_react_17_0_2_react.useState)(false);
|
|
const [type, setType] = (0,_react_17_0_2_react.useState)("1");
|
|
const [loginType, setLoginType] = (0,_react_17_0_2_react.useState)(1);
|
|
const [username, setusername] = (0,_react_17_0_2_react.useState)();
|
|
function onBack() {
|
|
setLoginType(1);
|
|
setWechatQrcode(false);
|
|
}
|
|
function onWechatLogin() {
|
|
setLoginType(2);
|
|
setWechatQrcode(true);
|
|
}
|
|
function callback(key) {
|
|
console.log(key);
|
|
setType(key);
|
|
}
|
|
const loginOption = {
|
|
buttonText: "\u767B \u5F55",
|
|
validateName: service_user/* validateName */.Ol,
|
|
getCode: service_user/* getValidateCode */.o1,
|
|
register: (values) => LoginPanel_async(void 0, null, function* () {
|
|
const response = yield (0,service_user/* LoginForPhone */.Gq)({ phone: values.login, code: values.code });
|
|
if (response.status === 0) {
|
|
if (response == null ? void 0 : response.show) {
|
|
localStorage.setItem("extension-modal", "exist");
|
|
localStorage.setItem("extension-date", response == null ? void 0 : response.start_date);
|
|
} else {
|
|
localStorage.removeItem("extension-modal");
|
|
}
|
|
return "/";
|
|
}
|
|
return response;
|
|
})
|
|
};
|
|
const registerOption = {
|
|
buttonText: "\u6CE8\u518C\u5E76\u767B\u5F55",
|
|
validateName: service_user/* validateName */.Ol,
|
|
getCode: service_user/* getValidateCode */.o1,
|
|
register: (values) => LoginPanel_async(void 0, null, function* () {
|
|
const response = yield (0,service_user/* register */.z2)(LoginPanel_spreadValues({}, values));
|
|
if (response.status === 0) {
|
|
let addinfo = localStorage.getItem("addinfo");
|
|
if (addinfo === "1") {
|
|
localStorage.setItem("addinfo", "2");
|
|
} else {
|
|
localStorage.setItem("registeruser", "1");
|
|
}
|
|
localStorage.removeItem("extension-modal");
|
|
message/* default */.ZP.info("\u6CE8\u518C\u5E76\u767B\u9646\u6210\u529F");
|
|
return "/";
|
|
}
|
|
return response;
|
|
})
|
|
};
|
|
const Password = {
|
|
buttonText: "\u4FEE\u6539\u5BC6\u7801",
|
|
validateName: service_user/* validateName */.Ol,
|
|
getCode: service_user/* getValidateCode */.o1,
|
|
register: (values) => LoginPanel_async(void 0, null, function* () {
|
|
const response = yield (0,service_user/* changPassword */.Ex)(LoginPanel_spreadValues({ login: username }, values));
|
|
message/* default */.ZP.info("\u4FEE\u6539\u5BC6\u7801\u6210\u529F");
|
|
return response;
|
|
})
|
|
};
|
|
const resetOption = {
|
|
buttonText: "\u4FEE\u6539\u5E76\u767B\u5F55",
|
|
validateName: service_user/* validateName */.Ol,
|
|
getCode: service_user/* getValidateCode */.o1,
|
|
register: (values) => LoginPanel_async(void 0, null, function* () {
|
|
return new Promise((resolve) => LoginPanel_async(void 0, null, function* () {
|
|
values.new_password_confirmation = values.new_password;
|
|
const response = yield (0,service_user/* resetPassword */.c0)(LoginPanel_spreadValues({}, values));
|
|
if (response.status === 0) {
|
|
if (response == null ? void 0 : response.show) {
|
|
localStorage.setItem("extension-modal", "exist");
|
|
localStorage.setItem("extension-date", response == null ? void 0 : response.start_date);
|
|
} else {
|
|
localStorage.removeItem("extension-modal");
|
|
}
|
|
message/* default */.ZP.info("\u4FEE\u6539\u6210\u529F");
|
|
resolve("/");
|
|
return "/";
|
|
}
|
|
resolve(response);
|
|
return response;
|
|
}));
|
|
})
|
|
};
|
|
const loginDom = (0,_react_17_0_2_react.useCallback)(() => {
|
|
switch (loginType) {
|
|
case 1:
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(tabs["default"], { defaultActiveKey: type, onChange: callback, className: LoginPanelmodules.tabs }, /* @__PURE__ */ _react_17_0_2_react.createElement(TabPane, { tab: "\u8D26\u53F7\u767B\u5F55", key: "1" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt20" }, type === "1" && /* @__PURE__ */ _react_17_0_2_react.createElement(LoginForm, { setusername, setType: setLoginType }))), /* @__PURE__ */ _react_17_0_2_react.createElement(TabPane, { tab: "\u9A8C\u8BC1\u7801\u767B\u5F55", key: "2" }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "mt20" }, type === "2" && /* @__PURE__ */ _react_17_0_2_react.createElement(LoginSmsPanel, LoginPanel_spreadValues({}, loginOption)))));
|
|
break;
|
|
case 2:
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(WechatQrcode, { setType: setLoginType, onBack });
|
|
break;
|
|
case 3:
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "ml40" }, /* @__PURE__ */ _react_17_0_2_react.createElement("h1", { className: "font18 mb20 mt35" }, "\u65B0\u7528\u6237\u6CE8\u518C"), /* @__PURE__ */ _react_17_0_2_react.createElement(RegisterPanel, LoginPanel_spreadValues({}, registerOption)));
|
|
break;
|
|
case 4:
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "ml40" }, /* @__PURE__ */ _react_17_0_2_react.createElement("h1", { className: "font18 mb20 mt35" }, "\u627E\u56DE\u5BC6\u7801"), /* @__PURE__ */ _react_17_0_2_react.createElement(ResetPassword, LoginPanel_spreadValues({}, resetOption)));
|
|
break;
|
|
case 5:
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: "ml40" }, /* @__PURE__ */ _react_17_0_2_react.createElement("h1", { className: "font18 mb20 mt35" }, "\u4FEE\u6539\u5BC6\u7801"), /* @__PURE__ */ _react_17_0_2_react.createElement(ChangPassword, LoginPanel_spreadValues({}, Password)));
|
|
break;
|
|
}
|
|
}, [loginType, type]);
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: LoginPanelmodules["login-panel-wrapper2"], style }, /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, null, /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "1" }, loginDom()), /* @__PURE__ */ _react_17_0_2_react.createElement(col/* default */.Z, { flex: "295px", className: LoginPanelmodules["login-panel-right-wrp"] }, !is_local && /* @__PURE__ */ _react_17_0_2_react.createElement(OauthPanel, { loginType, setType: setLoginType, 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
|
|
|
|
|
|
|
|
|
|
|
|
const PopLogin_LoginPopComponents = ({
|
|
user,
|
|
globalSetting,
|
|
loading,
|
|
dispatch
|
|
}) => {
|
|
var _a, _b;
|
|
const onCancel = () => {
|
|
dispatch({
|
|
type: "user/showPopLogin",
|
|
payload: {
|
|
showPopLogin: false,
|
|
showClosable: false
|
|
}
|
|
});
|
|
};
|
|
const is_main_site = (_a = globalSetting.setting) == null ? void 0 : _a.main_site;
|
|
const is_local = (_b = globalSetting.setting) == null ? void 0 : _b.is_local;
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
modal["default"],
|
|
{
|
|
centered: true,
|
|
open: user.showPopLogin,
|
|
footer: null,
|
|
width: !is_local ? 765 : 420,
|
|
keyboard: false,
|
|
maskClosable: false,
|
|
wrapClassName: PopLoginmodules.popLogin,
|
|
closable: user.showClosable,
|
|
onCancel
|
|
},
|
|
user.showPopLogin && /* @__PURE__ */ _react_17_0_2_react.createElement(LoginPanel, { is_main_site, is_local })
|
|
);
|
|
};
|
|
/* harmony default export */ var PopLogin = ((0,_umi_production_exports.connect)(
|
|
({
|
|
user,
|
|
loading,
|
|
globalSetting
|
|
}) => ({
|
|
user,
|
|
globalSetting,
|
|
loading: loading.models.index
|
|
})
|
|
)(PopLogin_LoginPopComponents));
|
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
var fetch = __webpack_require__(87101);
|
|
;// 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 BindAccountPanel_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const phoneReg = /^1\d{10}$/;
|
|
const emailReg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
|
|
const passwordReg = /^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{8,16}$/;
|
|
const BindAccountPanel = ({
|
|
user,
|
|
globalSetting,
|
|
dispatch
|
|
}) => {
|
|
const [searchParams] = (0,_umi_production_exports.useSearchParams)();
|
|
const inputStyle = { height: 48, borderRadius: 4 };
|
|
const [form] = es_form["default"].useForm();
|
|
const onCancel = () => {
|
|
dispatch({
|
|
type: "user/setBindAccountModal",
|
|
payload: {
|
|
bindAccountModalVisible: false
|
|
}
|
|
});
|
|
form.resetFields();
|
|
};
|
|
const Validate = (_, value) => {
|
|
if (!value) {
|
|
return Promise.resolve();
|
|
}
|
|
if (value.indexOf(" ") > -1) {
|
|
return Promise.reject("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u6216\u90AE\u7BB1");
|
|
}
|
|
if (phoneReg.test(value) || emailReg.test(value)) {
|
|
return Promise.resolve();
|
|
} else {
|
|
return Promise.reject("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u6216\u90AE\u7BB1");
|
|
}
|
|
};
|
|
const [timer, setTimer] = (0,_react_17_0_2_react.useState)(60);
|
|
const getCodeBtnDisabled = (0,_react_17_0_2_react.useMemo)(() => timer < 60 && timer > 0, [timer]);
|
|
const intervalId = (0,_react_17_0_2_react.useRef)();
|
|
const countDown = () => BindAccountPanel_async(void 0, null, function* () {
|
|
clearInterval(intervalId.current);
|
|
setTimer(60);
|
|
intervalId.current = setInterval(
|
|
function fn() {
|
|
setTimer((t) => t - 1);
|
|
return fn;
|
|
}(),
|
|
1e3
|
|
);
|
|
});
|
|
const [codeLoading, setCodeLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const [isshow, setisshow] = (0,_react_17_0_2_react.useState)(false);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (user.bindAccountModalVisible) {
|
|
setisshow(true);
|
|
} else {
|
|
setisshow(false);
|
|
}
|
|
}, [user]);
|
|
const handleGetCode = () => BindAccountPanel_async(void 0, null, function* () {
|
|
var _a;
|
|
const userInput = form.getFieldValue("userInput");
|
|
const isPhone = phoneReg.test(userInput);
|
|
const isEmail = emailReg.test(userInput);
|
|
if (!isPhone && !isEmail) {
|
|
message/* default */.ZP.error("\u8BF7\u8F93\u5165\u6709\u6548\u7684\u624B\u673A\u53F7/\u90AE\u7BB1\u53F7");
|
|
return;
|
|
}
|
|
setCodeLoading(true);
|
|
if (isPhone) {
|
|
const data = yield (0,fetch/* default */.ZP)(
|
|
`/api/users/accounts/${(_a = user.userInfoForBindAccountModal) == null ? void 0 : _a.login}/valid_phone.json`,
|
|
{
|
|
method: "get",
|
|
params: {
|
|
phone: userInput
|
|
}
|
|
}
|
|
);
|
|
if ((data == null ? void 0 : data.status) === -1) {
|
|
setCodeLoading(false);
|
|
return;
|
|
}
|
|
if (data == null ? void 0 : data.is_exists) {
|
|
message/* default */.ZP.info("\u8BE5\u624B\u673A\u53F7\u5DF2\u88AB\u5176\u5B83\u8D26\u53F7\u7ED1\u5B9A");
|
|
setCodeLoading(false);
|
|
return;
|
|
}
|
|
} else {
|
|
const data = yield (0,fetch/* default */.ZP)(`/api/accounts/valid_email_and_phone`, {
|
|
method: "get",
|
|
params: {
|
|
login: userInput,
|
|
type: 1
|
|
}
|
|
});
|
|
if ((data == null ? void 0 : data.status) === -3) {
|
|
message/* default */.ZP.info("\u8BE5\u90AE\u7BB1\u5DF2\u88AB\u6CE8\u518C");
|
|
setCodeLoading(false);
|
|
return;
|
|
}
|
|
}
|
|
let smscode = (0,util/* setmiyah */.M)(userInput);
|
|
const res = yield dispatch({
|
|
type: "account/getCode",
|
|
payload: { login: userInput, type: isPhone ? 3 : 4, smscode }
|
|
});
|
|
setCodeLoading(false);
|
|
if (res.status === 1) {
|
|
message/* default */.ZP.info("\u9A8C\u8BC1\u7801\u5DF2\u53D1\u9001\uFF0C\u8BF7\u6CE8\u610F\u67E5\u6536");
|
|
countDown();
|
|
}
|
|
});
|
|
const handleBind = () => BindAccountPanel_async(void 0, null, function* () {
|
|
var _a, _b;
|
|
yield form.validateFields();
|
|
const userInput = form.getFieldValue("userInput");
|
|
const code = form.getFieldValue("code");
|
|
const isPhone = phoneReg.test(userInput);
|
|
const isEmail = emailReg.test(userInput);
|
|
if (!isPhone && !isEmail) {
|
|
message/* default */.ZP.error("\u8BF7\u8F93\u5165\u6709\u6548\u7684\u624B\u673A\u53F7/\u90AE\u7BB1\u53F7");
|
|
return;
|
|
}
|
|
if (isPhone) {
|
|
const res = yield dispatch({
|
|
type: "account/bindPhone",
|
|
payload: { login: (_a = user.userInfoForBindAccountModal) == null ? void 0 : _a.login, phone: userInput, code }
|
|
});
|
|
return res.status === 0;
|
|
} else {
|
|
const res = yield dispatch({
|
|
type: "account/bindEmail",
|
|
payload: { login: (_b = user.userInfoForBindAccountModal) == null ? void 0 : _b.login, email: userInput, code }
|
|
});
|
|
return res.status === 0;
|
|
}
|
|
});
|
|
const handleLogin = () => BindAccountPanel_async(void 0, null, function* () {
|
|
const loginInfo = user.loginInfo;
|
|
if (!passwordReg.test(loginInfo.password)) {
|
|
message/* default */.ZP.error("\u7CFB\u7EDF\u68C0\u6D4B\u60A8\u7684\u5BC6\u7801\u5F3A\u5EA6\u8FC7\u4F4E\uFF0C\u8BF7\u53CA\u65F6\u4FEE\u6539");
|
|
}
|
|
const res = yield (0,service_user/* LoginIn */.Es)(loginInfo);
|
|
if (!!res.status) {
|
|
message/* default */.ZP.error(res == null ? void 0 : res.message);
|
|
return;
|
|
}
|
|
if (res == null ? void 0 : res.show) {
|
|
localStorage.setItem("extension-modal", "exist");
|
|
localStorage.setItem("extension-date", res == null ? void 0 : res.start_date);
|
|
} else {
|
|
localStorage.removeItem("extension-modal");
|
|
}
|
|
if (location.pathname === "/user/login" || location.pathname === "/login") {
|
|
let 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("\u7CFB\u7EDF\u68C0\u6D4B\u60A8\u7684\u5BC6\u7801\u5F3A\u5EA6\u8FC7\u4F4E\uFF0C\u8BF7\u53CA\u65F6\u4FEE\u6539");
|
|
window.location.href = "/account/secure";
|
|
} else {
|
|
window.location.reload();
|
|
}
|
|
}
|
|
} else {
|
|
if (!passwordReg.test(loginInfo.password)) {
|
|
message/* default */.ZP.info("\u7CFB\u7EDF\u68C0\u6D4B\u60A8\u7684\u5BC6\u7801\u5F3A\u5EA6\u8FC7\u4F4E\uFF0C\u8BF7\u53CA\u65F6\u4FEE\u6539");
|
|
_umi_production_exports.history.replace("/account/secure?active=3");
|
|
dispatch({
|
|
type: "user/setBindAccountModal",
|
|
payload: {
|
|
bindAccountModalVisible: false
|
|
}
|
|
});
|
|
} else {
|
|
window.location.reload();
|
|
}
|
|
}
|
|
form.resetFields();
|
|
});
|
|
const bindAndLogin = () => BindAccountPanel_async(void 0, null, function* () {
|
|
const successFlag = yield handleBind();
|
|
if (successFlag) {
|
|
yield handleLogin();
|
|
}
|
|
});
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
modal["default"],
|
|
{
|
|
centered: true,
|
|
open: isshow,
|
|
footer: null,
|
|
width: 596,
|
|
keyboard: false,
|
|
maskClosable: true,
|
|
wrapClassName: BindAccountPanelmodules.popLogin,
|
|
closable: true,
|
|
onCancel
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("h1", { className: "font18 mb20" }, "\u624B\u673A\u53F7/\u90AE\u7BB1\u7ED1\u5B9A"),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(es_form["default"], { layout: "vertical", form, autoComplete: "off", preserve: false }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "userInput",
|
|
rules: [
|
|
{ required: true, message: "\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7/\u90AE\u7BB1" },
|
|
{ validator: Validate }
|
|
]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"],
|
|
{
|
|
style: inputStyle,
|
|
size: "middle",
|
|
placeholder: "\u8BF7\u8F93\u5165\u6709\u6548\u7684\u624B\u673A\u53F7/\u90AE\u7BB1\u53F7"
|
|
}
|
|
)
|
|
), /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_form["default"].Item,
|
|
{
|
|
name: "code",
|
|
rules: [{ required: true, message: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801" }]
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
input["default"],
|
|
{
|
|
suffix: /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
loading: codeLoading,
|
|
type: "link",
|
|
onClick: handleGetCode,
|
|
disabled: getCodeBtnDisabled
|
|
},
|
|
getCodeBtnDisabled ? `${timer}\u79D2\u53EF\u91CD\u65B0\u83B7\u53D6` : "\u83B7\u53D6\u9A8C\u8BC1\u7801"
|
|
),
|
|
style: { paddingRight: 2, height: 48 },
|
|
placeholder: "\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801",
|
|
size: "middle"
|
|
}
|
|
)
|
|
)),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: BindAccountPanelmodules.tips }, "\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__ */ _react_17_0_2_react.createElement(
|
|
es_button/* default */.ZP,
|
|
{
|
|
size: "middle",
|
|
type: "primary",
|
|
block: true,
|
|
style: inputStyle,
|
|
className: "font16",
|
|
onClick: bindAndLogin
|
|
},
|
|
"\u7ED1\u5B9A\u5E76\u767B\u5F55"
|
|
),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: BindAccountPanelmodules.tips }, "\u767B\u5F55\u5373\u4EE3\u8868\u60A8\u5DF2\u9605\u8BFB\u5E76\u540C\u610F", /* @__PURE__ */ _react_17_0_2_react.createElement("a", { href: "https://engineer.educoder.net/help?index=4", target: "_blank" }, "\u300A\u670D\u52A1\u534F\u8BAE\u6761\u6B3E\u300B"))
|
|
);
|
|
};
|
|
/* harmony default export */ var User_BindAccountPanel = ((0,_umi_production_exports.connect)(
|
|
({
|
|
user,
|
|
loading,
|
|
globalSetting
|
|
}) => ({
|
|
user,
|
|
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 + 12 modules
|
|
var Header = __webpack_require__(87684);
|
|
;// 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__(7694);
|
|
;// CONCATENATED MODULE: ./src/components/PodModal/index.tsx
|
|
var PodModal_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const PodModal = ({}) => {
|
|
const [visible, setVisible] = (0,_react_17_0_2_react.useState)(false);
|
|
const [list, setList] = (0,_react_17_0_2_react.useState)([]);
|
|
const [checkboxList, setCheckboxList] = (0,_react_17_0_2_react.useState)([]);
|
|
const [all, setAll] = (0,_react_17_0_2_react.useState)(false);
|
|
const [loading, setLoading] = (0,_react_17_0_2_react.useState)(false);
|
|
const location = (0,_umi_production_exports.useLocation)();
|
|
const [searchParams] = (0,_umi_production_exports.useSearchParams)();
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
mediator/* default */.Z.subscribe("pod-restrict-data", (data) => {
|
|
console.log(data, "data");
|
|
setVisible(data.identifier || false);
|
|
setList(data.data_list || []);
|
|
setCheckboxList([]);
|
|
setAll(false);
|
|
});
|
|
}, []);
|
|
const del = () => PodModal_async(void 0, null, function* () {
|
|
setLoading(true);
|
|
const del_pods = list.filter((e) => checkboxList.includes(e.tpi_id));
|
|
const res = yield (0,fetch/* default */.ZP)(
|
|
`/api/myshixuns/batch_del_pods.json`,
|
|
{
|
|
method: "delete",
|
|
body: {
|
|
del_pods
|
|
}
|
|
}
|
|
);
|
|
if (res.status === 0) {
|
|
window.location.reload();
|
|
}
|
|
setLoading(false);
|
|
});
|
|
const cancel = () => {
|
|
var _a;
|
|
console.log(location, "location");
|
|
if ((_a = location.pathname) == null ? void 0 : _a.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/${visible}/challenges`;
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
modal["default"],
|
|
{
|
|
centered: true,
|
|
keyboard: false,
|
|
destroyOnClose: true,
|
|
open: visible,
|
|
title: "\u901A\u77E5",
|
|
width: "600px",
|
|
footer: /* @__PURE__ */ _react_17_0_2_react.createElement(row/* default */.Z, { align: "middle", justify: "center" }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_checkbox["default"], { onChange: (k) => {
|
|
var _a;
|
|
console.log(k, 222);
|
|
setAll(k.target.checked);
|
|
if (k.target.checked) {
|
|
setCheckboxList((_a = list == null ? void 0 : list.filter((e) => !e.is_current_shixun)) == null ? void 0 : _a.map((e) => e.tpi_id));
|
|
} else {
|
|
setCheckboxList([]);
|
|
}
|
|
}, checked: all }, "\u5168\u9009"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { style: { marginLeft: "auto" }, onClick: cancel }, "\u53D6\u6D88"), /* @__PURE__ */ _react_17_0_2_react.createElement(es_button/* default */.ZP, { disabled: !checkboxList.length, loading, type: "primary", onClick: del }, "\u5173\u95ED\u5B9E\u8BAD")),
|
|
onCancel: cancel
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { spinning: loading }, /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: PodModalmodules.wrap }, /* @__PURE__ */ _react_17_0_2_react.createElement("p", null, "\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 ? void 0 : list.map((e) => {
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement("div", { className: PodModalmodules.list, key: e.tpi_id }, /* @__PURE__ */ _react_17_0_2_react.createElement(es_checkbox["default"], { disabled: e.is_current_shixun, onChange: (k) => {
|
|
let newList = [...checkboxList];
|
|
if (k.target.checked) {
|
|
newList.push(e.tpi_id);
|
|
} else {
|
|
newList = checkboxList.filter((j) => j !== e.tpi_id);
|
|
}
|
|
setCheckboxList(newList);
|
|
setAll(newList.length === list.length);
|
|
}, checked: checkboxList == null ? void 0 : checkboxList.includes(e.tpi_id) }), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: PodModalmodules.name, onClick: () => (0,util/* openNewWindow */.xg)(`/shixuns/${e.shixun_identifier}/challenges`), title: e.shixun_name }, /* @__PURE__ */ _react_17_0_2_react.createElement("b", null, e.shixun_name), e.is_current_shixun && /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: PodModalmodules.tag }, "\u5F53\u524D\u5B9E\u8BAD")), /* @__PURE__ */ _react_17_0_2_react.createElement("span", { style: { color: "#53d1a3" } }, "\u8FD0\u884C\u4E2D\u7684\u73AF\u5883\uFF1A", e.pod_num, "\u4E2A"));
|
|
})))
|
|
);
|
|
};
|
|
/* harmony default export */ var components_PodModal = (PodModal);
|
|
|
|
;// CONCATENATED MODULE: ./src/styles/antd.theme.ts
|
|
const theme = {
|
|
token: {
|
|
colorPrimary: "#3061D0",
|
|
colorInfo: "#3061D0",
|
|
colorLink: "#3061D0",
|
|
borderRadius: 2,
|
|
fontSizeLG: 14
|
|
},
|
|
components: {
|
|
Radio: {
|
|
radioSize: 16,
|
|
dotSize: 6
|
|
},
|
|
Modal: {
|
|
titleFontSize: 16,
|
|
// titleLineHeight: 1,
|
|
titleColor: "#000"
|
|
}
|
|
}
|
|
};
|
|
/* harmony default export */ var antd_theme = (theme);
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_dayjs@1.11.10@dayjs/locale/zh-cn.js
|
|
var zh_cn = __webpack_require__(46789);
|
|
// EXTERNAL MODULE: ./node_modules/_@ant-design_cssinjs@1.17.5@@ant-design/cssinjs/es/index.js + 31 modules
|
|
var es = __webpack_require__(52042);
|
|
;// CONCATENATED MODULE: ./src/layouts/index.tsx
|
|
var layouts_defProp = Object.defineProperty;
|
|
var layouts_defProps = Object.defineProperties;
|
|
var layouts_getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
var layouts_getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
var layouts_hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var layouts_propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
var layouts_defNormalProp = (obj, key, value) => key in obj ? layouts_defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
var layouts_spreadValues = (a, b) => {
|
|
for (var prop in b || (b = {}))
|
|
if (layouts_hasOwnProp.call(b, prop))
|
|
layouts_defNormalProp(a, prop, b[prop]);
|
|
if (layouts_getOwnPropSymbols)
|
|
for (var prop of layouts_getOwnPropSymbols(b)) {
|
|
if (layouts_propIsEnum.call(b, prop))
|
|
layouts_defNormalProp(a, prop, b[prop]);
|
|
}
|
|
return a;
|
|
};
|
|
var layouts_spreadProps = (a, b) => layouts_defProps(a, layouts_getOwnPropDescs(b));
|
|
var __objRest = (source, exclude) => {
|
|
var target = {};
|
|
for (var prop in source)
|
|
if (layouts_hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
target[prop] = source[prop];
|
|
if (source != null && layouts_getOwnPropSymbols)
|
|
for (var prop of layouts_getOwnPropSymbols(source)) {
|
|
if (exclude.indexOf(prop) < 0 && layouts_propIsEnum.call(source, prop))
|
|
target[prop] = source[prop];
|
|
}
|
|
return target;
|
|
};
|
|
var layouts_async = (__this, __arguments, generator) => {
|
|
return new Promise((resolve, reject) => {
|
|
var fulfilled = (value) => {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var rejected = (value) => {
|
|
try {
|
|
step(generator.throw(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
};
|
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
});
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dayjs_min_default().locale("zh-cn");
|
|
const SimpleLayouts = (_a) => {
|
|
var _b = _a, { loading, globalSetting, user, dispatch } = _b, props = __objRest(_b, ["loading", "globalSetting", "user", "dispatch"]);
|
|
const location = (0,_umi_production_exports.useLocation)();
|
|
const payload = (0,Header/* getCourseParam */.g)();
|
|
const { globalLoading } = globalSetting;
|
|
const getData = () => layouts_async(void 0, null, function* () {
|
|
let res;
|
|
let game_id;
|
|
const path = location.pathname.split("/");
|
|
if (location == null ? void 0 : location.search) {
|
|
let subject_id, game_id2;
|
|
if (path.includes("paths")) {
|
|
subject_id = path[2];
|
|
} else if (path.includes("tasks")) {
|
|
game_id2 = path[2];
|
|
}
|
|
;
|
|
res = yield dispatch({
|
|
type: "user/getUserInfo",
|
|
payload: layouts_spreadProps(layouts_spreadValues(layouts_spreadValues({}, payload), (0,util/* getJsonFromUrl */.oP)()), {
|
|
subject_id,
|
|
game_id: game_id2,
|
|
websiteName: "educoder"
|
|
})
|
|
});
|
|
} else {
|
|
if (path.includes("tasks")) {
|
|
game_id = path[2];
|
|
}
|
|
;
|
|
res = yield dispatch({
|
|
type: "user/getUserInfo",
|
|
payload: layouts_spreadProps(layouts_spreadValues({}, payload), {
|
|
game_id
|
|
})
|
|
});
|
|
}
|
|
if ((res == null ? void 0 : res.username) && location.pathname === "/login") {
|
|
_umi_production_exports.history.push("/");
|
|
}
|
|
});
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
config_provider/* default */.ZP.config({
|
|
prefixCls: "ant",
|
|
iconPrefixCls: "anticon",
|
|
theme: layouts_spreadValues({}, antd_theme)
|
|
});
|
|
}, [globalSetting.theme]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
getData();
|
|
}, []);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
dispatch({
|
|
type: "globalSetting/query",
|
|
payload: {}
|
|
});
|
|
}, []);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
var _a2, _b2, _c, _d, _e;
|
|
if (location.pathname.indexOf("classrooms") > -1 && location.pathname.indexOf("detail") === -1) {
|
|
} else {
|
|
document.body.scrollIntoView();
|
|
}
|
|
if (location.pathname.indexOf("/classrooms/4RW9CYHY") > -1 && document.domain !== "localhost" && document.domain !== "kepukehuan.educoder.net") {
|
|
window.location.href = "https://kepukehuan.educoder.net/classrooms/4RW9CYHY/exercise";
|
|
return;
|
|
}
|
|
if (location.pathname.indexOf("/classrooms/qb4ft587") > -1 && document.domain !== "localhost" && document.domain !== "kepukehuan.educoder.net") {
|
|
window.location.href = "https://kepukehuan.educoder.net/classrooms/qb4ft587/exercise";
|
|
return;
|
|
}
|
|
if (location.pathname.indexOf("/classrooms/c5q9bsp2") > -1 && document.domain !== "localhost" && document.domain !== "kepukehuan.educoder.net") {
|
|
window.location.href = "https://kepukehuan.educoder.net/classrooms/c5q9bsp2/exercise";
|
|
return;
|
|
}
|
|
dispatch({ type: "globalSetting/setGlobalLoading", payload: { show: false, text: "" } });
|
|
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 (((_a2 = window.location.href) == null ? void 0 : _a2.includes("/problems")) && ((_b2 = window.location.href) == null ? void 0 : _b2.includes("/share"))) {
|
|
const ojId = (_e = (_d = (_c = window.location) == null ? void 0 : _c.pathname) == null ? void 0 : _d.split("/")) == null ? void 0 : _e[2];
|
|
const p = (0,fetch/* default */.ZP)(`/api/practices/${ojId}/start`, {
|
|
method: "get"
|
|
});
|
|
p.then((res) => {
|
|
if ((res == null ? void 0 : res.status) === 0) {
|
|
_umi_production_exports.history.replace(`/problems/${res == null ? void 0 : res.identifier}/oj/${ojId}`);
|
|
}
|
|
});
|
|
return;
|
|
}
|
|
if (location.pathname === "/admins" || location.pathname === "/sidekiq") {
|
|
const 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${location.pathname}`;
|
|
break;
|
|
default:
|
|
let str = document.domain.split(".");
|
|
str[0] = str[0] + "-data";
|
|
window.location.href = `https://${str.join(".")}${location.pathname}`;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
modal["default"].destroyAll();
|
|
if ((0,util/* isLocalApp */.WX)()) {
|
|
if ((0,util/* compareVersion */.yC)("2.0.0") > 0) {
|
|
modal["default"].info({
|
|
title: "\u5BA2\u6237\u7AEF\u7248\u672C\u8FC7\u4F4E",
|
|
centered: true,
|
|
content: /* @__PURE__ */ _react_17_0_2_react.createElement("div", null, /* @__PURE__ */ _react_17_0_2_react.createElement("span", { className: "c-red" }, "\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__ */ _react_17_0_2_react.createElement("span", { className: "c-red" }, "\u4E0B\u8F7D\u540E\u8BF7\u5148\u9000\u51FA\u5BA2\u6237\u7AEF\u518D\u5B89\u88C5")),
|
|
okText: "\u7ACB\u5373\u5347\u7EA7",
|
|
visible: true,
|
|
maskClosable: false,
|
|
onOk: () => {
|
|
(0,util/* downLoadFile */.FH)("Educoder.exe", "https://www-cdn.educoder.net/app/Educoder.exe");
|
|
return new Promise(() => {
|
|
});
|
|
}
|
|
});
|
|
}
|
|
;
|
|
}
|
|
}, [location.pathname]);
|
|
(0,_react_17_0_2_react.useEffect)(() => {
|
|
if (globalSetting.updateData.system_update) {
|
|
if (!localStorage.updateEndTime) {
|
|
if ((/* @__PURE__ */ new Date()).getTime() < new Date(globalSetting.updateData.end_time).getTime())
|
|
modal["default"].info({
|
|
title: globalSetting.updateData.subject,
|
|
content: globalSetting.updateData.system_score,
|
|
onOk: () => {
|
|
localStorage.updateEndTime = globalSetting.updateData.end_time;
|
|
}
|
|
});
|
|
}
|
|
} else {
|
|
localStorage.removeItem("updateEndTime");
|
|
}
|
|
}, [globalSetting.updateData.system_update]);
|
|
const toTrackEvent = () => {
|
|
var _a2, _b2, _c, _d, _e, _f, _g, _h;
|
|
const trackUserTime = localStorage.trackUserTime;
|
|
const trackUser = localStorage.trackUser;
|
|
if (trackUserTime && dayjs_min_default()(trackUserTime).isSame(dayjs_min_default()().startOf("day"), "d") && trackUser == ((_a2 = user.userInfo) == null ? void 0 : _a2.login)) {
|
|
} else {
|
|
localStorage.trackUserTime = /* @__PURE__ */ new Date();
|
|
localStorage.trackUser = (_b2 = user.userInfo) == null ? void 0 : _b2.login;
|
|
let text = "";
|
|
switch (user.userInfo.role) {
|
|
case 1:
|
|
text = "\u8D85\u7BA1";
|
|
break;
|
|
case 2:
|
|
text = "\u8FD0\u8425";
|
|
break;
|
|
case 5:
|
|
text = "\u8BA4\u8BC1\u6559\u5E08";
|
|
break;
|
|
case 12:
|
|
text = "\u672A\u8BA4\u8BC1\u6559\u5E08";
|
|
break;
|
|
case 15:
|
|
text = "\u5B66\u751F";
|
|
break;
|
|
}
|
|
if (((_c = user.userInfo) == null ? void 0 : _c.identity) !== "student" && ((_d = user.userInfo) == null ? void 0 : _d.identity) !== "teacher") {
|
|
text = "\u4E13\u4E1A\u4EBA\u58EB";
|
|
}
|
|
if ((_e = user.userInfo) == null ? void 0 : _e.user_school) {
|
|
(0,util/* trackEvent */.L9)(["\u5B66\u6821\u6D3B\u8DC3\u7528\u6237", (_f = user.userInfo) == null ? void 0 : _f.user_school]);
|
|
(0,util/* trackEvent */.L9)(["\u7528\u6237\u8BBF\u95EE\u660E\u7EC6", (_g = user.userInfo) == null ? void 0 : _g.login, (_h = user.userInfo) == null ? void 0 : _h.user_school]);
|
|
}
|
|
(0,util/* trackEvent */.L9)(["\u5E73\u53F0PC\u7AEF", "\u603B\u6D3B\u8DC3\u7528\u6237\u6570"]);
|
|
(0,util/* trackEvent */.L9)(["\u5E73\u53F0PC\u7AEF", text]);
|
|
}
|
|
};
|
|
return /* @__PURE__ */ _react_17_0_2_react.createElement(es.StyleProvider, { transformers: [es.legacyLogicalPropertiesTransformer], hashPriority: "high" }, /* @__PURE__ */ _react_17_0_2_react.createElement(
|
|
config_provider/* default */.ZP,
|
|
{
|
|
locale: zh_CN/* default */.Z,
|
|
autoInsertSpaceInButton: false,
|
|
componentSize: "middle",
|
|
theme: antd_theme
|
|
},
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(PopLogin, null),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(User_BindAccountPanel, null),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(components_PodModal, null),
|
|
/* @__PURE__ */ _react_17_0_2_react.createElement(spin/* default */.Z, { size: "middle", spinning: globalLoading.show, tip: globalLoading.text, className: "ant-spin-nested-loading-black" }, /* @__PURE__ */ _react_17_0_2_react.createElement(_umi_production_exports.Outlet, null))
|
|
));
|
|
};
|
|
/* harmony default export */ var layouts = ((0,_umi_production_exports.connect)(({ loading, globalSetting, user }) => ({
|
|
loading,
|
|
globalSetting,
|
|
user
|
|
}))(SimpleLayouts));
|
|
|
|
|
|
/***/ })
|
|
|
|
}]); |