diff --git a/scripts/lib/base64.js b/scripts/lib/base64.js index a387440..e04abf0 100644 --- a/scripts/lib/base64.js +++ b/scripts/lib/base64.js @@ -365,11 +365,7 @@ export function encode (str, asciiOnly) { if (notString) { return encodeFromBytes(str); } else { - if (!asciiOnly && /[^\x00-\x7F]/.test(str)) { - return utf8Base64Encode(str); - } else { - return btoa(str); - } + return !asciiOnly && /[^\x00-\x7F]/.test(str) ? utf8Base64Encode(str) : btoa(str); } }; diff --git a/scripts/mainMenu/admin.js b/scripts/mainMenu/admin.js index fad7318..9b85e9b 100644 --- a/scripts/mainMenu/admin.js +++ b/scripts/mainMenu/admin.js @@ -72,8 +72,8 @@ export function AdminMenu(player) { break; }; case (1): { - let isData = function (key) { if (enables.getData(key) == 1) { return false } else return true; }; - let boolCvt = function (key) { if (key) return 0; else return 1; }; //奇怪的bug,暫時修改 + let isData = function (key) { return enables.getData(key) == 1 ? false : true; }; + let boolCvt = function (key) { return key ? 0 : 1; }; //奇怪的bug,暫時修改 let fm = new ui.ModalFormData(); fm.title("開關功能"); let enableList = [];