From 1eae482fae9aa04c835aa1a76015f71b1b254c10 Mon Sep 17 00:00:00 2001 From: autosubmit Date: Thu, 14 Mar 2024 18:24:58 +0800 Subject: [PATCH] Auto Submit --- layouts__LoginAndRegister__index.async.js | 53 +++++++++++--------- p__MyProblem__index.async.js | 23 +++++++++ p__Problems__OjForm__NewEdit__index.async.js | 3 +- p__Problems__OjForm__index.async.js | 3 +- p__User__Login__index.async.js | 4 ++ 5 files changed, 61 insertions(+), 25 deletions(-) diff --git a/layouts__LoginAndRegister__index.async.js b/layouts__LoginAndRegister__index.async.js index 193d83f089..5bb8d71db9 100644 --- a/layouts__LoginAndRegister__index.async.js +++ b/layouts__LoginAndRegister__index.async.js @@ -15,6 +15,9 @@ __webpack_require__.d(__webpack_exports__, { "default": function() { return /* binding */ layouts_LoginAndRegister; } }); +// 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/_react@17.0.2@react/index.js var _react_17_0_2_react = __webpack_require__(59301); ;// CONCATENATED MODULE: ./src/layouts/LoginAndRegister/index.less?modules @@ -49,34 +52,38 @@ var jsx_runtime = __webpack_require__(37712); + var HOST = window.location.host; -var redirect_uri = env/* default */.Z.QQLoginCB; -function onQQLogin() { - if ((0,util/* isPc */.b9)()) { - window.location.href = "https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=".concat(redirect_uri, "%2fotherloginqq&state=null,").concat(HOST, "&response_type=code"); - } else { - (0,util/* openNewWindow */.xg)("https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=".concat(redirect_uri, "%2fotherloginqq&state=null,").concat(HOST, "&response_type=code")); - } -} -function onWechatLogin() { - modal/* default */.Z.info({ - icon: null, - closable: true, - centered: true, - maskClosable: true, - className: LoginAndRegistermodules.qrcodeModal, - content: /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", { - frameBorder: "0", - sandbox: "allow-scripts allow-same-origin allow-top-navigation", - scrolling: "no", - src: "https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=".concat(redirect_uri, "%2fotherloginstart&response_type=code&scope=snsapi_login&state=null,").concat(HOST, "#wechat_redirect") - }) - }); -} var LoginAndRegister = function LoginAndRegister(_ref) { var _globalSetting$settin, _globalSetting$settin2, _globalSetting$settin3; var globalSetting = _ref.globalSetting, dispatch = _ref.dispatch; + var _useSearchParams = (0,_umi_production_exports.useSearchParams)(), + _useSearchParams2 = slicedToArray_default()(_useSearchParams, 1), + searchParams = _useSearchParams2[0]; + var redirect_uri = searchParams.get("back_url") || env/* default */.Z.QQLoginCB; + function onQQLogin() { + if ((0,util/* isPc */.b9)()) { + window.location.href = "https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=".concat(redirect_uri, "%2fotherloginqq&state=null,").concat(HOST, "&response_type=code"); + } else { + (0,util/* openNewWindow */.xg)("https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=".concat(redirect_uri, "%2fotherloginqq&state=null,").concat(HOST, "&response_type=code")); + } + } + function onWechatLogin() { + modal/* default */.Z.info({ + icon: null, + closable: true, + centered: true, + maskClosable: true, + className: LoginAndRegistermodules.qrcodeModal, + content: /*#__PURE__*/(0,jsx_runtime.jsx)("iframe", { + frameBorder: "0", + sandbox: "allow-scripts allow-same-origin allow-top-navigation", + scrolling: "no", + src: "https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=".concat(redirect_uri, "%2fotherloginstart&response_type=code&scope=snsapi_login&state=null,").concat(HOST, "#wechat_redirect") + }) + }); + } (0,_react_17_0_2_react.useEffect)(function () { if (!globalSetting.setting) { dispatch({ diff --git a/p__MyProblem__index.async.js b/p__MyProblem__index.async.js index cc45c8949b..f69770b1cf 100644 --- a/p__MyProblem__index.async.js +++ b/p__MyProblem__index.async.js @@ -9762,6 +9762,29 @@ function ActionBar(_ref8) { onChangeLanguage(getLanguage(type)); } }, []); + (0,_react_17_0_2_react.useEffect)(function () { + if (hack !== null && hack !== void 0 && hack.tpm_code_modified) { + modal/* default */.Z.confirm({ + title: '更新初始代码', + icon: /*#__PURE__*/(0,jsx_runtime.jsx)(ExclamationCircleOutlined/* default */.Z, {}), + content: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", { + children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", { + children: "\u7F16\u7A0B\u9898\u7684\u521D\u59CB\u4EE3\u7801\u5185\u5BB9\u6709\u66F4\u65B0," + }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", { + children: "\u66F4\u65B0\u64CD\u4F5C\u5C06\u4FDD\u7559\u5DF2\u5B8C\u6210\u7684\u8BC4\u6D4B\u8BB0\u5F55\u548C\u6210\u7EE9," + }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", { + children: "\u8FD8\u672A\u5B8C\u6210\u8BC4\u6D4B\u7684\u4EFB\u52A1\u4EFB\u52A1\u4EE3\u7801\uFF0C\u8BF7\u81EA\u884C\u4FDD\u5B58\uFF01" + })] + }), + centered: true, + okText: '确定', + cancelText: '取消', + onOk: function onOk() { + return onResetCode(); + } + }); + } + }, [hack === null || hack === void 0 ? void 0 : hack.language]); console.log(hack, 'hack'); return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", { className: "action-bar", diff --git a/p__Problems__OjForm__NewEdit__index.async.js b/p__Problems__OjForm__NewEdit__index.async.js index 038d1b3459..61a37a3414 100644 --- a/p__Problems__OjForm__NewEdit__index.async.js +++ b/p__Problems__OjForm__NewEdit__index.async.js @@ -6458,7 +6458,7 @@ function reducer(state, action) { fontSize = state.fontSize, showEditorSetting = state.showEditorSetting, tabToSpace = state.tabToSpace; - var _useState = (0,_react_17_0_2_react.useState)('c'), + var _useState = (0,_react_17_0_2_react.useState)('C'), _useState2 = slicedToArray_default()(_useState, 2), language = _useState2[0], setLanguage = _useState2[1]; @@ -6533,6 +6533,7 @@ function reducer(state, action) { insertSpaces: tabToSpace } }; + console.log('----', language); return /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, { children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", { className: CodeProgramPanelmodules["code-panel-container"], diff --git a/p__Problems__OjForm__index.async.js b/p__Problems__OjForm__index.async.js index e51295c655..6c36c01646 100644 --- a/p__Problems__OjForm__index.async.js +++ b/p__Problems__OjForm__index.async.js @@ -6459,7 +6459,7 @@ function reducer(state, action) { fontSize = state.fontSize, showEditorSetting = state.showEditorSetting, tabToSpace = state.tabToSpace; - var _useState = (0,_react_17_0_2_react.useState)('c'), + var _useState = (0,_react_17_0_2_react.useState)('C'), _useState2 = slicedToArray_default()(_useState, 2), language = _useState2[0], setLanguage = _useState2[1]; @@ -6534,6 +6534,7 @@ function reducer(state, action) { insertSpaces: tabToSpace } }; + console.log('----', language); return /*#__PURE__*/(0,jsx_runtime.jsxs)(_react_17_0_2_react.Fragment, { children: [/*#__PURE__*/(0,jsx_runtime.jsxs)("div", { className: CodeProgramPanelmodules["code-panel-container"], diff --git a/p__User__Login__index.async.js b/p__User__Login__index.async.js index aea6d647d6..54e6f9895d 100644 --- a/p__User__Login__index.async.js +++ b/p__User__Login__index.async.js @@ -152,6 +152,10 @@ var LoginPopComponents = function LoginPopComponents(_ref) { from = searchParams.get("form") || searchParams.get("back_url"); if (from) { window.location.href = decodeURIComponent(from); + setTimeout(function () { + // 解决登录后,如果back_url为后端地址,无法跳转,重定向到首页 + window.location.href = '/'; + }, 1500); } else { window.location.href = '/'; }