上传文件至 /
来自宫瑞骏的提交
This commit is contained in:
		
							parent
							
								
									8b909897af
								
							
						
					
					
						commit
						18f821d4f8
					
				
							
								
								
									
										2216
									
								
								package-lock.json
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										2216
									
								
								package-lock.json
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										20
									
								
								package.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								package.sh
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,20 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
# 要清理的临时目录路径
 | 
			
		||||
TEMP_DIR="C:/Users/XINNIAN/AppData/Local/Temp/electron-packager"
 | 
			
		||||
 | 
			
		||||
# 检查临时目录是否存在,并清理其内容
 | 
			
		||||
if [ -d "$TEMP_DIR" ]; then
 | 
			
		||||
  echo "正在清理临时目录: $TEMP_DIR"
 | 
			
		||||
  rm -rf "$TEMP_DIR"/*
 | 
			
		||||
  echo "临时目录清理完成!"
 | 
			
		||||
else
 | 
			
		||||
  echo "临时目录不存在: $TEMP_DIR"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# 打包 Electron 应用
 | 
			
		||||
echo "开始打包 Electron 应用..."
 | 
			
		||||
npx electron-packager . iteyes --platform=win32 --arch=x64 --icon=assets/icon.ico --out=dist --overwrite
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
echo "Electron 应用打包完成!"
 | 
			
		||||
							
								
								
									
										151
									
								
								psw.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										151
									
								
								psw.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,151 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="zh-CN">
 | 
			
		||||
<head>
 | 
			
		||||
    <meta charset="UTF-8">
 | 
			
		||||
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
 | 
			
		||||
    <title>智眼-密码设置</title>
 | 
			
		||||
    <style>
 | 
			
		||||
        /* 样式定义 */
 | 
			
		||||
        * {
 | 
			
		||||
            margin: 0;
 | 
			
		||||
            padding: 0;
 | 
			
		||||
            box-sizing: border-box;
 | 
			
		||||
        }
 | 
			
		||||
        body {
 | 
			
		||||
            display: flex;
 | 
			
		||||
            flex-direction: column;
 | 
			
		||||
            justify-content: center;
 | 
			
		||||
            align-items: center;
 | 
			
		||||
            height: 100vh;
 | 
			
		||||
            background-color: #f5f5f5;
 | 
			
		||||
            font-family: Arial, sans-serif;
 | 
			
		||||
        }
 | 
			
		||||
        .container {
 | 
			
		||||
            background-color: white;
 | 
			
		||||
            padding: 20px;
 | 
			
		||||
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
 | 
			
		||||
            border-radius: 10px;
 | 
			
		||||
            width: 300px;
 | 
			
		||||
            margin-bottom: 20px;
 | 
			
		||||
        }
 | 
			
		||||
        h2 {
 | 
			
		||||
            text-align: center;
 | 
			
		||||
        }
 | 
			
		||||
        input[type="password"] {
 | 
			
		||||
            width: 100%;
 | 
			
		||||
            padding: 10px;
 | 
			
		||||
            margin-bottom: 20px;
 | 
			
		||||
            border: 1px solid #ccc;
 | 
			
		||||
            border-radius: 5px;
 | 
			
		||||
            font-size: 16px;
 | 
			
		||||
        }
 | 
			
		||||
        .button-container {
 | 
			
		||||
            display: flex;
 | 
			
		||||
            justify-content: space-between;
 | 
			
		||||
        }
 | 
			
		||||
        button {
 | 
			
		||||
            padding: 10px 20px;
 | 
			
		||||
            background-color: #333;
 | 
			
		||||
            color: white;
 | 
			
		||||
            border: none;
 | 
			
		||||
            border-radius: 5px;
 | 
			
		||||
            cursor: pointer;
 | 
			
		||||
        }
 | 
			
		||||
        button:hover {
 | 
			
		||||
            background-color: #555;
 | 
			
		||||
        }
 | 
			
		||||
        .function-buttons {
 | 
			
		||||
            display: flex;
 | 
			
		||||
            flex-wrap: wrap;
 | 
			
		||||
            justify-content: center;
 | 
			
		||||
            margin-top: 20px;
 | 
			
		||||
        }
 | 
			
		||||
        .function-buttons button {
 | 
			
		||||
            width: 130px;
 | 
			
		||||
            margin: 10px;
 | 
			
		||||
        }
 | 
			
		||||
        .hidden {
 | 
			
		||||
            display: none;
 | 
			
		||||
        }
 | 
			
		||||
    </style>
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
    <div class="container">
 | 
			
		||||
        <h2>智眼-密码设置</h2>
 | 
			
		||||
        <label for="password">输入密码</label>
 | 
			
		||||
        <input type="password" id="password" oncopy="return false" oncut="return false" onpaste="return false" ondragstart="return false" ondrop="return false">
 | 
			
		||||
        
 | 
			
		||||
        <div class="button-container">
 | 
			
		||||
            <button id="confirm" style="display: block;">确认</button>
 | 
			
		||||
            <button id="reset" style="display: none;">重置</button>
 | 
			
		||||
        </div>
 | 
			
		||||
        
 | 
			
		||||
        <br>
 | 
			
		||||
        
 | 
			
		||||
        <div id="reset-section" class="hidden">
 | 
			
		||||
            <label for="old-password">输入旧密码进行重置</label>
 | 
			
		||||
            <input type="password" id="old-password" oncopy="return false" oncut="return false" onpaste="return false" ondragstart="return false" ondrop="return false">
 | 
			
		||||
            <button id="confirm-reset">确认重置</button>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <!-- 功能按钮部分 -->
 | 
			
		||||
    <div class="container">
 | 
			
		||||
        <div class="function-buttons">
 | 
			
		||||
            <a href="index.html"><button id="home">启动首页</button></a>
 | 
			
		||||
            <a href="psw.html"><button id="unlock">解锁密码设置</button></a>
 | 
			
		||||
            <a href="gncs.html"><button id="test">功能测试</button></a>
 | 
			
		||||
            <a href="setting.html"><button id="settings">软件设置</button></a>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <script>
 | 
			
		||||
 | 
			
		||||
        currentPassword = '123';
 | 
			
		||||
 | 
			
		||||
        // 当用户点击确认按钮时,保存密码并隐藏确认按钮
 | 
			
		||||
        document.getElementById('confirm').addEventListener('click', function() {
 | 
			
		||||
            const password = document.getElementById('password').value;
 | 
			
		||||
            if (password) {
 | 
			
		||||
                currentPassword = password;
 | 
			
		||||
                console.log(password)
 | 
			
		||||
                sendMessage({
 | 
			
		||||
                    "ClientEvent": "SetPassword",
 | 
			
		||||
                    "Content": {
 | 
			
		||||
                        "Password": password
 | 
			
		||||
                    }
 | 
			
		||||
                }).then(() => {
 | 
			
		||||
                    alert('密码已设置');
 | 
			
		||||
                    document.getElementById('password').setAttribute('disabled', true); // 禁用输入框
 | 
			
		||||
                    document.getElementById('confirm').style.display = 'none'; // 隐藏确认按钮
 | 
			
		||||
                    document.getElementById('reset').style.display = 'block';  // 显示重置按钮
 | 
			
		||||
                })
 | 
			
		||||
                
 | 
			
		||||
            } else {
 | 
			
		||||
                alert('请输入密码');
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        // 当用户点击重置按钮时,显示输入旧密码的区域
 | 
			
		||||
        document.getElementById('reset').addEventListener('click', function() {
 | 
			
		||||
            document.getElementById('reset-section').classList.remove('hidden');
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        // 确认重置密码
 | 
			
		||||
        document.getElementById('confirm-reset').addEventListener('click', function() {
 | 
			
		||||
            const oldPassword = document.getElementById('old-password').value;
 | 
			
		||||
            if (oldPassword === currentPassword) {
 | 
			
		||||
                currentPassword = '';  // 清空当前密码
 | 
			
		||||
                document.getElementById('password').value = '';  // 清空密码输入框
 | 
			
		||||
                document.getElementById('old-password').value = ''; // 清空旧密码输入框
 | 
			
		||||
                document.getElementById('password').removeAttribute('disabled'); // 重新启用密码输入框
 | 
			
		||||
                document.getElementById('confirm').style.display = 'block'; // 重新显示确认按钮
 | 
			
		||||
                document.getElementById('reset').style.display = 'none'; // 隐藏重置按钮
 | 
			
		||||
                document.getElementById('reset-section').classList.add('hidden'); // 隐藏重置部分
 | 
			
		||||
                alert('密码已重置');
 | 
			
		||||
            } else {
 | 
			
		||||
                alert('旧密码不正确');
 | 
			
		||||
            }
 | 
			
		||||
        });
 | 
			
		||||
    </script>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										149
									
								
								setting.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										149
									
								
								setting.html
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,149 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="zh-CN">
 | 
			
		||||
<head>
 | 
			
		||||
    <meta charset="UTF-8">
 | 
			
		||||
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
 | 
			
		||||
    <title>智眼-软件设置</title>
 | 
			
		||||
    <script type="text/javascript">   
 | 
			
		||||
        function password() {   
 | 
			
		||||
        var testV = 1;   
 | 
			
		||||
        var pass1 = prompt('请输入密码','');   
 | 
			
		||||
        while (testV < 3) {   
 | 
			
		||||
        if (!pass1)   
 | 
			
		||||
        history.go(-1);   
 | 
			
		||||
        if (pass1 == "123") {//初始密码123   
 | 
			
		||||
        alert('密码正确');   
 | 
			
		||||
        break;   
 | 
			
		||||
        }   
 | 
			
		||||
        testV+=1;   
 | 
			
		||||
        var pass1 =   
 | 
			
		||||
        prompt('密码错误!请重新输入:');   
 | 
			
		||||
        }   
 | 
			
		||||
        if (pass1!="password" & testV ==3)   
 | 
			
		||||
        history.go(-1);   
 | 
			
		||||
        return " ";   
 | 
			
		||||
        }   
 | 
			
		||||
        document.write(password());   
 | 
			
		||||
        </script>      
 | 
			
		||||
    <style>
 | 
			
		||||
        /* 样式定义 */
 | 
			
		||||
        * {
 | 
			
		||||
            margin: 0;
 | 
			
		||||
            padding: 0;
 | 
			
		||||
            box-sizing: border-box;
 | 
			
		||||
        }
 | 
			
		||||
        body {
 | 
			
		||||
            display: flex;
 | 
			
		||||
            flex-direction: column;
 | 
			
		||||
            justify-content: center;
 | 
			
		||||
            align-items: center;
 | 
			
		||||
            height: 100vh;
 | 
			
		||||
            background-color: #f5f5f5;
 | 
			
		||||
            font-family: Arial, sans-serif;
 | 
			
		||||
        }
 | 
			
		||||
        .container {
 | 
			
		||||
            background-color: white;
 | 
			
		||||
            padding: 20px;
 | 
			
		||||
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
 | 
			
		||||
            border-radius: 10px;
 | 
			
		||||
            width: 300px;
 | 
			
		||||
            margin-bottom: 20px;
 | 
			
		||||
        }
 | 
			
		||||
        h2 {
 | 
			
		||||
            text-align: center;
 | 
			
		||||
            margin-bottom: 10px;
 | 
			
		||||
        }
 | 
			
		||||
        label {
 | 
			
		||||
            display: block;
 | 
			
		||||
            margin-bottom: 5px;
 | 
			
		||||
            text-align: center;
 | 
			
		||||
        }
 | 
			
		||||
        input[type="text"], input[type="number"], input[type="checkbox"] {
 | 
			
		||||
            width: 100%;
 | 
			
		||||
            padding: 10px;
 | 
			
		||||
            margin-bottom: 20px;
 | 
			
		||||
            border: 1px solid #ccc;
 | 
			
		||||
            border-radius: 5px;
 | 
			
		||||
            font-size: 16px;
 | 
			
		||||
        }
 | 
			
		||||
        .button-container {
 | 
			
		||||
            display: flex;
 | 
			
		||||
            justify-content: space-between;
 | 
			
		||||
        }
 | 
			
		||||
        button {
 | 
			
		||||
            padding: 10px 20px;
 | 
			
		||||
            background-color: #333;
 | 
			
		||||
            color: white;
 | 
			
		||||
            border: none;
 | 
			
		||||
            border-radius: 5px;
 | 
			
		||||
            cursor: pointer;
 | 
			
		||||
        }
 | 
			
		||||
        button:hover {
 | 
			
		||||
            background-color: #555;
 | 
			
		||||
        }
 | 
			
		||||
        .function-buttons {
 | 
			
		||||
            display: flex;
 | 
			
		||||
            flex-wrap: wrap;
 | 
			
		||||
            justify-content: center;
 | 
			
		||||
            margin-top: 20px;
 | 
			
		||||
        }
 | 
			
		||||
        .function-buttons button {
 | 
			
		||||
            width: 130px;
 | 
			
		||||
            margin: 10px;
 | 
			
		||||
        }
 | 
			
		||||
        .hidden {
 | 
			
		||||
            display: none;
 | 
			
		||||
        }
 | 
			
		||||
    </style>
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
    <div class="container">
 | 
			
		||||
        <h2>时间限制设置</h2>
 | 
			
		||||
        <label for="time-limit">设置每天使用时间上限(分钟),填“0”则为不限制:</label>
 | 
			
		||||
        <input type="number" id="time-limit" min="0" max="7200">
 | 
			
		||||
        <div class="button-container">
 | 
			
		||||
            <button id="save-time-limit">保存</button>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <!-- 导航栏部分 -->
 | 
			
		||||
    <div class="container">
 | 
			
		||||
        <div class="function-buttons">
 | 
			
		||||
            <a href="index.html"><button id="home">启动首页</button></a>
 | 
			
		||||
            <a href="psw.html"><button id="unlock">解锁密码设置</button></a>
 | 
			
		||||
            <a href="gncs.html"><button id="test">功能测试</button></a>
 | 
			
		||||
            <a href="setting.html"><button id="settings">软件设置</button></a>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <script>
 | 
			
		||||
        // 处理时间限制设置
 | 
			
		||||
        document.getElementById('save-time-limit').addEventListener('click', function() {
 | 
			
		||||
            const timeLimit = document.getElementById('time-limit').value;
 | 
			
		||||
            if (timeLimit > 0 && timeLimit <= 7200) {
 | 
			
		||||
                sendMessage({
 | 
			
		||||
                    "ClientEvent": "SetLongTestTime",
 | 
			
		||||
                    "Content": {
 | 
			
		||||
                        "Time": timeLimit
 | 
			
		||||
                    }
 | 
			
		||||
                }).then(() => {
 | 
			
		||||
                    // 处理发送消息成功后的逻辑
 | 
			
		||||
                    longTest = true
 | 
			
		||||
                    alert(`已将每日使用时间上限设置为 ${timeLimit} 分钟`);
 | 
			
		||||
                })
 | 
			
		||||
                
 | 
			
		||||
            } 
 | 
			
		||||
            if (timeLimit > 7200) {
 | 
			
		||||
                alert('请输入有效的分钟数');
 | 
			
		||||
            }
 | 
			
		||||
            if (timeLimit < 0) {
 | 
			
		||||
                alert('请输入有效的分钟数');
 | 
			
		||||
            }
 | 
			
		||||
            if (timeLimit == 0) {
 | 
			
		||||
                longTest = false
 | 
			
		||||
                alert(`已取消时间限制`);
 | 
			
		||||
            } 
 | 
			
		||||
        });
 | 
			
		||||
    </script>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user