Skip to content

Commit

Permalink
feat: 修复 mac 打开后白屏问题
Browse files Browse the repository at this point in the history
  • Loading branch information
yangmingming committed Oct 26, 2024
1 parent 49513e0 commit fa97d74
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# 3.5.2

1. bug fix
- 修复 mac 下打开后白屏问题

# 3.5.1

1. bug fix
- 增加 pdf 首页长度, 避免被吞文本
- 仅实际发生微博详情抓取时, 才需要休眠 1s


# 3.5.0

> 感谢博主 [@二级市场捡辣鸡冠军](https://weibo.com/u/7519797263) 的无私分享. 作者受博主感召, 爬起来更新了这版代码
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stablog",
"version": "3.5.1",
"version": "3.5.2",
"description": "稳部落. 专业备份微blog, 老铁, 稳!",
"repository": {
"type": "git",
Expand Down
8 changes: 7 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ import InitEnvCommand from '~/src/command/init_env'
import MUser from '~/src/model/mblog_user'
import MBlog from '~/src/model/mblog'
import MFetchErrorRecord from '~/src/model/fetch_error_record'
import fs from 'node:fs'
import fs from 'fs'
import _ from 'lodash'
import sharp from 'sharp'
import path from 'path'
import os from 'os'

let argv = process.argv
let isDebug = argv.includes('--stablog-debug')
const isMacOS = os.platform() === 'darwin'
let { app, BrowserWindow, ipcMain, session, shell } = Electron
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
Expand Down Expand Up @@ -103,6 +105,10 @@ function createWindow() {
mainWindow.loadURL('http://127.0.0.1:8000')
mainWindow.webContents.openDevTools()
} else {
if (isMacOS) {
// MacOS下, 不打开控制台无法正常加载页面
mainWindow.webContents.openDevTools()
}
// 线上地址
mainWindow.loadFile('./dist/client/dist/index.html')
}
Expand Down

0 comments on commit fa97d74

Please sign in to comment.