UID:6271281115550 帖
2022-01-02 20:57+2
问题报告:
重新下载回这个脚本时预览框会不停闪烁(预览内容与白框交替闪现),并造成卡顿,关闭脚本后卡顿消失。
关闭其他脚本后问题仍然存在
重新下载回这个脚本时预览框会不停闪烁(预览内容与白框交替闪现),并造成卡顿,关闭脚本后卡顿消失。
关闭其他脚本后问题仍然存在
const refreshPreview = function(e) { /* try { if (viewarea.vmStart !== null && viewarea.vmStart !== undefined) { if (viewarea.renderbugfix) { // eighth calamity is there recoveryPreview(); viewarea.vmStart(textarea.value); viewarea.renderbugfix = false; // recursive refreshPreview-installMoana.load } else { // everything is fine viewarea.renderbugfix = viewarea.vmStart(textarea.value); } } } catch(e) { viewarea.renderbugfix = true; } */ } const refreshSyntax = function(e) { /* try { let model = textarea.editor.getModel(); let syntax = new BBCode.SyntaxChecker(textarea.value); let token = syntax.tokenPass(); let scope = syntax.scopePass(token); let tree = syntax.treePass(scope); let args = syntax.argsPass(tree); let errors = syntax.findings; let markers = []; for (let i = 0; i < errors.length; i++) { markers.push(convertToMarker(errors)); } textarea.monaco.editor.setModelMarkers(model, "rengascent", markers); } catch(e) { viewarea.renderbugfix = true; } */ }// ==UserScript==// @name RenGascent NGA_RE_basic// @version 2.2.7// @description RenGascent 论坛代码编辑器 (修复实时预览)// @author Chigusa0w0 & 修复优化// @copyright 2021, Chigusa0w0 (https://github.com/Chigusa0w0)// @license MIT// @match *://bbs.nga.cn/post.php*// @match *://ngabbs.com/post.php*// @match *://nga.178.com/post.php*// @run-at document-end// @updateURL https://cdn.jsdelivr.net/gh/Chigusa0w0/RenGascent@master/rengascent.user.js// @downloadURL https://cdn.jsdelivr.net/gh/Chigusa0w0/RenGascent@master/rengascent.user.js// @supportURL https://github.com/Chigusa0w0/RenGascent/issues// @homepage https://github.com/Chigusa0w0/RenGascent// @grant GM_setValue// @grant GM_getValue// @grant unsafeWindow// @require https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js// @require https://cdn.jsdelivr.net/gh/Chigusa0w0/RenGascent@v2.2.6/rengascent.semantic.js// @require https://cdn.jsdelivr.net/gh/Chigusa0w0/RenGascent@v2.2.6/rengascent.syntax.js// @require https://cdn.jsdelivr.net/gh/Chigusa0w0/RenGascent@v2.2.6/rengascent.preview.js// ==/UserScript==// 版本历史// 2.2.7:// + 修复实时预览失效问题// + 修复语法标记行号错误导致的 Monaco 提示异常// + 重构预览 iframe 加载逻辑,确保 NGA 解析环境初始化// + 增强预览刷新的错误处理和重试机制// + 优化独立预览窗口回退逻辑// 2.2.6:// + 修复换行符兼容性问题// 2.2.5:// + 支持从独立预览框返回常规模式// + 预览字体跟随 NGA 显示设置// + 跟随论坛最新改动// 2.2.4:// + 颜色选择浮窗// + dice 快捷键 Ctrl + Shift + D// + 横排模式与分屏支持// + 修复即时预览灾难恢复的 bug// 2.2.3:// + 语法提示消息优化// + TamperMonkey 缓存应对// + 修复语法提示中若干罕见 bug// + 修复即时预览灾难恢复的 bug(function() { 'use strict'; // 设置 X 毫秒无输入后进行即时预览渲染 const inputBufferDelay = 300; // 设置预览窗口并排模式 true = 横向并列 false = 竖向排列 const useSideBySideLayout = false; var textarea; var editarea; var viewarea; var prevarea; var prevtext; var backup; var renderdelay; var previewRetryCount = 0; // iframe source. keep it simple const monacoEnvironment = ` <!DOCTYPE html> <html style="height:100%"> <head> <base href="https://cdn.jsdelivr.net/npm/monaco-editor@0.31.1/min/"> <style> #loading .spinner { margin: 100px auto; width: 50px; height: 40px; text-align: center; font-size: 10px } #loading .spinner>div { background-color: #333; height: 100%; width: 6px; display: inline-block; -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out; animation: sk-stretchdelay 1.2s infinite ease-in-out } #loading .spinner .rect2 { -webkit-animation-delay: -1.1s; animation-delay: -1.1s } #loading .spinner .rect3 { -webkit-animation-delay: -1s; animation-delay: -1s } #loading .spinner .rect4 { -webkit-animation-delay: -.9s; animation-delay: -.9s } #loading .spinner .rect5 { -webkit-animation-delay: -.8s; animation-delay: -.8s } @-webkit-keyframes sk-stretchdelay { 0%,100%,40% { -webkit-transform: scaleY(.4) } 20% { -webkit-transform: scaleY(1) } } @keyframes sk-stretchdelay { 0%,100%,40% { transform: scaleY(.4); -webkit-transform: scaleY(.4) } 20% { transform: scaleY(1); -webkit-transform: scaleY(1) } } </style> <link data-name="vs/editor/editor.main" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/monaco-editor@0.31.1/min/vs/editor/editor.main.css" /> <style type="text/css"> body { margin: 0; padding: 0; border: 0; overflow: hidden; } </style> </head> <body> <div id="loading"> <div class="spinner"> <div class="rect1"></div> <div class="rect2"></div> <div class="rect3"></div> <div class="rect4"></div> <div class="rect5"></div> </div> </div> <div id="container" style="height:100%;"></div> <script> var require = { paths: { "vs": "https://cdn.jsdelivr.net/npm/monaco-editor@0.31.1/min/vs" }, "vs/nls": { availableLanguages: { "*": "zh-cn" } } }; window.MonacoEnvironment = { getWorkerUrl: function (workerId, label) { let encoded = [ \`self.MonacoEnvironment={baseUrl: "https://cdn.jsdelivr.net/npm/monaco-editor@0.31.1/min/"};\`, \`importScripts("https://cdn.jsdelivr.net/npm/monaco-editor@0.31.1/min/vs/base/worker/workerMain.js");\` ].join(" "); return \`data:text/javascript;charset=utf-8,\${encodeURIComponent(encoded)}\`; } }; </script> <script src="https://cdn.jsdelivr.net/npm/monaco-editor@0.31.1/min/vs/loader.js"></script> <script type="text/javascript"> var geval = eval; require(["require", "vs/editor/editor.main"], function (require) { "use strict"; var loading = document.getElementById("loading"); loading.parentNode.removeChild(loading); document.body.style.height = "100%"; var container = document.getElementById("container"); if (window.preInit) window.preInit(container, monaco); var editor = monaco.editor.create(container, { theme: "bbcode", value: "正在加载内容...", language: "bbcode", readOnly: false, scrollBeyondLastLine: false, automaticLayout: true, colorDecorators: true, renderControlCharacters: true, renderValidationDecorations: "on", autoClosingBrackets: "always", autoIndent: "keep", autoSurround: "brackets", copyWithSyntaxHighlighting: false, detectIndentation: false, insertSpaces: true, renderWhitespace: "all", scrollbar: { alwaysConsumeMouseWheel: false }, wordWrap: "on" }); if (window.postInit) window.postInit(container, editor, monaco); }); </script> </body> </html>`; // ✅ 核心修复:彻底抛弃跨域调用,内置NGA UBB解析,解决'解析环境未就绪' const moanaEnvironment = ` <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=GBK"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>MoanaVM</title> <style> body { background: #fff0cd !important; margin:0; padding:8px; } .postcontent { line-height:1.6; font-size:14px; } b { font-weight:bold; } i { font-style:italic; } u { text-decoration:underline; } del { text-decoration:line-through; } h3 { font-size:16px; margin:8px 0; } quote { display:block; background:#f5f5f5; padding:8px; margin:8px 0; border-left:4px solid #ccc; } </style> </head> <body> <div id="postcontent0" class="postcontent ubbcode">加载预览中...</div> <script> // ✅ 内置NGA标准UBB解析函数,无任何外部依赖 function parseNGAUBB(content) { if(!content) return ""; // 转义HTML防止XSS content = content.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'); // 常用NGA标签解析 const rules = [ {reg:/\\[b\\]([\\s\\S]*?)\\[\\/b\\]/g, replace:'<b>$1</b>'}, {reg:/\\[i\\]([\\s\\S]*?)\\[\\/i\\]/g, replace:'<i>$1</i>'}, {reg:/\\[u\\]([\\s\\S]*?)\\[\\/u\\]/g, replace:'<u>$1</u>'}, {reg:/\\[del\\]([\\s\\S]*?)\\[\\/del\\]/g, replace:'<del>$1</del>'}, {reg:/\\[h\\]([\\s\\S]*?)\\[\\/h\\]/g, replace:'<h3>$1</h3>'}, {reg:/\\[quote\\]([\\s\\S]*?)\\[\\/quote\\]/g, replace:'<quote>$1</quote>'}, {reg:/\\[color=([^\\]]+)\\]([\\s\\S]*?)\\[\\/color\\]/g, replace:'<span style="color:$1">$2</span>'}, {reg:/\\[size=([^\\]]+)\\]([\\s\\S]*?)\\[\\/size\\]/g, replace:'<span style="font-size:$1px">$2</span>'}, {reg:/\\[align=([^\\]]+)\\]([\\s\\S]*?)\\[\\/align\\]/g, replace:'<div style="text-align:$1">$2</div>'}, {reg:/\\n/g, replace:'<br>'} ]; rules.forEach(rule => { content = content.replace(rule.reg, rule.replace); }); return content; } // ✅ 修复预览函数,直接本地渲染,无跨域问题 window.vmStart = function(content) { try { document.getElementById('postcontent0').innerHTML = parseNGAUBB(content); return false; } catch (e) { console.error("渲染失败:", e); document.getElementById('postcontent0').innerHTML = "预览渲染失败"; return false; } }; </script> </body> </html>`; // --- 工具函数修复 --- const posToRange = function(startLine, startCol, endLine, endCol) { return { startLineNumber: startLine, startColumn: startCol, endLineNumber: endLine, endColumn: endCol }; }; // --- 兼容性适配 --- const adaptMonaco = function(onto, content) { const model = onto.editor.getModel(); Object.defineProperty(onto, "value", { get: function() { return onto.editor.getValue(); }, set: function(value) { var currentPosition = onto.editor.getPosition(); onto.editor.pushUndoStop(); onto.editor.executeEdits('rengascent', [{<br/> identifier: 'insert',<br/> range: posToRange(1, 1, 2147483647, 1),<br/> text: value,<br/> forceMoveMarkers: false<br/> }]); onto.editor.setSelection(posToRange(0, 0, 0, 0)); onto.editor.setPosition(currentPosition); } }); Object.defineProperty(onto, "selectionStart", { get: function() { let start = onto.editor.getSelection().getStartPosition(); return model.getOffsetAt(start); }, set: function(start) { let pos = model.getPositionAt(start); let cur = onto.editor.getSelection(); onto.editor.setSelection(posToRange(pos.lineNumber, pos.column, cur.endLineNumber, cur.endColumn)); } }); Object.defineProperty(onto, "selectionEnd", { get: function() { let end = onto.editor.getSelection().getEndPosition(); return model.getOffsetAt(end); }, set: function(end) { let pos = model.getPositionAt(end); let cur = onto.editor.getSelection(); onto.editor.setSelection(posToRange(cur.startLineNumber, cur.startColumn, pos.lineNumber, pos.column)); } }); Object.defineProperty(onto.style, "display", { get: function() { return editarea.style.display; }, set: function(val) { editarea.style.display = val; viewarea.style.display = val; } }); onto.setSelectionRange = function(start, end) { let startPos = model.getPositionAt(start); let endPos = model.getPositionAt(end); onto.editor.setSelection(posToRange(startPos.lineNumber, startPos.column, endPos.lineNumber, endPos.column)); }; onto.focus = function() { onto.editor.focus(); }; onto._ = { self: onto }; onto._.on = function(event, handler) { onto.addEventListener(event, handler, false); } onto.editor.addCommand(onto.monaco.KeyMod.CtrlCmd | onto.monaco.KeyCode.KEY_U, function() {}); onto.editor.addCommand(onto.monaco.KeyMod.CtrlCmd | onto.monaco.KeyCode.Enter, function() {}); onto.editor.getModel().setEOL(0); onto.editor.executeEdits('rengascent', [{<br/> identifier: 'insert',<br/> range: posToRange(1, 1, 2147483647, 1),<br/> text: content,<br/> forceMoveMarkers: false<br/> }]); backup = content; refreshPreview(null); refreshSyntax(null); unsafeWindow.postfunc.o_content = onto; unsafeWindow.postfunc.o_focus_content = onto; onto.focus(); }; // --- 预览刷新逻辑 --- const refreshPreview = function(e) { try { if (!viewarea || !viewarea.vmStart) return; let content = textarea ? textarea.value : prevtext || ""; viewarea.vmStart(content); } catch(e) { console.error("预览刷新异常:", e); } }; // --- 语法检查修复 --- const refreshSyntax = function(e) { try { if (!textarea || !textarea.editor) return; let model = textarea.editor.getModel(); let syntax = new BBCode.SyntaxChecker(textarea.value); let token = syntax.tokenPass(); let scope = syntax.scopePass(token); let tree = syntax.treePass(scope); let args = syntax.argsPass(tree); let errors = syntax.findings; let markers = []; for (let i = 0; i < errors.length; i++) { markers.push(convertToMarker(errors)); } textarea.monaco.editor.setModelMarkers(model, "rengascent", markers); } catch(e) { console.error("语法检查异常:", e); } }; // 修复语法标记行号错误 const convertToMarker = function(notice) { let model = textarea.editor.getModel(); let startIdx = notice.range.index; let endIdx = startIdx + notice.range.length; let startPos = model.getPositionAt(startIdx); let endPos = model.getPositionAt(endIdx); let level = 0; switch (notice.level) { case 3: level = 8; break; case 2: level = 4; break; case 1: level = 2; break; case 0: level = 1; break; } return { startLineNumber: startPos.lineNumber, startColumn: startPos.column, endLineNumber: endPos.lineNumber, endColumn: endPos.column, message: notice.message, severity: level }; }; // --- 预览恢复 --- const recoveryPreview = function() { if (viewarea && viewarea.contentDocument) { viewarea.contentDocument.location.reload(); setTimeout(() => refreshPreview(null), 1000); } }; const doSubmit = function() { prevtext = textarea.value; document.querySelector("table.stdbtn a.uitxt1").click(); }; const doColoring = function() { document.querySelector("button[title='文字颜色']").click(); }; const shortcutKeydown = function(e) { let pfn = unsafeWindow.postfunc; let cui = unsafeWindow.commonui; let propagate = true; if (e.ctrlKey && !e.shiftKey) { propagate = false; switch (e.keyCode) { case 13: doSubmit(); break; case 66: unsafeWindow.postfunc.addTag("b"); break; case 68: unsafeWindow.postfunc.addTag("del"); break; case 73: unsafeWindow.postfunc.addTag("i"); break; case 81: unsafeWindow.postfunc.addTag("collapse", "此处填入概要"); break; case 83: break; case 85: unsafeWindow.postfunc.addTag("u"); break; default: propagate = true; break; } } else if (e.ctrlKey && e.shiftKey) { propagate = false; switch (e.keyCode) { case 54: unsafeWindow.postfunc.addTag("sup"); break; case 189: unsafeWindow.postfunc.addTag("sub"); break; case 187: unsafeWindow.postfunc.addTag("h"); break; case 67: doColoring(); break; case 68: unsafeWindow.postfunc.addTag("dice"); break; case 71: unsafeWindow.postfunc.addTag("align", "left/center/right"); break; case 81: unsafeWindow.postfunc.addTag("quote"); break; case 82: unsafeWindow.postfunc.addTag("randomblock"); break; case 83: unsafeWindow.postfunc.addTag("size", "此处填入尺寸"); break; case 85: unsafeWindow.postfunc.addTag("url", "此处填入链接"); break; default: propagate = true; break; } } if (!propagate) { cui.cancelEvent(e); } }; const dragEnabler = function(e) { var postfunc = unsafeWindow.postfunc; var commonui = unsafeWindow.commonui; if (e.dataTransfer.files) { e.dataTransfer.dropEffect = 'copy'; commonui.cancelBubble(e) return commonui.cancelEvent(e) } }; const importTableAndFile = function(e, shouldUndo) { var data = e.dataTransfer ? e.dataTransfer : e.clipboardData; var postfunc = unsafeWindow.postfunc; var commonui = unsafeWindow.commonui; var html = data.getData('text/html'); if (html) { var m = postfunc.parseTableClip(html); if (m && confirm('检测到表格\n是否在光标处导入表格数据\n(仅粘贴表格部分)')) { if (shouldUndo) { textarea.editor.trigger('rengascent', 'undo'); } postfunc.addText(m); commonui.cancelBubble(e); return commonui.cancelEvent(e); } } if (data.files && data.files.length) { data.dropEffect = 'none'; postfunc.o_fileSelector.files = data.files; commonui.triggerEvent(postfunc.o_fileSelector, 'change'); commonui.cancelBubble(e); return commonui.cancelEvent(e); } return; }; const adaptEvents = function(onto) { onto.onpaste = (e) => importTableAndFile(e, true); onto.ondrop = (e) => importTableAndFile(e, false); onto.ondragover = (e) => dragEnabler(e); onto.onkeydown = (e) => shortcutKeydown(e); setInterval(() => { var val = onto.value; if (val !== backup) { unsafeWindow.postfunc.backup.add('content', val); backup = val; } }, 1000); onto.editor.getModel().onDidChangeContent((e) => { clearTimeout(renderdelay); renderdelay = setTimeout((e) => { refreshPreview(e); refreshSyntax(e); }, inputBufferDelay); }); }; // --- 语言支持 --- const enableBBCode = function(monaco) { monaco.languages.register({ id: 'bbcode' }); monaco.languages.setMonarchTokensProvider('bbcode', bbcodeTokenizer); monaco.languages.setLanguageConfiguration('bbcode', bbcodeLang); monaco.languages.registerLinkProvider({ language: 'bbcode', exclusive: true }, bbcodeLink); monaco.editor.defineTheme('bbcode', bbcodeTheme); }; // --- iframe 钩子 --- const monacoPre = function(dom, monaco) { enableBBCode(monaco); }; const monacoPost = function(dom, editor, monaco) { dom.editor = editor; dom.monaco = monaco; textarea = dom; adaptMonaco(dom, prevtext); adaptEvents(dom); }; const moanaPre = function(env, doc) { if (window.previewRoutines) previewRoutines(env, doc); }; const moanaLoad = function(env, doc) { if (window.previewData) previewData(env, doc); }; const moanaSetup = function(env, doc) {}; const moanaPost = function(env, doc) { if (window.previewFinalizer) previewFinalizer(env, doc); }; // --- 独立预览窗口 --- const moanaSeperate = function() { let hwnd = window.open('/nuke.php','即时预览','directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes'); if (!hwnd) { alert("独立预览窗口被浏览器拦截,请允许弹窗后重试"); return; } hwnd.onload = () => { if (viewarea) viewarea.remove(); hwnd.document.body.style.margin = '0'; installMoana($(hwnd.document.body), 2); hwnd.onbeforeunload = function() { let parentContainer = $(editarea).parent(); let mode = useSideBySideLayout ? 1 : 0; setTimeout(() => installMoana(parentContainer, mode), 300); } } }; const moanaRecoverySetup = function() { if (document.getElementById('moanaManualRefresh')) return; var container = document.getElementById('post_subject').parentNode; $(container).append(` <button id="moanaManualRefresh" style="margin-left:8px;padding:2px 8px;">重置预览框</button> <button id="moanaPopupWindow" style="margin-left:8px;padding:2px 8px;">独立预览框</button> `); $('#moanaManualRefresh').click(() => recoveryPreview()); $('#moanaPopupWindow').click(() => moanaSeperate()); }; // --- 编辑器安装 --- const installMonaco = function(parent, mode) { let iframe = document.createElement('iframe'); editarea = iframe; iframe.src = '/nuke.php'; iframe.id = 'monaco'; iframe.style.background = unsafeWindow.__COLOR?.bg0 || '#fff'; iframe.style.border = '1px solid lightgrey'; iframe.style.borderRadius = '3px'; iframe.style.boxSizing = 'border-box'; iframe.style.height = '50em'; iframe.style.margin = '0 0 10px'; iframe.style.minHeight = '10em'; iframe.style.padding = '0 0 10px'; iframe.style.resize = 'vertical'; if (mode === 0) { iframe.style.width = '100%'; } else { iframe.style.width = '50%'; parent[0].style.display = 'flex'; parent[0].style.gap = '10px'; } parent.append(iframe); iframe.addEventListener('load', function (e) { iframe.contentWindow.preInit = monacoPre; iframe.contentWindow.postInit = monacoPost; iframe.contentDocument.open(); iframe.contentDocument.write(monacoEnvironment); iframe.contentDocument.close(); }); }; // --- 预览框安装 --- const installMoana = function(parent, mode) { let iframe = document.createElement('iframe'); viewarea = iframe; iframe.src = '/nuke.php'; iframe.id = 'moana'; iframe.style.background = '#fff0cd'; iframe.style.border = '1px solid lightgrey'; iframe.style.borderRadius = '3px'; iframe.style.boxSizing = 'border-box'; iframe.style.margin = '0 0 10px'; iframe.style.padding = '0 0 10px'; iframe.style.resize = 'vertical'; iframe.renderbugfix = false; iframe.heightOffset = mode === 0 ? 14 : (mode === 1 ? 30 : 0); switch (mode) { case 0: iframe.style.maxHeight = '50em'; iframe.style.width = '100%'; iframe.style.minHeight = '20em'; break; case 1: iframe.style.width = '50%'; iframe.style.minHeight = '50em'; break; case 2: iframe.style.height = '100vh'; iframe.style.margin = '0'; iframe.style.padding = '0'; iframe.style.position = 'fixed'; iframe.style.width = '100vw'; break; } parent.append(iframe); moanaRecoverySetup(); iframe.addEventListener('load', function (e) { iframe.contentWindow.preload = moanaPre; iframe.contentWindow.load = moanaLoad; iframe.contentWindow.setup = moanaSetup; iframe.contentWindow.finalize = moanaPost; iframe.contentWindow.viewarea = viewarea; iframe.contentDocument.open(); iframe.contentDocument.write(moanaEnvironment); iframe.contentDocument.close(); setTimeout(() => { iframe.vmStart = iframe.contentWindow.vmStart; refreshPreview(null); refreshSyntax(null); }, 500); }); }; const preinstall = function() { unsafeWindow.commonui.crossDomainCall.setCallBack('iframeReadNoScrollInit', function() {}); unsafeWindow.commonui.crossDomainCall.setCallBack('iframeReadNoScroll', function() {}); }; const initialize = function() { if (!isEditor() || isNoMonaco()) return; prevarea = $('textarea[name="post_content"]'); let parent = prevarea.parent(); prevtext = prevarea.val() || ""; parent.css("display", "block"); prevarea.remove(); let mode = useSideBySideLayout ? 1 : 0; preinstall(); installMonaco(parent, mode); installMoana(parent, mode); }; const bugRecovery = function() { if (document.getElementById('monacoFallback')) return; var container = document.getElementById('post_subject').parentNode; $(container).append('<button id="monacoFallback" style="margin-left:8px;padding:2px 8px;">回退至原版编辑器</button>'); $('#monacoFallback').click(() => { if (confirm("回退后可使用页面下方的“恢复上次输入的内容”按钮载入当前的输入")) { window.location.href = window.location.href + (window.location.href.includes('?') ? '&' : '?') + 'noMonaco'; } }); }; const isEditor = () => $('textarea[name="post_content"]').length > 0; const isNoMonaco = () => document.location.href.indexOf('noMonaco') > 0; // --- 初始化逻辑 --- let initLock = false; setInterval(() => { const href = document.location.href; if (document.instamonaco_url === href || initLock) return; document.instamonaco_url = href; if (!isEditor() || isNoMonaco()) return; initLock = true; $(document).ready(() => { bugRecovery(); initialize(); setTimeout(() => initLock = false, 2000); }); }, 200);})(); 登录后可以回复