Skip to content

Commit

Permalink
🐞 fix(更新检测): 确保字符正确
Browse files Browse the repository at this point in the history
  • Loading branch information
xmdhs committed May 13, 2021
1 parent 2629347 commit b23f676
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"encoding/base64"
"encoding/json"
"errors"
"flag"
Expand Down Expand Up @@ -176,8 +177,13 @@ func check() {
log.Println(err)
return
}
b, err := base64.StdEncoding.DecodeString(version)
if err != nil {
log.Println(err)
return
}
u := up{}
err = json.Unmarshal([]byte(version), &u)
err = json.Unmarshal(b, &u)
if err != nil {
fmt.Println(lang.Lang("checkupdateerr"))
fmt.Println(err)
Expand Down

0 comments on commit b23f676

Please sign in to comment.