调整缩进

This commit is contained in:
nonameShijian 2024-02-16 19:01:00 +08:00
parent 55a94424bc
commit e1ba7d315d
1 changed files with 14 additions and 14 deletions

View File

@ -1157,20 +1157,20 @@ export const otherMenu = function (connectMenu) {
* @type { (value:string)=>any } * @type { (value:string)=>any }
*/ */
const fun = (new Function('window', ` const fun = (new Function('window', `
const _status=window._status; const _status=window._status;
const lib=window.lib; const lib=window.lib;
const game=window.game; const game=window.game;
const ui=window.ui; const ui=window.ui;
const get=window.get; const get=window.get;
const ai=window.ai; const ai=window.ai;
const cheat=window.lib.cheat; const cheat=window.lib.cheat;
//使用正则匹配绝大多数的普通obj对象避免解析成代码块。 //使用正则匹配绝大多数的普通obj对象避免解析成代码块。
const reg=${/^\{([^{}]+:\s*([^\s,]*|'[^']*'|"[^"]*"|\{[^}]*\}|\[[^\]]*\]|null|undefined|([a-zA-Z$_][a-zA-Z0-9$_]*\s*:\s*)?[a-zA-Z$_][a-zA-Z0-9$_]*\(\)))(?:,\s*([^{}]+:\s*(?:[^\s,]*|'[^']*'|"[^"]*"|\{[^}]*\}|\[[^\]]*\]|null|undefined|([a-zA-Z$_][a-zA-Z0-9$_]*\s*:\s*)?[a-zA-Z$_][a-zA-Z0-9$_]*\(\))))*\}$/}; const reg=${/^\{([^{}]+:\s*([^\s,]*|'[^']*'|"[^"]*"|\{[^}]*\}|\[[^\]]*\]|null|undefined|([a-zA-Z$_][a-zA-Z0-9$_]*\s*:\s*)?[a-zA-Z$_][a-zA-Z0-9$_]*\(\)))(?:,\s*([^{}]+:\s*(?:[^\s,]*|'[^']*'|"[^"]*"|\{[^}]*\}|\[[^\]]*\]|null|undefined|([a-zA-Z$_][a-zA-Z0-9$_]*\s*:\s*)?[a-zA-Z$_][a-zA-Z0-9$_]*\(\))))*\}$/};
return function(value){ return function(value){
"use strict"; "use strict";
return eval(reg.test(value)?('('+value+')'):value); return eval(reg.test(value)?('('+value+')'):value);
} }
`))(proxyWindow); `))(proxyWindow);
const runCommand = () => { const runCommand = () => {
if (text2.value && !['up', 'down'].includes(text2.value)) { if (text2.value && !['up', 'down'].includes(text2.value)) {
logindex = -1; logindex = -1;