设备管理

This commit is contained in:
2025-10-17 16:48:37 +08:00
parent de9815e154
commit 0ef9069cc5
11 changed files with 126 additions and 23 deletions

View File

@ -9,6 +9,7 @@ import dayjs from 'dayjs'
import os from "os";
import { GetHomeDir } from './config'
import { start, getServer } from "./app";
const http = require("http");
const yaml = require("js-yaml");
@ -208,7 +209,6 @@ function createWindow(): void {
if (!files.canceled) {
path = files.filePath.replace(/\\/g, "/");
function callBack(key) {
console.log("下载完成");
event.sender.send("saveNetFileRes", key);
}
function downloadFile(url, path) {
@ -226,19 +226,18 @@ function createWindow(): void {
}
}
);*/
http
.get(url, (response) => {
let contentLength = parseInt(
response.headers["content-length"]
);
let downloadedLength = 0;
response.pipe(fs.createWriteStream(path));
response.on("end", () => {
callBack("success");
// Message.success('下载成功')
// dialog.showMessageBox(null,{type:'info',message:"下载完成"})
});
})
http.get(url, (response) => {
let contentLength = parseInt(
response.headers["content-length"]
);
let downloadedLength = 0;
response.pipe(fs.createWriteStream(path));
response.on("end", () => {
callBack("success");
// Message.success('下载成功')
// dialog.showMessageBox(null,{type:'info',message:"下载完成"})
});
})
.on("error", (err) => {
console.log("完成");
callBack("error");