mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-27 13:29:15 +07:00
try to fix desktop image issue
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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[]) => {
|
||||
|
||||
Reference in New Issue
Block a user