fix: 修复NeedsRefresh bug导致刷新失败的问题

This commit is contained in:
shaw
2025-12-28 11:22:01 +08:00
parent d3e73f1260
commit cd9d31f5f2
5 changed files with 22 additions and 18 deletions

View File

@@ -1,6 +1,7 @@
package service
import (
"encoding/json"
"strconv"
"time"
)
@@ -94,6 +95,9 @@ func (a *Account) GetCredential(key string) string {
switch val := v.(type) {
case string:
return val
case json.Number:
// GORM datatypes.JSONMap 使用 UseNumber() 解析,数字类型为 json.Number
return val.String()
case float64:
// JSON 解析后数字默认为 float64
return strconv.FormatInt(int64(val), 10)