mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-20 05:52:24 +00:00
Convert string tgId to int64 on Migrate
This commit is contained in:
parent
59708d6410
commit
7118d92980
1 changed files with 12 additions and 0 deletions
|
@ -3,6 +3,7 @@ package service
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -1838,6 +1839,17 @@ func (s *InboundService) MigrationRequirements() {
|
||||||
c["email"] = ""
|
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"
|
// Remove "flow": "xtls-rprx-direct"
|
||||||
if _, ok := c["flow"]; ok {
|
if _, ok := c["flow"]; ok {
|
||||||
if c["flow"] == "xtls-rprx-direct" {
|
if c["flow"] == "xtls-rprx-direct" {
|
||||||
|
|
Loading…
Reference in a new issue