From 241796607eeae34fef0ea5403a0081e598162c6a Mon Sep 17 00:00:00 2001 From: ximu3 Date: Sat, 12 Oct 2024 12:47:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=91=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E7=9B=B8=E5=85=B3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/index.js | 4 +++- src/renderer/src/components/cloudSync.mjs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index ffb13fd..141a3a5 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -206,6 +206,8 @@ async function appToSync() { try { const appPath = getAppPath(''); const syncPath = getSyncPath(''); + // 清空sync文件夹 + await fse.emptyDir(syncPath); //排除path文件夹 const files = await fs.readdir(appPath); for (const file of files) { @@ -926,7 +928,7 @@ app.whenReady().then(async () => { ipcMain.handle('start-auth-process', async (event, clientId, clientSecret) => { try { const result = await startAuthProcess(mainWindow, clientId, clientSecret); - log.info('Github认证成功:', result); + log.info('Github认证成功:', result.username); return result; } catch (error) { log.error('Github认证错误:', error); diff --git a/src/renderer/src/components/cloudSync.mjs b/src/renderer/src/components/cloudSync.mjs index 119b774..d078392 100644 --- a/src/renderer/src/components/cloudSync.mjs +++ b/src/renderer/src/components/cloudSync.mjs @@ -81,7 +81,7 @@ async function exchangeCodeForToken(code, mainWindow, clientId, clientSecret) { const username = userResponse.data.login; // 存储用户名 - mainWindow.webContents.send('auth-success', { username: username, accessToken: "***" }); + mainWindow.webContents.send('auth-success', { username: username, accessToken: accessToken }); return { username: username, accessToken: accessToken }; } catch (error) {