-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 新增了管理员权限运行的功能,以确保应用在Windows上作为管理员启动,提升应用的安全性和稳定性。 - 修复了天气数据获取逻辑,改进了高德地图天气接口的调用方式,提高了天气数据获取的效率和准确性。 - 优化了时间同步逻辑,集成了NTP时间同步功能,确保系统时间的准确性,这对于需要高时间精度的应用场景尤为重要。 - 增加了版本号自动生成逻辑,让用户随时了解应用的当前版本,提升了用户体验。 - 在设置界面增加了同步时间的按钮,方便用户手动同步系统时间,增强了易用性。 - 修复了设置界面的视频音量调节范围,从0.1精确到0.01,提升了用户调节音量的灵活性。 本次更新涉及了主功能窗口的启动逻辑、时间同步、天气数据获取、版本管理以及用户界面的多个方面,旨在提升应用的综合性能和用户体验。
- Loading branch information
Showing
12 changed files
with
470 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"major": 1, | ||
"minor": 0, | ||
"patch": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const { execSync } = require('child_process'); | ||
|
||
function getCommitHash() { | ||
try { | ||
return execSync('git rev-parse --short HEAD').toString().trim(); | ||
} catch (error) { | ||
console.error('无法获取 Git 提交号', error); | ||
return 'unknown'; | ||
} | ||
} | ||
|
||
function getCurrentTime() { | ||
const now = new Date(); | ||
const year = String(now.getFullYear()).slice(-2); | ||
const month = String(now.getMonth() + 1).padStart(2, '0'); | ||
const day = String(now.getDate()).padStart(2, '0'); | ||
const hours = String(now.getHours()).padStart(2, '0'); | ||
const minutes = String(now.getMinutes()).padStart(2, '0'); | ||
return `${year}${month}${day}_${hours}${minutes}`; | ||
} | ||
|
||
function generateVersion() { | ||
const versionConfigPath = path.join(__dirname, 'versionConfig.json'); | ||
if (!fs.existsSync(versionConfigPath)) { | ||
console.error('versionConfig.json 文件不存在'); | ||
return null; | ||
} | ||
|
||
const versionConfig = JSON.parse(fs.readFileSync(versionConfigPath, 'utf-8')); | ||
const { major, minor, patch } = versionConfig; | ||
const commitHash = getCommitHash(); | ||
const timestamp = getCurrentTime(); | ||
|
||
return `build.${major}.${minor}.${patch}_${timestamp}_${commitHash}`; | ||
} | ||
|
||
module.exports = { generateVersion }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.