@@ -6,7 +6,7 @@ import { UpdateCommand } from 'commonModule/type/ipc/command'
66import { shell } from 'electron'
77import { previewOnlineFileApi } from 'mainModule/api/file'
88import { cacheTypeToFilePath } from 'mainModule/cache/config'
9- import { getRootPath } from 'mainModule/config'
9+ import { getCachePath , getRootPath } from 'mainModule/config'
1010import dBServicemediaCache from 'mainModule/database/services/media/media'
1111import { downloadFile } from 'mainModule/utils/download/index'
1212import logger from 'mainModule/utils/log'
@@ -42,7 +42,7 @@ class UpdaterHandler {
4242 logger . info ( { text : '开始下载更新' , data : { fileKey, md5, version } } , 'UpdaterHandler' )
4343
4444 // 获取升级缓存目录(绝对路径)
45- const cacheRoot = path . join ( getRootPath ( ) , 'cache' )
45+ const cacheRoot = getCachePath ( )
4646 const updateDir = path . join ( cacheRoot , cacheTypeToFilePath [ CacheType . PUBLIC_UPDATE ] )
4747
4848 // 构建完整的文件路径(直接使用 fileKey 作为文件名)
@@ -93,7 +93,7 @@ class UpdaterHandler {
9393 logger . info ( { text : '开始升级' , data : { fileKey, md5, version } } , 'UpdaterHandler' )
9494
9595 // 根据data中的信息构建文件路径(绝对路径)
96- const cacheRoot = path . join ( getRootPath ( ) , 'cache' )
96+ const cacheRoot = getCachePath ( )
9797 const updateDir = path . join ( cacheRoot , cacheTypeToFilePath [ CacheType . PUBLIC_UPDATE ] )
9898 const filePath = path . join ( updateDir , fileKey )
9999
0 commit comments