|
|
"use strict";
|
|
|
(self["webpackChunk"] = self["webpackChunk"] || []).push([[64520],{
|
|
|
|
|
|
/***/ 69546:
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./src/pages/Account/Secure/index.tsx + 1 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 */ Account_Secure; }
|
|
|
});
|
|
|
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectDestructuringEmpty.js
|
|
|
var objectDestructuringEmpty = __webpack_require__(70236);
|
|
|
var objectDestructuringEmpty_default = /*#__PURE__*/__webpack_require__.n(objectDestructuringEmpty);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/regeneratorRuntime.js
|
|
|
var regeneratorRuntime = __webpack_require__(7557);
|
|
|
var regeneratorRuntime_default = /*#__PURE__*/__webpack_require__.n(regeneratorRuntime);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/asyncToGenerator.js
|
|
|
var asyncToGenerator = __webpack_require__(41498);
|
|
|
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/slicedToArray.js
|
|
|
var slicedToArray = __webpack_require__(79800);
|
|
|
var slicedToArray_default = /*#__PURE__*/__webpack_require__.n(slicedToArray);
|
|
|
// EXTERNAL MODULE: ./node_modules/_@babel_runtime@7.23.6@@babel/runtime/helpers/objectWithoutProperties.js
|
|
|
var objectWithoutProperties = __webpack_require__(39647);
|
|
|
var objectWithoutProperties_default = /*#__PURE__*/__webpack_require__.n(objectWithoutProperties);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/index.js
|
|
|
var _react_17_0_2_react = __webpack_require__(59301);
|
|
|
// EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules
|
|
|
var _umi_production_exports = __webpack_require__(58011);
|
|
|
// 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__(62680);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/button/index.js
|
|
|
var es_button = __webpack_require__(3113);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/tooltip/index.js + 3 modules
|
|
|
var tooltip = __webpack_require__(6848);
|
|
|
// EXTERNAL MODULE: ./node_modules/_antd@5.9.0@antd/es/modal/index.js + 16 modules
|
|
|
var modal = __webpack_require__(43418);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Account/Secure/index.less?modules
|
|
|
// extracted by mini-css-extract-plugin
|
|
|
/* harmony default export */ var Securemodules = ({"wrap":"wrap___vEhcs","content":"content___ebZIP","hint":"hint___b1gVO","titleWrap":"titleWrap___iGFyX","title":"title___O7ajd","formWrap":"formWrap___hsI9d","row":"row___xYJES","rowBorder":"rowBorder___YP4Tf","name":"name___kvtHq","status":"status___Z3SQA","description":"description___iGcNP","active":"active___DoK2i","color999":"color999___MWFZD","colorCDCDCD":"colorCDCDCD___miC4g","colorRed":"colorRed___YHbHP","submitButton":"submitButton___iLv6C","buttonWrap":"buttonWrap___gaJuB"});
|
|
|
// EXTERNAL MODULE: ./src/utils/hooks/useInterval.tsx
|
|
|
var useInterval = __webpack_require__(87472);
|
|
|
// EXTERNAL MODULE: ./src/utils/util.tsx
|
|
|
var util = __webpack_require__(73400);
|
|
|
// EXTERNAL MODULE: ./src/utils/fetch.ts
|
|
|
var fetch = __webpack_require__(56648);
|
|
|
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
|
|
|
var jsx_runtime = __webpack_require__(37712);
|
|
|
;// CONCATENATED MODULE: ./src/pages/Account/Secure/index.tsx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _excluded = ["user", "account", "globalSetting", "loading", "dispatch"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var ActiveType = /*#__PURE__*/function (ActiveType) {
|
|
|
ActiveType[ActiveType["Phone"] = 1] = "Phone";
|
|
|
ActiveType[ActiveType["Email"] = 2] = "Email";
|
|
|
ActiveType[ActiveType["Password"] = 3] = "Password";
|
|
|
return ActiveType;
|
|
|
}(ActiveType || {});
|
|
|
var phoneReg = /^1\d{10}$/;
|
|
|
var emailReg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
|
|
|
var Secure_password = /^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{8,16}$/;
|
|
|
var inputNewPassword = function inputNewPassword(rule, value, callback) {
|
|
|
if (!value) {
|
|
|
callback("请输入8-16位字符的新密码,区分大小写!");
|
|
|
} else if (value.indexOf(" ") > -1) {
|
|
|
callback('请输入8-16位密码,区分大小写、不能使用空格');
|
|
|
} else if (value.length < 8 || value.length > 16) {
|
|
|
callback("请输入8-16位字符的新密码,区分大小写!");
|
|
|
} else if (!Secure_password.test(value)) {
|
|
|
callback("请输入8~16位字符,字母、数字和特殊符号至少包含2种");
|
|
|
} else {
|
|
|
callback();
|
|
|
}
|
|
|
};
|
|
|
var DataType = /*#__PURE__*/function (DataType) {
|
|
|
DataType["Wechat"] = "wechat";
|
|
|
DataType["QQ"] = "qq";
|
|
|
return DataType;
|
|
|
}(DataType || {});
|
|
|
var Secure = function Secure(_ref) {
|
|
|
var _account$basicInfo4, _account$basicInfo5, _account$basicInfo6, _account$basicInfo7, _account$basicInfo9, _account$basicInfo10, _account$basicInfo11, _globalSetting$settin, _account$basicInfo12, _account$basicInfo13, _globalSetting$settin2, _account$basicInfo14, _account$basicInfo15, _account$basicInfo16, _globalSetting$settin3, _account$basicInfo17, _account$basicInfo18;
|
|
|
var user = _ref.user,
|
|
|
account = _ref.account,
|
|
|
globalSetting = _ref.globalSetting,
|
|
|
loading = _ref.loading,
|
|
|
dispatch = _ref.dispatch,
|
|
|
props = objectWithoutProperties_default()(_ref, _excluded);
|
|
|
var _Form$useForm = es_form/* default */.Z.useForm(),
|
|
|
_Form$useForm2 = slicedToArray_default()(_Form$useForm, 1),
|
|
|
form = _Form$useForm2[0];
|
|
|
var _useState = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
|
active = _useState2[0],
|
|
|
setActive = _useState2[1];
|
|
|
var _useState3 = (0,_react_17_0_2_react.useState)(60),
|
|
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
|
countdown = _useState4[0],
|
|
|
setCountdown = _useState4[1];
|
|
|
var _useState5 = (0,_react_17_0_2_react.useState)(),
|
|
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
|
countdownFlag = _useState6[0],
|
|
|
setCountdownFlag = _useState6[1];
|
|
|
var intervalId = (0,_react_17_0_2_react.useRef)();
|
|
|
var _useState7 = (0,_react_17_0_2_react.useState)({}),
|
|
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
|
wechatData = _useState8[0],
|
|
|
setWechatData = _useState8[1];
|
|
|
var _useState9 = (0,_react_17_0_2_react.useState)({}),
|
|
|
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
|
qqData = _useState10[0],
|
|
|
setqqData = _useState10[1];
|
|
|
var _useState11 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState12 = slicedToArray_default()(_useState11, 2),
|
|
|
isShowModal = _useState12[0],
|
|
|
setIsShowModal = _useState12[1];
|
|
|
var _useState13 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState14 = slicedToArray_default()(_useState13, 2),
|
|
|
isShowPhone = _useState14[0],
|
|
|
setIsShowPhone = _useState14[1];
|
|
|
var _useState15 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState16 = slicedToArray_default()(_useState15, 2),
|
|
|
isShowPoint = _useState16[0],
|
|
|
setIsShowPoint = _useState16[1];
|
|
|
var _useState17 = (0,_react_17_0_2_react.useState)(false),
|
|
|
_useState18 = slicedToArray_default()(_useState17, 2),
|
|
|
isShowUntie = _useState18[0],
|
|
|
setIsShowUntie = _useState18[1];
|
|
|
var _useState19 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState20 = slicedToArray_default()(_useState19, 2),
|
|
|
PhoneValue = _useState20[0],
|
|
|
setPhoneValue = _useState20[1];
|
|
|
var _useState21 = (0,_react_17_0_2_react.useState)(''),
|
|
|
_useState22 = slicedToArray_default()(_useState21, 2),
|
|
|
UntieValue = _useState22[0],
|
|
|
setUntieValue = _useState22[1];
|
|
|
var location = (0,_umi_production_exports.useLocation)();
|
|
|
var _useSearchParams = (0,_umi_production_exports.useSearchParams)(),
|
|
|
_useSearchParams2 = slicedToArray_default()(_useSearchParams, 1),
|
|
|
searchParams = _useSearchParams2[0];
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
var _account$basicInfo, _account$basicInfo2;
|
|
|
var wechat = ((_account$basicInfo = account.basicInfo) === null || _account$basicInfo === void 0 ? void 0 : _account$basicInfo.open_users.find(function (item) {
|
|
|
return item.en_type === DataType.Wechat;
|
|
|
})) || {};
|
|
|
setWechatData(wechat);
|
|
|
var qq = ((_account$basicInfo2 = account.basicInfo) === null || _account$basicInfo2 === void 0 ? void 0 : _account$basicInfo2.open_users.find(function (item) {
|
|
|
return item.en_type === DataType.QQ;
|
|
|
})) || {};
|
|
|
setqqData(qq);
|
|
|
}, [account.basicInfo]);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
return function () {
|
|
|
intervalId.current && clearInterval(intervalId.current);
|
|
|
};
|
|
|
}, []);
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
setActive(parseInt(searchParams.get("active")));
|
|
|
}, [location]);
|
|
|
(0,useInterval/* useInterval */.Y)(function () {
|
|
|
if (!countdownFlag) {
|
|
|
return;
|
|
|
} else {
|
|
|
setCountdown(60);
|
|
|
}
|
|
|
if (countdown > 0) {
|
|
|
setCountdown(countdown - 1);
|
|
|
} else {
|
|
|
setCountdown(60);
|
|
|
setCountdownFlag(false);
|
|
|
intervalId.current && clearInterval(intervalId.current);
|
|
|
}
|
|
|
}, 1000);
|
|
|
var handleGetCode = /*#__PURE__*/function () {
|
|
|
var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(isPhone) {
|
|
|
var login, type, _user$userInfo, data, smscode, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee$(_context) {
|
|
|
while (1) switch (_context.prev = _context.next) {
|
|
|
case 0:
|
|
|
if (!isPhone) {
|
|
|
_context.next = 16;
|
|
|
break;
|
|
|
}
|
|
|
type = 3;
|
|
|
login = form.getFieldValue('phone');
|
|
|
if (phoneReg.test(login)) {
|
|
|
_context.next = 6;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('请先输入正确的手机号码');
|
|
|
return _context.abrupt("return");
|
|
|
case 6:
|
|
|
_context.next = 8;
|
|
|
return (0,fetch/* default */.ZP)("/api/users/accounts/".concat((_user$userInfo = user.userInfo) === null || _user$userInfo === void 0 ? void 0 : _user$userInfo.login, "/valid_phone.json"), {
|
|
|
method: 'get',
|
|
|
params: {
|
|
|
phone: login
|
|
|
}
|
|
|
});
|
|
|
case 8:
|
|
|
data = _context.sent;
|
|
|
if (!((data === null || data === void 0 ? void 0 : data.status) === -1)) {
|
|
|
_context.next = 11;
|
|
|
break;
|
|
|
}
|
|
|
return _context.abrupt("return");
|
|
|
case 11:
|
|
|
if (!(data !== null && data !== void 0 && data.is_exists)) {
|
|
|
_context.next = 14;
|
|
|
break;
|
|
|
}
|
|
|
setIsShowPoint(true);
|
|
|
return _context.abrupt("return");
|
|
|
case 14:
|
|
|
_context.next = 21;
|
|
|
break;
|
|
|
case 16:
|
|
|
type = 4;
|
|
|
login = form.getFieldValue('email');
|
|
|
if (emailReg.test(login)) {
|
|
|
_context.next = 21;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('请先输入正确的邮箱地址');
|
|
|
return _context.abrupt("return");
|
|
|
case 21:
|
|
|
smscode = (0,util/* setmiyah */.M)(login);
|
|
|
_context.next = 24;
|
|
|
return dispatch({
|
|
|
type: 'account/getCode',
|
|
|
payload: {
|
|
|
login: login,
|
|
|
type: type,
|
|
|
smscode: smscode
|
|
|
}
|
|
|
});
|
|
|
case 24:
|
|
|
res = _context.sent;
|
|
|
if (res.status === 1) {
|
|
|
message/* default */.ZP.info('验证码已发送,请注意查收');
|
|
|
setCountdownFlag(true);
|
|
|
}
|
|
|
case 26:
|
|
|
case "end":
|
|
|
return _context.stop();
|
|
|
}
|
|
|
}, _callee);
|
|
|
}));
|
|
|
return function handleGetCode(_x) {
|
|
|
return _ref2.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handlePhoneFinish = /*#__PURE__*/function () {
|
|
|
var _ref3 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee2(values) {
|
|
|
var _ref4, phone, code, _ref5, login, res, _user$userInfo2;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee2$(_context2) {
|
|
|
while (1) switch (_context2.prev = _context2.next) {
|
|
|
case 0:
|
|
|
_ref4 = values || {}, phone = _ref4.phone, code = _ref4.phoneValidateCode;
|
|
|
_ref5 = user.userInfo || {}, login = _ref5.login;
|
|
|
if (phoneReg.test(phone)) {
|
|
|
_context2.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info("请输入有效的11位手机号码");
|
|
|
return _context2.abrupt("return");
|
|
|
case 5:
|
|
|
_context2.next = 7;
|
|
|
return dispatch({
|
|
|
type: 'account/bindPhone',
|
|
|
payload: {
|
|
|
login: login,
|
|
|
phone: phone,
|
|
|
code: code
|
|
|
}
|
|
|
});
|
|
|
case 7:
|
|
|
res = _context2.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
message/* default */.ZP.info("手机号码绑定成功!");
|
|
|
setActive(null);
|
|
|
setCountdownFlag(false);
|
|
|
dispatch({
|
|
|
type: 'account/getBasicInfo',
|
|
|
payload: {
|
|
|
login: (_user$userInfo2 = user.userInfo) === null || _user$userInfo2 === void 0 ? void 0 : _user$userInfo2.login
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 9:
|
|
|
case "end":
|
|
|
return _context2.stop();
|
|
|
}
|
|
|
}, _callee2);
|
|
|
}));
|
|
|
return function handlePhoneFinish(_x2) {
|
|
|
return _ref3.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleEmailFinish = /*#__PURE__*/function () {
|
|
|
var _ref6 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee3(values) {
|
|
|
var _ref7, email, code, _ref8, login, res, _user$userInfo3;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee3$(_context3) {
|
|
|
while (1) switch (_context3.prev = _context3.next) {
|
|
|
case 0:
|
|
|
_ref7 = values || {}, email = _ref7.email, code = _ref7.emailValidateCode;
|
|
|
_ref8 = user.userInfo || {}, login = _ref8.login;
|
|
|
if (emailReg.test(email)) {
|
|
|
_context3.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info("请输入正确的邮箱地址");
|
|
|
return _context3.abrupt("return");
|
|
|
case 5:
|
|
|
_context3.next = 7;
|
|
|
return dispatch({
|
|
|
type: 'account/bindEmail',
|
|
|
payload: {
|
|
|
login: login,
|
|
|
email: email,
|
|
|
code: code
|
|
|
}
|
|
|
});
|
|
|
case 7:
|
|
|
res = _context3.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
message/* default */.ZP.info("邮箱地址绑定成功!");
|
|
|
setActive(null);
|
|
|
setCountdownFlag(false);
|
|
|
dispatch({
|
|
|
type: 'account/getBasicInfo',
|
|
|
payload: {
|
|
|
login: (_user$userInfo3 = user.userInfo) === null || _user$userInfo3 === void 0 ? void 0 : _user$userInfo3.login
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 9:
|
|
|
case "end":
|
|
|
return _context3.stop();
|
|
|
}
|
|
|
}, _callee3);
|
|
|
}));
|
|
|
return function handleEmailFinish(_x3) {
|
|
|
return _ref6.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handlePasswordFinish = /*#__PURE__*/function () {
|
|
|
var _ref9 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee4(values) {
|
|
|
var _account$basicInfo3;
|
|
|
var _ref10, oldPassword, newPassword, againPassword, _ref11, login, res, _user$userInfo4;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee4$(_context4) {
|
|
|
while (1) switch (_context4.prev = _context4.next) {
|
|
|
case 0:
|
|
|
_ref10 = values || {}, oldPassword = _ref10.oldPassword, newPassword = _ref10.newPassword, againPassword = _ref10.againPassword;
|
|
|
_ref11 = user.userInfo || {}, login = _ref11.login;
|
|
|
if (!((_account$basicInfo3 = account.basicInfo) !== null && _account$basicInfo3 !== void 0 && _account$basicInfo3.has_password && oldPassword === newPassword)) {
|
|
|
_context4.next = 5;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info("新密码不能与旧密码相同!");
|
|
|
return _context4.abrupt("return");
|
|
|
case 5:
|
|
|
if (!(newPassword !== againPassword)) {
|
|
|
_context4.next = 8;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info("两次输入的新密码必须一致!");
|
|
|
return _context4.abrupt("return");
|
|
|
case 8:
|
|
|
_context4.next = 10;
|
|
|
return dispatch({
|
|
|
type: 'account/updatePassword',
|
|
|
payload: {
|
|
|
login: login,
|
|
|
old_password: oldPassword,
|
|
|
password: newPassword
|
|
|
}
|
|
|
});
|
|
|
case 10:
|
|
|
res = _context4.sent;
|
|
|
if ((res === null || res === void 0 ? void 0 : res.status) === 0) {
|
|
|
message/* default */.ZP.info('密码更新成功!');
|
|
|
setActive(null);
|
|
|
dispatch({
|
|
|
type: 'account/getBasicInfo',
|
|
|
payload: {
|
|
|
login: (_user$userInfo4 = user.userInfo) === null || _user$userInfo4 === void 0 ? void 0 : _user$userInfo4.login
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 12:
|
|
|
case "end":
|
|
|
return _context4.stop();
|
|
|
}
|
|
|
}, _callee4);
|
|
|
}));
|
|
|
return function handlePasswordFinish(_x4) {
|
|
|
return _ref9.apply(this, arguments);
|
|
|
};
|
|
|
}();
|
|
|
var handleFinish = function handleFinish(values) {
|
|
|
objectDestructuringEmpty_default()(values || {});
|
|
|
console.log("handleFinish values: ", values);
|
|
|
if (active === ActiveType.Phone) {
|
|
|
handlePhoneFinish(values);
|
|
|
}
|
|
|
if (active === ActiveType.Email) {
|
|
|
handleEmailFinish(values);
|
|
|
}
|
|
|
if (active === ActiveType.Password) {
|
|
|
handlePasswordFinish(values);
|
|
|
}
|
|
|
};
|
|
|
(0,_react_17_0_2_react.useEffect)(function () {
|
|
|
if (!active) {
|
|
|
form.setFieldsValue({
|
|
|
phone: '',
|
|
|
phoneValidateCode: '',
|
|
|
email: '',
|
|
|
emailValidateCode: '',
|
|
|
oldPassword: '',
|
|
|
newPassword: '',
|
|
|
againPassword: ''
|
|
|
});
|
|
|
}
|
|
|
}, [active]);
|
|
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)("section", {
|
|
|
className: Securemodules.wrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Securemodules.content,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(Securemodules.titleWrap, " mt10"),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: Securemodules.title,
|
|
|
children: "\u5B89\u5168\u8BBE\u7F6E"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z, {
|
|
|
form: form,
|
|
|
className: Securemodules.formWrap,
|
|
|
labelCol: {
|
|
|
span: 6
|
|
|
},
|
|
|
wrapperCol: {
|
|
|
span: 10
|
|
|
},
|
|
|
onFinish: handleFinish,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(Securemodules.row, " ").concat(active === ActiveType.Phone ? '' : Securemodules.rowBorder),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Securemodules.name, " ").concat(Securemodules.color999),
|
|
|
children: "\u624B\u673A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(Securemodules.description, " ").concat(Securemodules.colorCDCDCD),
|
|
|
children: [(_account$basicInfo4 = account.basicInfo) !== null && _account$basicInfo4 !== void 0 && _account$basicInfo4.phone ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Securemodules.status, " mr20"),
|
|
|
children: (_account$basicInfo5 = account.basicInfo) === null || _account$basicInfo5 === void 0 ? void 0 : _account$basicInfo5.phone
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Securemodules.status, " ").concat(Securemodules.colorRed, " mr20"),
|
|
|
children: "\u672A\u7ED1\u5B9A"
|
|
|
}), (_account$basicInfo6 = account.basicInfo) !== null && _account$basicInfo6 !== void 0 && _account$basicInfo6.phone ? '仅自己可见,可用手机号码登录EduCoder' : '绑定手机号码,将获得500金币的奖励哟~,手机号码仅自己可见~']
|
|
|
}), ((_account$basicInfo7 = account.basicInfo) === null || _account$basicInfo7 === void 0 ? void 0 : _account$basicInfo7.phone) && active !== ActiveType.Phone && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Securemodules.active,
|
|
|
style: {
|
|
|
marginRight: '30px',
|
|
|
cursor: 'pointer'
|
|
|
},
|
|
|
onClick: function onClick() {
|
|
|
var _account$basicInfo8;
|
|
|
// console.log(wechatData?.id,qqData?.id,account.basicInfo?.mail);
|
|
|
|
|
|
//判断是不是只绑定了手机号
|
|
|
if (!(wechatData !== null && wechatData !== void 0 && wechatData.id) && !(qqData !== null && qqData !== void 0 && qqData.id) && !((_account$basicInfo8 = account.basicInfo) !== null && _account$basicInfo8 !== void 0 && _account$basicInfo8.mail)) {
|
|
|
// console.log('------','啥也没绑定');
|
|
|
setIsShowModal(true);
|
|
|
} else {
|
|
|
setIsShowPhone(true);
|
|
|
}
|
|
|
},
|
|
|
children: '解绑手机号'
|
|
|
}), active !== ActiveType.Phone && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Securemodules.active,
|
|
|
onClick: function onClick() {
|
|
|
return setActive(ActiveType.Phone);
|
|
|
},
|
|
|
children: (_account$basicInfo9 = account.basicInfo) !== null && _account$basicInfo9 !== void 0 && _account$basicInfo9.phone ? '更换' : '立即绑定'
|
|
|
})]
|
|
|
}), active === ActiveType.Phone && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u4F60\u7684\u624B\u673A\u53F7",
|
|
|
name: "phone",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: "\u8BF7\u8F93\u5165\u8981".concat((_account$basicInfo10 = account.basicInfo) !== null && _account$basicInfo10 !== void 0 && _account$basicInfo10.phone ? '更换' : '绑定', "\u7684\u624B\u673A\u53F7\u7801")
|
|
|
}, {
|
|
|
validator: function validator(rule, value, callback) {
|
|
|
if (phoneReg.test(value)) {
|
|
|
callback();
|
|
|
}
|
|
|
callback('请输入有效的11位手机号码');
|
|
|
}
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u8981".concat((_account$basicInfo11 = account.basicInfo) !== null && _account$basicInfo11 !== void 0 && _account$basicInfo11.phone ? '更换' : '绑定', "\u7684\u624B\u673A\u53F7\u7801")
|
|
|
})
|
|
|
}), !(globalSetting !== null && globalSetting !== void 0 && (_globalSetting$settin = globalSetting.setting) !== null && _globalSetting$settin !== void 0 && _globalSetting$settin.is_local) && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, {
|
|
|
label: "\u624B\u673A\u9A8C\u8BC1\u7801",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "phoneValidateCode",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入手机获取的验证码'
|
|
|
}],
|
|
|
noStyle: true,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u624B\u673A\u83B7\u53D6\u7684\u9A8C\u8BC1\u7801"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
className: "ml5",
|
|
|
disabled: countdownFlag,
|
|
|
onClick: function onClick() {
|
|
|
return handleGetCode(true);
|
|
|
},
|
|
|
children: countdownFlag ? "\u91CD\u65B0\u53D1\u9001".concat(countdown, "s") : '获取验证码'
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
noStyle: true,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Securemodules.buttonWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: "".concat(Securemodules.submitButton),
|
|
|
size: 'middle',
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
children: "\u786E\u5B9A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: Securemodules.submitButton,
|
|
|
size: 'middle',
|
|
|
onClick: function onClick() {
|
|
|
return setActive(null);
|
|
|
},
|
|
|
children: "\u53D6\u6D88"
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(Securemodules.row, " ").concat(active === ActiveType.Email ? '' : Securemodules.rowBorder),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Securemodules.name, " ").concat(Securemodules.color999),
|
|
|
children: "\u90AE\u7BB1"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(Securemodules.description, " ").concat(Securemodules.colorCDCDCD),
|
|
|
children: [(_account$basicInfo12 = account.basicInfo) !== null && _account$basicInfo12 !== void 0 && _account$basicInfo12.mail ? /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Securemodules.status, " mr20"),
|
|
|
children: (_account$basicInfo13 = account.basicInfo) === null || _account$basicInfo13 === void 0 ? void 0 : _account$basicInfo13.mail
|
|
|
}) : /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Securemodules.status, " ").concat(Securemodules.colorRed, " mr20"),
|
|
|
children: "\u672A\u7ED1\u5B9A"
|
|
|
}), "\u90AE\u7BB1\u8D26\u53F7\u4EC5\u81EA\u5DF1\u53EF\u89C1\uFF0C\u53EF\u7528\u4E8E\u90AE\u7BB1\u8D26\u53F7\u767B\u5F55", !(globalSetting !== null && globalSetting !== void 0 && (_globalSetting$settin2 = globalSetting.setting) !== null && _globalSetting$settin2 !== void 0 && _globalSetting$settin2.is_local) && 'EduCoder']
|
|
|
}), active !== ActiveType.Email && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Securemodules.active,
|
|
|
onClick: function onClick() {
|
|
|
return setActive(ActiveType.Email);
|
|
|
},
|
|
|
children: (_account$basicInfo14 = account.basicInfo) !== null && _account$basicInfo14 !== void 0 && _account$basicInfo14.mail ? '更换' : '立即绑定'
|
|
|
})]
|
|
|
}), active === ActiveType.Email && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u90AE\u7BB1\u5730\u5740",
|
|
|
name: "email",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: (_account$basicInfo15 = account.basicInfo) !== null && _account$basicInfo15 !== void 0 && _account$basicInfo15.mail ? '请输入要更换的新邮箱地址' : '请输入邮箱地址'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: (_account$basicInfo16 = account.basicInfo) !== null && _account$basicInfo16 !== void 0 && _account$basicInfo16.mail ? '请输入要更换的新邮箱地址' : '请输入邮箱地址'
|
|
|
})
|
|
|
}), !(globalSetting !== null && globalSetting !== void 0 && (_globalSetting$settin3 = globalSetting.setting) !== null && _globalSetting$settin3 !== void 0 && _globalSetting$settin3.is_local) && /*#__PURE__*/(0,jsx_runtime.jsxs)(es_form/* default */.Z.Item, {
|
|
|
label: "\u90AE\u7BB1\u9A8C\u8BC1\u7801",
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
name: "emailValidateCode",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请输入邮箱收到的验证码'
|
|
|
}],
|
|
|
noStyle: true,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
placeholder: "\u8BF7\u8F93\u5165\u90AE\u7BB1\u6536\u5230\u7684\u9A8C\u8BC1\u7801"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
className: "ml5",
|
|
|
disabled: countdownFlag,
|
|
|
onClick: function onClick() {
|
|
|
return handleGetCode(false);
|
|
|
},
|
|
|
children: countdownFlag ? "\u91CD\u65B0\u53D1\u9001".concat(countdown, "s") : '获取验证码'
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
noStyle: true,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Securemodules.buttonWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: "".concat(Securemodules.submitButton),
|
|
|
size: 'middle',
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
children: "\u786E\u5B9A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: Securemodules.submitButton,
|
|
|
size: 'middle',
|
|
|
onClick: function onClick() {
|
|
|
return setActive(null);
|
|
|
},
|
|
|
children: "\u53D6\u6D88"
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Securemodules.row,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Securemodules.name, " ").concat(Securemodules.color999),
|
|
|
children: "\u5BC6\u7801"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: "".concat(Securemodules.description, " ").concat(Securemodules.colorCDCDCD),
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: "".concat(Securemodules.status, " mr20"),
|
|
|
children: "**********"
|
|
|
}), "\u7528\u4E8E\u4FDD\u62A4\u8D26\u6237\u4FE1\u606F\u548C\u767B\u5F55\u5B89\u5168"]
|
|
|
}), active !== ActiveType.Password && /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
className: Securemodules.active,
|
|
|
onClick: function onClick() {
|
|
|
return setActive(ActiveType.Password);
|
|
|
},
|
|
|
children: "\u4FEE\u6539"
|
|
|
})]
|
|
|
}), active === ActiveType.Password && /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
|
children: [((_account$basicInfo17 = account.basicInfo) === null || _account$basicInfo17 === void 0 ? void 0 : _account$basicInfo17.has_password) && /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u65E7\u5BC6\u7801",
|
|
|
name: "oldPassword",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请设置8~16位密码,区分大小写'
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
type: "password",
|
|
|
placeholder: "\u8BF7\u8BBE\u7F6E8\uFF5E16\u4F4D\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u957F\u5EA6\u4E3A8-16\u4F4D\u5B57\u7B26"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u5B57\u6BCD/\u6570\u5B57\u4EE5\u53CA\u6807\u70B9\u7B26\u53F7\u81F3\u5C11\u5305\u542B2\u79CD"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u4E0D\u5141\u8BB8\u6709\u7A7A\u683C\u3001\u4E2D\u6587"
|
|
|
})]
|
|
|
}),
|
|
|
placement: "top",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u65B0\u5BC6\u7801",
|
|
|
name: "newPassword",
|
|
|
rules: [{}, {
|
|
|
validator: inputNewPassword
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
type: "password",
|
|
|
placeholder: "\u8BF7\u8F93\u51658\uFF5E16\u4F4D\u7684\u65B0\u5BC6\u7801\uFF0C\u533A\u5206\u5927\u5C0F\u5199"
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(tooltip/* default */.Z, {
|
|
|
title: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u957F\u5EA6\u4E3A8-16\u4F4D\u5B57\u7B26"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u5B57\u6BCD/\u6570\u5B57\u4EE5\u53CA\u6807\u70B9\u7B26\u53F7\u81F3\u5C11\u5305\u542B2\u79CD"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u4E0D\u5141\u8BB8\u6709\u7A7A\u683C\u3001\u4E2D\u6587"
|
|
|
})]
|
|
|
}),
|
|
|
placement: "top",
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
label: "\u518D\u6B21\u8F93\u5165",
|
|
|
name: "againPassword",
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
message: '请再次输入新密码'
|
|
|
}, {
|
|
|
validator: function validator(rule, value, callback) {
|
|
|
if (value != form.getFieldsValue().newPassword) {
|
|
|
callback("两次输入的新密码必须一致!");
|
|
|
} else {
|
|
|
callback();
|
|
|
}
|
|
|
}
|
|
|
}],
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
type: "password",
|
|
|
placeholder: "\u8BF7\u518D\u6B21\u8F93\u5165\u65B0\u5BC6\u7801"
|
|
|
})
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_form/* default */.Z.Item, {
|
|
|
noStyle: true,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
className: Securemodules.buttonWrap,
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: "".concat(Securemodules.submitButton),
|
|
|
size: 'middle',
|
|
|
type: "primary",
|
|
|
htmlType: "submit",
|
|
|
children: "\u786E\u5B9A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
className: Securemodules.submitButton,
|
|
|
size: 'middle',
|
|
|
onClick: function onClick() {
|
|
|
return setActive(null);
|
|
|
},
|
|
|
children: "\u53D6\u6D88"
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
className: "".concat(Securemodules.hint, " font14"),
|
|
|
children: "* \u6211\u4EEC\u786E\u4FDD\u4F60\u6240\u63D0\u4F9B\u7684\u4FE1\u606F\u5747\u5904\u4E8E\u4E25\u683C\u4FDD\u5BC6\u72B6\u6001\uFF0C\u4E0D\u4F1A\u6CC4\u9732"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
title: "\u63D0\u793A",
|
|
|
open: isShowModal,
|
|
|
onCancel: function onCancel() {
|
|
|
setIsShowModal(false);
|
|
|
},
|
|
|
footer: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
style: {
|
|
|
textAlign: 'end'
|
|
|
},
|
|
|
type: "primary",
|
|
|
onClick: function onClick() {
|
|
|
return setIsShowModal(false);
|
|
|
},
|
|
|
children: "\u786E \u5B9A"
|
|
|
})
|
|
|
}),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
padding: '7px 24px'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u60A8\u76EE\u524D\u53EA\u6709\u624B\u673A\u53F7\u767B\u5F55\u4E00\u79CD\u65B9\u5F0F\uFF0C\u89E3\u7ED1\u540E\u5C06\u65E0\u6CD5\u6B63\u5E38\u4F7F\u7528\u5E73\u53F0\uFF0C\u9700\u8981\u60A8\u5148\u7ED1\u5B9A\u4EE5\u4E0B\u7684\u4EFB\u610F\u4E00\u79CD\u767B\u5F55\u65B9\u5F0F\uFF0C\u518D\u8FDB\u884C\u89E3\u7ED1\u3002"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
style: {
|
|
|
marginTop: '1em',
|
|
|
display: 'flex'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
flex: '1'
|
|
|
},
|
|
|
children: "1\u3001\u7ED1\u5B9A\u90AE\u7BB1 "
|
|
|
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
ghost: true,
|
|
|
onClick: function onClick() {
|
|
|
return setIsShowModal(false);
|
|
|
},
|
|
|
style: {
|
|
|
borderRadius: '12px',
|
|
|
height: '26px',
|
|
|
width: '93px',
|
|
|
cursor: 'pointer'
|
|
|
},
|
|
|
children: "\u524D\u5F80\u7ED1\u5B9A"
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
style: {
|
|
|
marginTop: '1em',
|
|
|
display: 'flex'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
flex: '1'
|
|
|
},
|
|
|
children: "2\u3001\u7ED1\u5B9A\u5FAE\u4FE1 "
|
|
|
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
ghost: true,
|
|
|
style: {
|
|
|
borderRadius: '12px',
|
|
|
height: '26px',
|
|
|
width: '93px'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
to: "/account/binding",
|
|
|
children: "\u524D\u5F80\u7ED1\u5B9A"
|
|
|
})
|
|
|
})]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
style: {
|
|
|
marginTop: '1em',
|
|
|
display: 'flex'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
flex: '1'
|
|
|
},
|
|
|
children: "3\u3001\u7ED1\u5B9AQQ "
|
|
|
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
type: "primary",
|
|
|
ghost: true,
|
|
|
style: {
|
|
|
borderRadius: '12px',
|
|
|
height: '26px',
|
|
|
width: '93px'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)(_umi_production_exports.Link, {
|
|
|
to: "/account/binding",
|
|
|
children: "\u524D\u5F80\u7ED1\u5B9A"
|
|
|
})
|
|
|
})]
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
title: "\u624B\u673A\u53F7\u89E3\u7ED1",
|
|
|
open: isShowPhone,
|
|
|
onCancel: function onCancel() {
|
|
|
return setIsShowPhone(false);
|
|
|
},
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee5() {
|
|
|
var _user$userInfo5;
|
|
|
var data, _user$userInfo6;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee5$(_context5) {
|
|
|
while (1) switch (_context5.prev = _context5.next) {
|
|
|
case 0:
|
|
|
if (PhoneValue) {
|
|
|
_context5.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('验证码不能为空');
|
|
|
return _context5.abrupt("return");
|
|
|
case 3:
|
|
|
_context5.next = 5;
|
|
|
return (0,fetch/* default */.ZP)("/api/users/accounts/".concat(user === null || user === void 0 || (_user$userInfo5 = user.userInfo) === null || _user$userInfo5 === void 0 ? void 0 : _user$userInfo5.login, "/phone_unbind.json"), {
|
|
|
method: 'POST',
|
|
|
body: {
|
|
|
code: PhoneValue
|
|
|
}
|
|
|
});
|
|
|
case 5:
|
|
|
data = _context5.sent;
|
|
|
if ((data === null || data === void 0 ? void 0 : data.status) === 0) {
|
|
|
message/* default */.ZP.info('解绑成功');
|
|
|
setCountdownFlag(false);
|
|
|
setIsShowPhone(false);
|
|
|
// setCountdown(60);
|
|
|
setPhoneValue('');
|
|
|
dispatch({
|
|
|
type: 'account/getBasicInfo',
|
|
|
payload: {
|
|
|
login: (_user$userInfo6 = user.userInfo) === null || _user$userInfo6 === void 0 ? void 0 : _user$userInfo6.login
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context5.stop();
|
|
|
}
|
|
|
}, _callee5);
|
|
|
})),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
padding: '8px 20px'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: "\u624B\u673A\u53F7\u89E3\u7ED1\u540E\uFF0C\u5C06\u65E0\u6CD5\u4F7F\u7528\u8BE5\u624B\u673A\u53F7\u767B\u5F55\u5E73\u53F0\uFF0C\u8BF7\u77E5\u6089"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
children: ["\u4F60\u7684\u624B\u673A\u53F7\uFF1A", (_account$basicInfo18 = account.basicInfo) === null || _account$basicInfo18 === void 0 ? void 0 : _account$basicInfo18.phone]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
children: ["\u624B\u673A\u9A8C\u8BC1\u7801\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
size: 'middle',
|
|
|
value: PhoneValue,
|
|
|
onChange: function onChange(e) {
|
|
|
return setPhoneValue(e.target.value);
|
|
|
},
|
|
|
style: {
|
|
|
width: '230px'
|
|
|
}
|
|
|
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
disabled: countdownFlag,
|
|
|
type: "primary",
|
|
|
size: 'middle',
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee6() {
|
|
|
var _user$userInfo7;
|
|
|
var data;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee6$(_context6) {
|
|
|
while (1) switch (_context6.prev = _context6.next) {
|
|
|
case 0:
|
|
|
_context6.next = 2;
|
|
|
return (0,fetch/* default */.ZP)("/api/users/accounts/".concat(user === null || user === void 0 || (_user$userInfo7 = user.userInfo) === null || _user$userInfo7 === void 0 ? void 0 : _user$userInfo7.login, "/get_phone_code.json"), {
|
|
|
method: 'get'
|
|
|
});
|
|
|
case 2:
|
|
|
data = _context6.sent;
|
|
|
if ((data === null || data === void 0 ? void 0 : data.status) === 0) {
|
|
|
message/* default */.ZP.info('验证码发送成功');
|
|
|
setCountdownFlag(true);
|
|
|
}
|
|
|
case 4:
|
|
|
case "end":
|
|
|
return _context6.stop();
|
|
|
}
|
|
|
}, _callee6);
|
|
|
})),
|
|
|
children: countdownFlag ? "\u91CD\u65B0\u53D1\u9001".concat(countdown, "s") : '获取验证码'
|
|
|
})]
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
title: "\u5F3A\u5236\u89E3\u7ED1",
|
|
|
open: isShowUntie,
|
|
|
onCancel: function onCancel() {
|
|
|
return setIsShowUntie(false);
|
|
|
},
|
|
|
onOk: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee7() {
|
|
|
var _user$userInfo8;
|
|
|
var data, _user$userInfo9;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee7$(_context7) {
|
|
|
while (1) switch (_context7.prev = _context7.next) {
|
|
|
case 0:
|
|
|
if (UntieValue) {
|
|
|
_context7.next = 3;
|
|
|
break;
|
|
|
}
|
|
|
message/* default */.ZP.info('验证码不能为空');
|
|
|
return _context7.abrupt("return");
|
|
|
case 3:
|
|
|
_context7.next = 5;
|
|
|
return (0,fetch/* default */.ZP)("/api/users/accounts/".concat(user === null || user === void 0 || (_user$userInfo8 = user.userInfo) === null || _user$userInfo8 === void 0 ? void 0 : _user$userInfo8.login, "/phone_force_unbind.json"), {
|
|
|
method: 'POST',
|
|
|
body: {
|
|
|
code: UntieValue,
|
|
|
phone: form.getFieldValue("phone")
|
|
|
}
|
|
|
});
|
|
|
case 5:
|
|
|
data = _context7.sent;
|
|
|
if ((data === null || data === void 0 ? void 0 : data.status) === 0) {
|
|
|
message/* default */.ZP.info('解绑成功');
|
|
|
setCountdownFlag(false);
|
|
|
setIsShowUntie(false);
|
|
|
setActive(null);
|
|
|
setUntieValue('');
|
|
|
dispatch({
|
|
|
type: 'account/getBasicInfo',
|
|
|
payload: {
|
|
|
login: (_user$userInfo9 = user.userInfo) === null || _user$userInfo9 === void 0 ? void 0 : _user$userInfo9.login
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
case 7:
|
|
|
case "end":
|
|
|
return _context7.stop();
|
|
|
}
|
|
|
}, _callee7);
|
|
|
})),
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
padding: '8px 20px'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
children: "\u82E5\u539F\u8D26\u53F7\u53EA\u6709\u7ED1\u5B9A\u4E86\u624B\u673A\u53F7\u4E00\u79CD\u767B\u5F55\u65B9\u5F0F\uFF0C\u5F3A\u5236\u89E3\u7ED1\u540E\u4F1A\u5BFC\u81F4\u539F\u8D26\u53F7\u65E0\u6CD5\u767B\u5F55\uFF0C\u8BF7\u786E\u5B9A\u662F\u5426\u5F3A\u5236\u89E3\u7ED1"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
children: ["\u4F60\u7684\u624B\u673A\u53F7\uFF1A", form.getFieldValue("phone")]
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsxs)("p", {
|
|
|
children: ["\u624B\u673A\u9A8C\u8BC1\u7801\uFF1A", /*#__PURE__*/(0,jsx_runtime.jsx)(input/* default */.Z, {
|
|
|
value: UntieValue,
|
|
|
size: 'middle',
|
|
|
onChange: function onChange(e) {
|
|
|
return setUntieValue(e.target.value);
|
|
|
},
|
|
|
style: {
|
|
|
width: '230px'
|
|
|
}
|
|
|
}), " ", /*#__PURE__*/(0,jsx_runtime.jsx)(es_button/* default */.ZP, {
|
|
|
disabled: countdownFlag,
|
|
|
type: "primary",
|
|
|
size: 'middle',
|
|
|
onClick: /*#__PURE__*/asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee8() {
|
|
|
var smscode, res;
|
|
|
return regeneratorRuntime_default()().wrap(function _callee8$(_context8) {
|
|
|
while (1) switch (_context8.prev = _context8.next) {
|
|
|
case 0:
|
|
|
smscode = (0,util/* setmiyah */.M)(form.getFieldValue("phone"));
|
|
|
_context8.next = 3;
|
|
|
return dispatch({
|
|
|
type: 'account/getCode',
|
|
|
payload: {
|
|
|
login: form.getFieldValue("phone"),
|
|
|
type: 10,
|
|
|
smscode: smscode
|
|
|
}
|
|
|
});
|
|
|
case 3:
|
|
|
res = _context8.sent;
|
|
|
if (res.status === 1) {
|
|
|
message/* default */.ZP.info('验证码已发送,请注意查收');
|
|
|
setCountdownFlag(true);
|
|
|
}
|
|
|
case 5:
|
|
|
case "end":
|
|
|
return _context8.stop();
|
|
|
}
|
|
|
}, _callee8);
|
|
|
})),
|
|
|
children: countdownFlag ? "\u91CD\u65B0\u53D1\u9001".concat(countdown, "s") : '获取验证码'
|
|
|
})]
|
|
|
})]
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)(modal/* default */.Z, {
|
|
|
title: "\u63D0\u793A",
|
|
|
open: isShowPoint,
|
|
|
onCancel: function onCancel() {
|
|
|
setIsShowPoint(false);
|
|
|
},
|
|
|
okText: "\u8FDB\u884C\u5F3A\u5236\u89E3\u7ED1",
|
|
|
okButtonProps: {
|
|
|
type: "primary",
|
|
|
ghost: true,
|
|
|
style: {
|
|
|
width: "124px"
|
|
|
}
|
|
|
},
|
|
|
onOk: function onOk() {
|
|
|
setIsShowUntie(true);
|
|
|
setIsShowPoint(false);
|
|
|
}
|
|
|
// footer={<div>
|
|
|
// <Button style={{textAlign:'end'}} type="primary" onClick={()=>setIsShowModal(false)}>确 定</Button>
|
|
|
// </div>}
|
|
|
,
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
|
|
|
style: {
|
|
|
padding: '7px 24px'
|
|
|
},
|
|
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
children: "\u8BE5\u624B\u673A\u53F7\u5DF2\u7ECF\u88AB\u7ED1\u5B9A\u8D26\u53F7\uFF0C\u5982\u679C\u9700\u8981\u5C06\u8BE5\u624B\u673A\u53F7\u7ED1\u5B9A\u5728\u5F53\u524D\u8D26\u53F7\u4E0A\uFF0C\u4F60\u53EF\u4EE5\u8FDB\u884C\u4E0B\u65B9\u4EFB\u610F\u4E00\u79CD\u89E3\u7ED1\u64CD\u4F5C\uFF1A"
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("br", {}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
style: {
|
|
|
marginTop: '1em',
|
|
|
display: 'flex'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
flex: '1'
|
|
|
},
|
|
|
children: "1\u3001\u4F7F\u7528\u8BE5\u624B\u673A\u53F7\u767B\u5F55\u5E73\u53F0\u8FDB\u884C\u89E3\u7ED1\uFF0C\u518D\u5C06\u624B\u673A\u53F7\u7ED1\u5B9A\u5F53\u524D\u8D26\u53F7\u4E0A\u3002"
|
|
|
})
|
|
|
}), /*#__PURE__*/(0,jsx_runtime.jsx)("p", {
|
|
|
style: {
|
|
|
marginTop: '1em',
|
|
|
display: 'flex'
|
|
|
},
|
|
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
|
|
|
style: {
|
|
|
flex: '1'
|
|
|
},
|
|
|
children: "2\u3001\u5F3A\u5236\u89E3\u7ED1\uFF08\u5F3A\u5236\u89E3\u7ED1\u53EF\u80FD\u4F1A\u5BFC\u81F4\u89E3\u7ED1\u8D26\u53F7\u65E0\u6CD5\u767B\u5F55\uFF09"
|
|
|
})
|
|
|
})]
|
|
|
})
|
|
|
})]
|
|
|
});
|
|
|
};
|
|
|
/* harmony default export */ var Account_Secure = ((0,_umi_production_exports.connect)(function (_ref17) {
|
|
|
var user = _ref17.user,
|
|
|
account = _ref17.account,
|
|
|
loading = _ref17.loading,
|
|
|
globalSetting = _ref17.globalSetting;
|
|
|
return {
|
|
|
user: user,
|
|
|
account: account,
|
|
|
globalSetting: globalSetting,
|
|
|
loading: loading.models.index
|
|
|
};
|
|
|
})(Secure));
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 87472:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./src/utils/hooks/useInterval.tsx ***!
|
|
|
\*****************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
|
/* harmony export */ Y: function() { return /* binding */ useInterval; }
|
|
|
/* harmony export */ });
|
|
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ 59301);
|
|
|
|
|
|
function useInterval(callback, delay) {
|
|
|
var savedCallback = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
|
|
|
var savedId = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();
|
|
|
|
|
|
// 保存新回调
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
|
savedCallback.current = callback;
|
|
|
});
|
|
|
|
|
|
// 建立 interval
|
|
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
|
function tick() {
|
|
|
savedCallback.current();
|
|
|
}
|
|
|
if (delay !== null) {
|
|
|
var id = setInterval(tick, delay);
|
|
|
savedId.current = id;
|
|
|
return function () {
|
|
|
return clearInterval(id);
|
|
|
};
|
|
|
}
|
|
|
}, [delay]);
|
|
|
}
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
/***/ 8378:
|
|
|
/*!*******************************************************************!*\
|
|
|
!*** ./node_modules/_antd@5.9.0@antd/es/style/motion/collapse.js ***!
|
|
|
\*******************************************************************/
|
|
|
/***/ (function(__unused_webpack_module, __webpack_exports__) {
|
|
|
|
|
|
const genCollapseMotion = token => ({
|
|
|
[token.componentCls]: {
|
|
|
// For common/openAnimation
|
|
|
[`${token.antCls}-motion-collapse-legacy`]: {
|
|
|
overflow: 'hidden',
|
|
|
'&-active': {
|
|
|
transition: `height ${token.motionDurationMid} ${token.motionEaseInOut},
|
|
|
opacity ${token.motionDurationMid} ${token.motionEaseInOut} !important`
|
|
|
}
|
|
|
},
|
|
|
[`${token.antCls}-motion-collapse`]: {
|
|
|
overflow: 'hidden',
|
|
|
transition: `height ${token.motionDurationMid} ${token.motionEaseInOut},
|
|
|
opacity ${token.motionDurationMid} ${token.motionEaseInOut} !important`
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
/* harmony default export */ __webpack_exports__.Z = (genCollapseMotion);
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
}]); |