diff --git a/layouts__index.async.js b/layouts__index.async.js index c5180f769f..fd840fce8a 100644 --- a/layouts__index.async.js +++ b/layouts__index.async.js @@ -66,6 +66,9 @@ var objectSpread2_default = /*#__PURE__*/__webpack_require__.n(objectSpread2); // 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); @@ -79,9 +82,6 @@ var modal = __webpack_require__(43418); var zh_CN = __webpack_require__(81863); // EXTERNAL MODULE: ./src/.umi-production/exports.ts + 15 modules var _umi_production_exports = __webpack_require__(8931); -// 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/_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 @@ -3096,6 +3096,7 @@ var es = __webpack_require__(78600); + var _excluded = ["loading", "globalSetting", "user", "dispatch"]; @@ -3125,6 +3126,9 @@ var SimpleLayouts = function SimpleLayouts(_ref) { props = objectWithoutProperties_default()(_ref, _excluded); var location = (0,_umi_production_exports.useLocation)(); var payload = (0,Header/* getCourseParam */.g)(); + var _useSearchParams = (0,_umi_production_exports.useSearchParams)(), + _useSearchParams2 = slicedToArray_default()(_useSearchParams, 1), + searchParams = _useSearchParams2[0]; var globalLoading = globalSetting.globalLoading; var getData = /*#__PURE__*/function () { var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee() { @@ -3172,8 +3176,17 @@ var SimpleLayouts = function SimpleLayouts(_ref) { case 13: res = _context.sent; case 14: - if ((_res = res) !== null && _res !== void 0 && _res.username && location.pathname === '/login') { - _umi_production_exports.history.push("/"); + if (((_res = res) === null || _res === void 0 ? void 0 : _res.username) !== "游客") { + if (location.pathname === '/login') { + window.location.href = "/"; + } + // 检测微信登录跳转过来下载,登录之后,执行一次download_url下载文件 + if (location.pathname !== '/user/login' && location.pathname !== '/login') { + if (window.sessionStorage.getItem("download_url")) { + (0,util/* downLoadLink */.Nd)("educoder", window.sessionStorage.getItem("download_url")); + window.sessionStorage.removeItem("download_url"); + } + } } case 15: case "end": diff --git a/p__User__Login__index.async.js b/p__User__Login__index.async.js index 54e6f9895d..292d90b24a 100644 --- a/p__User__Login__index.async.js +++ b/p__User__Login__index.async.js @@ -95,6 +95,11 @@ var LoginPopComponents = function LoginPopComponents(_ref) { _useState8 = slicedToArray_default()(_useState7, 2), openUnlockLogin = _useState8[0], setOpenUnlockLogin = _useState8[1]; + (0,_react_17_0_2_react.useEffect)(function () { + if (searchParams.get("download_url")) { + window.sessionStorage.setItem("download_url", searchParams.get("download_url")); + } + }, []); var onFinish = /*#__PURE__*/function () { var _ref2 = asyncToGenerator_default()( /*#__PURE__*/regeneratorRuntime_default()().mark(function _callee(values) { var res, from; diff --git a/umi.js b/umi.js index d0d7168189..4ca9f426af 100644 --- a/umi.js +++ b/umi.js @@ -27116,6 +27116,8 @@ var UserModel = { } }); case 6: + return _context4.abrupt("return", response); + case 7: case "end": return _context4.stop(); }