try to fix desktop image issue

This commit is contained in:
arvinxx
2025-05-09 00:00:24 +08:00
parent 5be775dc48
commit 8dad8f3937
4 changed files with 8 additions and 5 deletions

View File

@@ -88,7 +88,7 @@ export default class SystemController extends ControllerModule {
}
@ipcServerEvent('setDatabaseSchemaHash')
async setDatabaseSchemaHash(hash: string) {
async setDatabaseSchemaHash({ hash }: { hash: string }) {
writeFileSync(this.DB_SCHEMA_HASH_PATH, hash, 'utf8');
}

View File

@@ -23,7 +23,7 @@ export default class UploadFileCtr extends ControllerModule {
// ======== server event
@ipcServerEvent('getStaticFilePath')
async getFileUrlById(id: string) {
async getFileUrlById({ id }: { id: string }) {
return this.fileService.getFilePath(id);
}

View File

@@ -178,7 +178,10 @@ export class ElectronIpcClient {
}
// 发送请求到 Electron IPC 服务器
public async sendRequest<T>(method: ServerDispatchEventKey, params: any = {}): Promise<T> {
public async sendRequest<T>(
method: ServerDispatchEventKey,
params: Record<string, any> = {},
): Promise<T> {
if (!this.socketPath) {
console.error('Cannot send request: Electron IPC connection not available');
throw new Error('Electron IPC connection not available');

View File

@@ -20,11 +20,11 @@ class LobeHubElectronIpcClient extends ElectronIpcClient {
setDatabaseSchemaHash = async (hash: string | undefined) => {
if (!hash) return;
return this.sendRequest('setDatabaseSchemaHash', hash);
return this.sendRequest('setDatabaseSchemaHash', { hash });
};
getFilePathById = async (id: string) => {
return this.sendRequest<string>('getStaticFilePath', id);
return this.sendRequest<string>('getStaticFilePath', { id });
};
deleteFiles = async (paths: string[]) => {