修复注册的事件未被清理的问题
This commit is contained in:
@@ -231,7 +231,7 @@ export default class LinePlayer {
|
||||
timeoutTools.cancelNextTick = window.cancelAnimationFrame.bind(window)
|
||||
} else {
|
||||
timeoutTools.nextTick = (handler) => {
|
||||
return setTimeout(handler, 80)
|
||||
return setTimeout(handler, 20)
|
||||
}
|
||||
timeoutTools.cancelNextTick = clearTimeout.bind(global)
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import fs from 'node:fs'
|
||||
import crypto from 'node:crypto'
|
||||
import { gzip, gunzip } from 'node:zlib'
|
||||
import path from 'node:path'
|
||||
import { networkInterfaces } from 'node:os'
|
||||
import { log } from '@common/utils'
|
||||
|
||||
export const joinPath = (...paths: string[]): string => path.join(...paths)
|
||||
@@ -185,3 +186,20 @@ export const copyFile = async(sourcePath: string, distPath: string) => {
|
||||
export const moveFile = async(sourcePath: string, distPath: string) => {
|
||||
return fs.promises.rename(sourcePath, distPath)
|
||||
}
|
||||
|
||||
export const getAddress = (): string[] => {
|
||||
const nets = networkInterfaces()
|
||||
const results: string[] = []
|
||||
// console.log(nets)
|
||||
|
||||
for (const interfaceInfos of Object.values(nets)) {
|
||||
if (!interfaceInfos) continue
|
||||
// Skip over non-IPv4 and internal (i.e. 127.0.0.1) addresses
|
||||
for (const interfaceInfo of interfaceInfos) {
|
||||
if (interfaceInfo.family === 'IPv4' && !interfaceInfo.internal) {
|
||||
results.push(interfaceInfo.address)
|
||||
}
|
||||
}
|
||||
}
|
||||
return results
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user