This commit is contained in:
1
2026-01-23 20:34:52 +00:00
parent 9199768c37
commit 5682ff2d42
5 changed files with 37 additions and 26 deletions

View File

@@ -7,7 +7,6 @@ import (
v1 "blazing/modules/base/api/v1"
"blazing/modules/base/service"
config "blazing/modules/config/service"
"github.com/gogf/gf/v2/frame/g"
)
@@ -82,15 +81,15 @@ func (c *BaseOpen) RefreshToken(ctx context.Context, req *RefreshTokenReq) (res
return
}
// 获取服务器当前ip和端口
type GetPortReq struct {
g.Meta `path:"/getport" method:"GET"`
}
// // 获取服务器当前ip和端口
// type GetPortReq struct {
// g.Meta `path:"/getport" method:"GET"`
// }
func (c *BaseOpen) GetPort(ctx context.Context, req *GetPortReq) (res *cool.BaseRes, err error) {
res = &cool.BaseRes{}
res.Data = config.NewServerService().GetPort()
// func (c *BaseOpen) GetPort(ctx context.Context, req *GetPortReq) (res *cool.BaseRes, err error) {
// res = &cool.BaseRes{}
// res.Data = config.NewServerService().GetPort()
return
// return
}
// }

View File

@@ -7,8 +7,10 @@ import (
"blazing/modules/base/service"
config "blazing/modules/config/service"
blazing "blazing/modules/player/service"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
)
@@ -68,13 +70,13 @@ func (c *BaseSysUserController) GetSession(ctx context.Context, req *SessionReq)
} else {
res.LoginAddr = cool.Config.File.Domain + ":" + cool.Config.LoginPort
}
res.Server = config.NewServerService().GetPort()
return
}
type SessionRes struct {
UserID int `json:"userid"`
Session string `json:"session"`
LoginAddr string `json:"loginaddr"`
//Server model.ServerList `json:"server"`
UserID int `json:"userid"`
Session string `json:"session"`
LoginAddr string `json:"loginaddr"`
Server gdb.List `json:"server"`
}