```
feat(config): 添加服务器端口获取功能 添加GetPort方法用于获取服务器当前IP和端口信息, 新增Name和Owner字段到ServerList模型中 refactor(login): 优化调试参数处理 将命令行参数解析改为使用parser.GetOpt获取debug选项, 移除未使用的fmt和qqwry导入包 refactor(main): 清理示例代码 移除main.go中的
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
v1 "blazing/modules/base/api/v1"
|
||||
"blazing/modules/base/service"
|
||||
config "blazing/modules/config/service"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
@@ -80,3 +81,16 @@ func (c *BaseOpen) RefreshToken(ctx context.Context, req *RefreshTokenReq) (res
|
||||
res = cool.Ok(data)
|
||||
return
|
||||
}
|
||||
|
||||
// 获取服务器当前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()
|
||||
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ func (s *BaseSysLogService) Record(ctx g.Ctx) {
|
||||
baseSysLog.UserID = admin.UserId
|
||||
baseSysLog.Action = r.Method + ":" + r.URL.Path
|
||||
baseSysLog.IP = r.GetClientIp()
|
||||
|
||||
// 从内存或缓存查询IP
|
||||
location, err := qqwry.QueryIP(baseSysLog.IP)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user