Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsomebodywashere <68244480+somebodywashere@users.noreply.github.com>2024-04-05 12:24:18 +0300
committersomebodywashere <68244480+somebodywashere@users.noreply.github.com>2024-04-05 12:24:18 +0300
commit7118d92980ebb60ea65e30008d6a4be9423d414a (patch)
treea5e8039e785bd58d86463291f87b31652e429577 /web/service
parent59708d6410a821a2518784c47f8523587fa29e06 (diff)
Convert string tgId to int64 on Migrate
Diffstat (limited to 'web/service')
-rw-r--r--web/service/inbound.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/web/service/inbound.go b/web/service/inbound.go
index adfa0fb4..95962041 100644
--- a/web/service/inbound.go
+++ b/web/service/inbound.go
@@ -3,6 +3,7 @@ package service
import (
"encoding/json"
"fmt"
+ "strconv"
"strings"
"time"
@@ -1838,6 +1839,17 @@ func (s *InboundService) MigrationRequirements() {
c["email"] = ""
}
+ // Convert string tgId to int64
+ if _, ok := c["tgId"]; ok {
+ var tgId interface{} = c["tgId"]
+ if tgIdStr, ok2 := tgId.(string); ok2 {
+ tgIdInt64, err := strconv.ParseInt(strings.ReplaceAll(tgIdStr, " ", ""), 10, 64)
+ if err == nil {
+ c["tgId"] = tgIdInt64
+ }
+ }
+ }
+
// Remove "flow": "xtls-rprx-direct"
if _, ok := c["flow"]; ok {
if c["flow"] == "xtls-rprx-direct" {