mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-04-04 07:25:53 +00:00
Compare commits
1 Commits
main
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf04d6bc18 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -72,4 +72,3 @@ pnpm-lock.yaml
|
|||||||
/pnpm-workspace.yaml
|
/pnpm-workspace.yaml
|
||||||
wechat-research-site
|
wechat-research-site
|
||||||
.codex
|
.codex
|
||||||
weflow-web-offical
|
|
||||||
@@ -136,7 +136,6 @@ const shouldOfferUpdateForTrack = (latestVersion: string, currentVersion: string
|
|||||||
}
|
}
|
||||||
|
|
||||||
let lastAppliedUpdaterChannel: string | null = null
|
let lastAppliedUpdaterChannel: string | null = null
|
||||||
let lastAppliedUpdaterFeedUrl: string | null = null
|
|
||||||
const resetUpdaterProviderCache = () => {
|
const resetUpdaterProviderCache = () => {
|
||||||
const updater = autoUpdater as any
|
const updater = autoUpdater as any
|
||||||
// electron-updater 会缓存 provider;切换 channel 后需清理缓存,避免仍请求旧通道
|
// electron-updater 会缓存 provider;切换 channel 后需清理缓存,避免仍请求旧通道
|
||||||
@@ -147,41 +146,23 @@ const resetUpdaterProviderCache = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const getUpdaterFeedUrlByTrack = (track: 'stable' | 'preview' | 'dev'): string => {
|
|
||||||
const repoBase = 'https://github.com/hicccc77/WeFlow/releases'
|
|
||||||
if (track === 'stable') return `${repoBase}/latest/download`
|
|
||||||
if (track === 'preview') return `${repoBase}/download/nightly-preview`
|
|
||||||
return `${repoBase}/download/nightly-dev`
|
|
||||||
}
|
|
||||||
|
|
||||||
const applyAutoUpdateChannel = (reason: 'startup' | 'settings' = 'startup') => {
|
const applyAutoUpdateChannel = (reason: 'startup' | 'settings' = 'startup') => {
|
||||||
const track = getEffectiveUpdateTrack()
|
const track = getEffectiveUpdateTrack()
|
||||||
const currentTrack = inferUpdateTrackFromVersion(appVersion)
|
const currentTrack = inferUpdateTrackFromVersion(appVersion)
|
||||||
const baseUpdateChannel = track === 'stable' ? 'latest' : track
|
const baseUpdateChannel = track === 'stable' ? 'latest' : track
|
||||||
const nextFeedUrl = getUpdaterFeedUrlByTrack(track)
|
|
||||||
const nextUpdaterChannel =
|
const nextUpdaterChannel =
|
||||||
process.platform === 'win32' && process.arch === 'arm64'
|
process.platform === 'win32' && process.arch === 'arm64'
|
||||||
? `${baseUpdateChannel}-arm64`
|
? `${baseUpdateChannel}-arm64`
|
||||||
: baseUpdateChannel
|
: baseUpdateChannel
|
||||||
if (
|
if (lastAppliedUpdaterChannel && lastAppliedUpdaterChannel !== nextUpdaterChannel) {
|
||||||
(lastAppliedUpdaterChannel && lastAppliedUpdaterChannel !== nextUpdaterChannel) ||
|
|
||||||
(lastAppliedUpdaterFeedUrl && lastAppliedUpdaterFeedUrl !== nextFeedUrl)
|
|
||||||
) {
|
|
||||||
resetUpdaterProviderCache()
|
resetUpdaterProviderCache()
|
||||||
}
|
}
|
||||||
autoUpdater.allowPrerelease = track !== 'stable'
|
autoUpdater.allowPrerelease = track !== 'stable'
|
||||||
// 只要用户当前选择的目标通道与当前安装版本所属通道不同,就允许跨通道更新(含降级)
|
// 只要用户当前选择的目标通道与当前安装版本所属通道不同,就允许跨通道更新(含降级)
|
||||||
autoUpdater.allowDowngrade = track !== currentTrack
|
autoUpdater.allowDowngrade = track !== currentTrack
|
||||||
// 统一走 generic feed,确保 preview/dev 命中各自固定发布页,不受 GitHub provider 的 prerelease 选择影响。
|
|
||||||
autoUpdater.setFeedURL({
|
|
||||||
provider: 'generic',
|
|
||||||
url: nextFeedUrl,
|
|
||||||
channel: nextUpdaterChannel
|
|
||||||
})
|
|
||||||
autoUpdater.channel = nextUpdaterChannel
|
autoUpdater.channel = nextUpdaterChannel
|
||||||
lastAppliedUpdaterChannel = nextUpdaterChannel
|
lastAppliedUpdaterChannel = nextUpdaterChannel
|
||||||
lastAppliedUpdaterFeedUrl = nextFeedUrl
|
console.log(`[Update](${reason}) 当前版本 ${appVersion},当前轨道: ${currentTrack},渠道偏好: ${track},更新通道: ${autoUpdater.channel},allowDowngrade=${autoUpdater.allowDowngrade}`)
|
||||||
console.log(`[Update](${reason}) 当前版本 ${appVersion},当前轨道: ${currentTrack},渠道偏好: ${track},更新通道: ${autoUpdater.channel},feed=${nextFeedUrl},allowDowngrade=${autoUpdater.allowDowngrade}`)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
applyAutoUpdateChannel('startup')
|
applyAutoUpdateChannel('startup')
|
||||||
|
|||||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -44,7 +44,7 @@
|
|||||||
"sharp": "^0.34.5",
|
"sharp": "^0.34.5",
|
||||||
"typescript": "^6.0.2",
|
"typescript": "^6.0.2",
|
||||||
"vite": "^7.0.0",
|
"vite": "^7.0.0",
|
||||||
"vite-plugin-electron": "^0.28.8",
|
"vite-plugin-electron": "^0.29.1",
|
||||||
"vite-plugin-electron-renderer": "^0.14.6"
|
"vite-plugin-electron-renderer": "^0.14.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -10141,9 +10141,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vite-plugin-electron": {
|
"node_modules/vite-plugin-electron": {
|
||||||
"version": "0.28.8",
|
"version": "0.29.1",
|
||||||
"resolved": "https://registry.npmjs.org/vite-plugin-electron/-/vite-plugin-electron-0.28.8.tgz",
|
"resolved": "https://registry.npmjs.org/vite-plugin-electron/-/vite-plugin-electron-0.29.1.tgz",
|
||||||
"integrity": "sha512-ir+B21oSGK9j23OEvt4EXyco9xDCaF6OGFe0V/8Zc0yL2+HMyQ6mmNQEIhXsEsZCSfIowBpwQBeHH4wVsfraeg==",
|
"integrity": "sha512-AejNed5BgHFnuw8h5puTa61C6vdP4ydbsbo/uVjH1fTdHAlCDz1+o6pDQ/scQj1udDrGvH01+vTbzQh/vMnR9w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
"sharp": "^0.34.5",
|
"sharp": "^0.34.5",
|
||||||
"typescript": "^6.0.2",
|
"typescript": "^6.0.2",
|
||||||
"vite": "^7.0.0",
|
"vite": "^7.0.0",
|
||||||
"vite-plugin-electron": "^0.28.8",
|
"vite-plugin-electron": "^0.29.1",
|
||||||
"vite-plugin-electron-renderer": "^0.14.6"
|
"vite-plugin-electron-renderer": "^0.14.6"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
|
|||||||
10
src/App.tsx
10
src/App.tsx
@@ -591,13 +591,9 @@ function App() {
|
|||||||
<div className="agreement-notice">
|
<div className="agreement-notice">
|
||||||
<strong>这是免费软件,如果你是付费购买的话请骂死那个骗子。</strong>
|
<strong>这是免费软件,如果你是付费购买的话请骂死那个骗子。</strong>
|
||||||
<span className="agreement-notice-link">
|
<span className="agreement-notice-link">
|
||||||
官方网站:
|
我们唯一的官方网站:
|
||||||
<a href="https://weflow.top" target="_blank" rel="noreferrer">
|
|
||||||
https://weflow.top
|
|
||||||
</a>
|
|
||||||
·
|
|
||||||
<a href="https://github.com/hicccc77/WeFlow" target="_blank" rel="noreferrer">
|
<a href="https://github.com/hicccc77/WeFlow" target="_blank" rel="noreferrer">
|
||||||
GitHub 仓库
|
https://github.com/hicccc77/WeFlow
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -612,7 +608,7 @@ function App() {
|
|||||||
<p>因使用本软件产生的任何直接或间接损失,开发者不承担任何责任。请确保你的使用行为符合当地法律法规。</p>
|
<p>因使用本软件产生的任何直接或间接损失,开发者不承担任何责任。请确保你的使用行为符合当地法律法规。</p>
|
||||||
|
|
||||||
<h4>4. 隐私保护</h4>
|
<h4>4. 隐私保护</h4>
|
||||||
<p>本软件不收集任何用户隐私数据。软件更新检测仅获取版本信息,不涉及任何个人隐私。</p>
|
<p>本软件不收集任何用户数据。软件更新检测仅获取版本信息,不涉及任何个人隐私。</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="agreement-footer">
|
<div className="agreement-footer">
|
||||||
|
|||||||
@@ -2508,9 +2508,7 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
|||||||
<div className="about-footer">
|
<div className="about-footer">
|
||||||
<p className="about-desc">微信聊天记录分析工具</p>
|
<p className="about-desc">微信聊天记录分析工具</p>
|
||||||
<div className="about-links">
|
<div className="about-links">
|
||||||
<a href="#" onClick={(e) => { e.preventDefault(); window.electronAPI.shell.openExternal('https://weflow.top') }}>官网</a>
|
<a href="#" onClick={(e) => { e.preventDefault(); window.electronAPI.shell.openExternal('https://github.com/hicccc77/WeFlow') }}>官网</a>
|
||||||
<span>·</span>
|
|
||||||
<a href="#" onClick={(e) => { e.preventDefault(); window.electronAPI.shell.openExternal('https://github.com/hicccc77/WeFlow') }}>GitHub 仓库</a>
|
|
||||||
<span>·</span>
|
<span>·</span>
|
||||||
<a href="#" onClick={(e) => { e.preventDefault(); window.electronAPI.shell.openExternal('https://chatlab.fun') }}>ChatLab</a>
|
<a href="#" onClick={(e) => { e.preventDefault(); window.electronAPI.shell.openExternal('https://chatlab.fun') }}>ChatLab</a>
|
||||||
<span>·</span>
|
<span>·</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user