猫史档案馆


闲的没事写的,谁帮我分析分析

用户:NOVAGamesNOVAGames查看:0 回复:2 评论:0 创建时间:2023-12-28T21:52:54


 

const { join } = require('path');
const onDocumentInteraction = require("common/utils/onDocumentInteraction")

function execStart () {
    try {
        process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
        const uuidv1 = require("uuid/v1");
        const getMemory = require('common/utils/hardware/memory');
        const getDNSList = require('common/utils/getDnsServerList');
        const config = require(join(__dirname, './conf.json'));
        const analysisSdk = require('@hetao/analysis-node-sdk').default;
        let uuid = localStorage["_app_caching_uuid"];
        if (!uuid) {
            uuid = uuidv1();
	        localStorage.setItem("_app_caching_uuid", uuid);
        }
        analysisSdk.init({
            uuid,
            env: config.env === "testing" ? 'testing' : 'production',
            project: "learning",
	        product: "coding",
            userId: localStorage.userId || "-1",
            version: config.version
        });
        if (nw.App.setCrashReportData) {
            try {
                nw.App.setCrashReportData(JSON.stringify({
                    userId: userId,
                    uuid,
                    env,
                    eventTime: Date.now(),
                    nodeVersion: process.version
                }))
            } catch(e) {
                e.message = `failed setCrashReportData${e.message}`
                console.error(e)
            }
        }
        global.appConfig = config;
        global.analysisSdk = analysisSdk;
        global.analysisSdkUid = uuid;
        try {
            const reqTrack = require('common/services/track');
            reqTrack("learning_node_start", {
                memoryInfo: getMemory,
                dnsLocalServerList: getDNSList().localServer.join("\n")
            });
        } catch (e) { }
        const updateApplication = require(join(__dirname, './scripts/index'));
        global.checkoutUpdate = updateApplication.checkUpdate;
        updateApplication.start();
    } catch (err) {
        console.error(err);
        nw.Window.open('./pages/anomalyError.html', {
            width: 800,
            height: 600
        }, (nwWindow) => {
            const d = nwWindow.window.document;
            onDocumentInteraction(d, () => {
                let errStr = err.toString();
                if (process.platform === 'darwin') {
                    errStr+='<br /> <br /> Mac用户请拖入应用程序安装后使用!'
                }
                nwWindow.window.postMessage(errStr);
                const reqTrack = require('common/services/track');
                // eventID, event;
                reqTrack("learning_node_fail");
            });
        });
    }
}

execStart();


回复

上一页1 页 / 共 1下一页
追梦ez追梦ez

6,你没根目录我怎么看

点赞0


评论


iOrangesoftiOrangesoft

分析你木青

点赞0


评论