更新依赖&版本号(2.6.0-beta.5)

This commit is contained in:
lyswhut
2023-12-12 14:00:22 +08:00
parent e9539b5c5c
commit 050b641d79
21 changed files with 335 additions and 334 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ const verifyConnection = (encryptMsg: string, userId: string) => {
export const authConnect = async(req: http.IncomingMessage) => {
let ip = getAvailableIP(req)
if (ip) {
const query = querystring.parse((req.url as string).split('?')[1])
const query = querystring.parse((req.url!).split('?')[1])
const i = query.i
const t = query.t
if (typeof i == 'string' && typeof t == 'string' && verifyConnection(t, i)) return
@@ -56,7 +56,7 @@ const checkDuplicateClient = (newSocket: LX.Sync.Server.Socket) => {
}
const handleConnection = async(socket: LX.Sync.Server.Socket, request: IncomingMessage) => {
const queryData = new URL(request.url as string, host).searchParams
const queryData = new URL(request.url!, host).searchParams
const clientId = queryData.get('i')
// // if (typeof socket.handshake.query.i != 'string') return socket.disconnect(true)
@@ -232,7 +232,7 @@ const handleStartServer = async(port = 9527, ip = '0.0.0.0') => await new Promis
// events = {}
if (!status.devices.length) handleUnconnection()
} else {
const queryData = new URL(request.url as string, host).searchParams
const queryData = new URL(request.url!, host).searchParams
log.info('deconnection', queryData.get('i'))
}
})
@@ -301,7 +301,7 @@ const handleStartServer = async(port = 9527, ip = '0.0.0.0') => await new Promis
const bind = typeof addr == 'string' ? `pipe ${addr}` : `port ${addr.port}`
log.info(`Listening on ${ip} ${bind}`)
resolve(null)
void registerLocalSyncEvent(wss as LX.Sync.Server.SocketServer)
void registerLocalSyncEvent(wss!)
})
host = `http://${ip}:${port}`
+2 -2
View File
@@ -178,8 +178,8 @@ export const initHotKey = async() => {
}
return {
local: localConfig as LX.HotKeyConfig,
global: globalConfig as LX.HotKeyConfig,
local: localConfig!,
global: globalConfig!,
}
}
+1 -1
View File
@@ -30,7 +30,7 @@ const migrateV1 = (db: Database.Database) => {
// 修复 v2.4.0 的默认数据库版本号不对的问题
const existsTable = db.prepare('SELECT name FROM "main".sqlite_master WHERE type=\'table\' AND name=\'dislike_list\';').get()
if (!existsTable) {
const sql = tables.get('dislike_list') as string
const sql = tables.get('dislike_list')!
db.exec(sql)
}
}
@@ -322,7 +322,7 @@ export const musicsPositionUpdate = (listId: string, position: number, ids: stri
const map = new Map<string, LX.Music.MusicInfo>()
for (const item of newTargetList) map.set(item.id, item)
for (const id of ids) {
infos.push(map.get(id) as LX.Music.MusicInfo)
infos.push(map.get(id)!)
map.delete(id)
}
newTargetList = newTargetList.filter(mInfo => map.has(mInfo.id))