diff --git a/layouts__index.async.js b/layouts__index.async.js index 66a5dc8c5e..def87f8b57 100644 --- a/layouts__index.async.js +++ b/layouts__index.async.js @@ -2678,101 +2678,95 @@ var SimpleLayouts = function SimpleLayouts(_ref) { (0,_react_17_0_2_react.useEffect)(function () { getData(); }, [location.pathname]); - (0,_react_17_0_2_react.useEffect)(function () { - var _window$location$href, _window$location$href2; - if (location.pathname.indexOf("classrooms") > -1 && location.pathname.indexOf("detail") === -1) {} else { - document.body.scrollIntoView(); - } - // 教育部考试系统 - if (location.pathname.indexOf("/classrooms/4RW9CYHY") > -1 && document.domain !== "localhost" && document.domain !== "kepukehuan.educoder.net") { - window.location.href = "https://kepukehuan.educoder.net/classrooms/4RW9CYHY/exercise"; - return; - } - if (location.pathname.indexOf("/classrooms/qb4ft587") > -1 && document.domain !== "localhost" && document.domain !== "kepukehuan.educoder.net") { - window.location.href = "https://kepukehuan.educoder.net/classrooms/qb4ft587/exercise"; - return; - } - if (location.pathname.indexOf("/classrooms/c5q9bsp2") > -1 && document.domain !== "localhost" && document.domain !== "kepukehuan.educoder.net") { - window.location.href = "https://kepukehuan.educoder.net/classrooms/c5q9bsp2/exercise"; - return; - } - dispatch({ - type: 'globalSetting/query', - payload: {} - }); - dispatch({ - type: "globalSetting/setGlobalLoading", - payload: { - show: false, - text: "" - } - }); - // dispatch({ type: "globalSetting/getSystemUpdate", payload: { show: false, text: "" } }) - // http://localhost:8000 - // https://jetcoder.educoder.net - if (window.location.href === 'https://jetcoder.educoder.net' || window.location.href === 'https://jetcoder.educoder.net/') { - window.location.href = 'https://www.educoder.net/problems'; - return; - } - //在线刷题分享 - if ((_window$location$href = window.location.href) !== null && _window$location$href !== void 0 && _window$location$href.includes('/problems') && (_window$location$href2 = window.location.href) !== null && _window$location$href2 !== void 0 && _window$location$href2.includes('/share')) { - var _window$location; - var ojId = (_window$location = window.location) === null || _window$location === void 0 || (_window$location = _window$location.pathname) === null || _window$location === void 0 || (_window$location = _window$location.split('/')) === null || _window$location === void 0 ? void 0 : _window$location[2]; - var p = (0,fetch/* default */.ZP)("/api/practices/".concat(ojId, "/start"), { - method: 'get' - }); - p.then(function (res) { - if ((res === null || res === void 0 ? void 0 : res.status) === 0) { - _umi_production_exports.history.replace("/problems/".concat(res === null || res === void 0 ? void 0 : res.identifier, "/oj/").concat(ojId)); - } - }); - return; - } - if (location.pathname === '/admins' || location.pathname === '/sidekiq') { - var domain = document.domain; - if (domain.indexOf("educoder.net") > -1) { - switch (domain) { - case "www.educoder.net": - case "educoder.net": - window.location.href = "https://data.educoder.net".concat(location.pathname); - break; - default: - var str = document.domain.split("."); - str[0] = str[0] + "-data"; - window.location.href = "https://".concat(str.join(".")).concat(location.pathname); - break; - } - } - } - modal/* default */.Z.destroyAll(); - if ((0,util/* isLocalApp */.WX)()) { - if ((0,util/* compareVersion */.yC)("2.0.0") > 0) { - modal/* default */.Z.info({ - title: "客户端版本过低", - centered: true, - content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", { - children: [/*#__PURE__*/(0,jsx_runtime.jsx)("span", { - className: "c-red", - children: "\u60A8\u7684\u5934\u6B4C\u8003\u8BD5\u7CFB\u7EDF\u67DC\u5BA2\u6237\u7AEF\u7248\u672C\u8FC7\u4F4E" - }), "\uFF0C\u8BF7\u5347\u7EA7\u81F3\u6700\u65B0\u7248\u672C\u540E\u518D\u4F7F\u7528\uFF0C\u70B9\u51FB\"\u786E\u5B9A\"\u540E\u5C06\u4E0B\u8F7D\u6700\u65B0\u7248\u672C\u7684\u5BA2\u6237\u7AEF,", /*#__PURE__*/(0,jsx_runtime.jsx)("span", { - className: "c-red", - children: "\u4E0B\u8F7D\u540E\u8BF7\u5148\u9000\u51FA\u5BA2\u6237\u7AEF\u518D\u5B89\u88C5" - })] - }), - okText: "立即升级", - visible: true, - maskClosable: false, - onOk: function onOk() { - (0,util/* downLoadFile */.FH)("Educoder.exe", "https://www-cdn.educoder.net/app/Educoder.exe"); - return new Promise(function () {}); - } - }); - } - ; - } + // useEffect(() => { + + // if (location.pathname.indexOf("classrooms") > -1 && location.pathname.indexOf("detail") === -1) { + + // } else { + // document.body.scrollIntoView() + // } + // // 教育部考试系统 + // if (location.pathname.indexOf("/classrooms/4RW9CYHY") > -1 && document.domain !== "localhost" && document.domain !== "kepukehuan.educoder.net") { + // window.location.href = "https://kepukehuan.educoder.net/classrooms/4RW9CYHY/exercise" + // return; + // } + // if (location.pathname.indexOf("/classrooms/qb4ft587") > -1 && document.domain !== "localhost" && document.domain !== "kepukehuan.educoder.net") { + // window.location.href = "https://kepukehuan.educoder.net/classrooms/qb4ft587/exercise" + // return; + // } + // if (location.pathname.indexOf("/classrooms/c5q9bsp2") > -1 && document.domain !== "localhost" && document.domain !== "kepukehuan.educoder.net") { + // window.location.href = "https://kepukehuan.educoder.net/classrooms/c5q9bsp2/exercise" + // return; + // } + + // dispatch({ + // type: 'globalSetting/query', + // payload: {}, + // }) + // dispatch({ type: "globalSetting/setGlobalLoading", payload: { show: false, text: "" } }) + // // dispatch({ type: "globalSetting/getSystemUpdate", payload: { show: false, text: "" } }) + // // http://localhost:8000 + // // https://jetcoder.educoder.net + // if (window.location.href === 'https://jetcoder.educoder.net' || window.location.href === 'https://jetcoder.educoder.net/') { + // window.location.href = 'https://www.educoder.net/problems' + // return + // } + // //在线刷题分享 + // if (window.location.href?.includes('/problems') && window.location.href?.includes('/share')) { + // const ojId = window.location?.pathname?.split('/')?.[2]; + // const p = Fetch(`/api/practices/${ojId}/start`, { + // method: 'get', + // }) + // p.then((res: any) => { + // if (res?.status === 0) { + // history.replace(`/problems/${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.destroyAll(); + + // if (isLocalApp()) { + // if (compareVersion("2.0.0") > 0) { + // Modal.info({ + // title: "客户端版本过低", + // centered: true, + // content: