Skip to content

Commit

Permalink
fix: 修复云同步相关问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ximu3 committed Oct 12, 2024
1 parent fb5e78c commit 2417966
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/cloudSync.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2417966

Please sign in to comment.