From 39b22cc4779992034654778a415dbac37bfe5b51 Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Sun, 31 Aug 2025 21:41:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4LeonOS=E7=9A=84?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E7=99=BB=E5=BD=95=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=B9=B6=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除bios.lua中的管理员登录验证逻辑和installer.lua中的管理员账户创建功能 将系统版本号从Alpha 1.1更新至1.6.0 --- data/computercraft/lua/bios.lua | 27 +-------------------------- installer.lua | 26 +------------------------- 2 files changed, 2 insertions(+), 51 deletions(-) diff --git a/data/computercraft/lua/bios.lua b/data/computercraft/lua/bios.lua index ee9a84a..703f2b7 100644 --- a/data/computercraft/lua/bios.lua +++ b/data/computercraft/lua/bios.lua @@ -1,4 +1,4 @@ -_G._HOST = _G._HOST .. " (LeonOS Alpha 1.1)" +_G._HOST = _G._HOST .. " (LeonOS 1.6.0)" local fs = rawget(_G, "fs") @@ -184,31 +184,6 @@ end expect = require("cc.expect").expect --- Admin login verification -local tu = require("rom.apis.textutils") -local admin_username = settings.get("LeonOS.users.admin.username") -local admin_password = settings.get("LeonOS.users.admin.password") - -if admin_username then - term.clear() - tu.coloredPrint(colors.yellow, "LeonOS Login\n=======================") - tu.coloredPrint("Username: ", colors.lightBlue, admin_username) - - if admin_password then - tu.coloredPrint("Password: ") - local input_password = read(nil, {}, nil, true) -- Use password mode - - while input_password ~= admin_password do - tu.coloredPrint(colors.red, "Incorrect password!\n") - tu.coloredPrint("Password: ") - input_password = read(nil, {}, nil, true) - end - else - tu.coloredPrint(colors.green, "No password set. Press Enter to continue.") - read() - end -end - local thread = require("rc.thread") thread.start() diff --git a/installer.lua b/installer.lua index e5fb538..0501d28 100644 --- a/installer.lua +++ b/installer.lua @@ -65,7 +65,7 @@ end print("[Installer] Loading done.") term.at(1,1).clear() tu.coloredPrint(colors.yellow, - "LeonOS Installer (Alpha 1.1)\n=======================") + "LeonOS Installer\n=======================") print("You are going to install LeonOS to your computer.") print("This will overwrite any existing files in the installation directory.") tu.coloredPrint(colors.yellow, "Are you sure? (y/n)") @@ -86,30 +86,6 @@ if #ROM_DIR == 0 then ROM_DIR = DEFAULT_ROM_DIR end ROM_DIR = "/"..shell.resolve(ROM_DIR) settings.set("LeonOS.rom_dir", ROM_DIR) - --- Create admin user -print("") -tu.coloredPrint(colors.yellow, "Create Administrator Account\n=======================") -tu.coloredPrint("Enter admin username: ") -local admin_username = read() -while #admin_username == 0 do - tu.coloredPrint(colors.red, "Username cannot be empty!\n") - tu.coloredPrint("Enter admin username: ") - admin_username = read() -end - -tu.coloredPrint("Enter admin password (leave empty for no password): ") --- Use password mask with "*" character -tu.coloredPrint(colors.yellow, "(Password will be hidden)") -local admin_password = read(nil, {}, nil, "*") -- Use password mode with "*" mask - --- Save user info -settings.set("LeonOS.users.admin.username", admin_username) -if #admin_password > 0 then - settings.set("LeonOS.users.admin.password", admin_password) -else - settings.set("LeonOS.users.admin.password", nil) -end settings.save() tu.coloredPrint(colors.white, "Installing LeonOS to ", colors.lightBlue,