Skip to content

Commit

Permalink
修复:版本号对比检测异常问题修复
Browse files Browse the repository at this point in the history
  • Loading branch information
modstart committed Jan 7, 2025
1 parent ff5debd commit b1b4036
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- 优化:系统未捕获异常日志记录
- 优化:工单提交日志收集完善更多信息,方便排查问题
- 修复:windows下路径编码问题
- 修复:版本号对比检测异常问题修复

## v0.3.0

Expand Down
31 changes: 19 additions & 12 deletions electron/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,19 +328,26 @@ export const VersionUtil = {
if (match === '*') {
return true
}
if (match.startsWith('>=') && this.ge(v, match.substring(2))) {
return true
}
if (match.startsWith('>') && this.gt(v, match.substring(1))) {
return true
}
if (match.startsWith('<=') && this.le(v, match.substring(2))) {
return true
}
if (match.startsWith('<') && this.lt(v, match.substring(1))) {
return true
if (match.startsWith('>=')) {
if (this.ge(v, match.substring(2))) {
return true
}
} else if (match.startsWith('<=')) {
if (this.le(v, match.substring(2))) {
return true
}
} else if (match.startsWith('>')) {
if (this.gt(v, match.substring(1))) {
return true
}
} else if (match.startsWith('<')) {
if (this.lt(v, match.substring(1))) {
return true
}
} else {
return this.eq(v, match)
}
return this.eq(v, match)
return false
},
compare(v1: string, v2: string) {
const v1Arr = v1.split('.')
Expand Down

0 comments on commit b1b4036

Please sign in to comment.