更新2.1.2版本,优化部门、角色权限,增加上下级关系;增加登录、系统、短信日志;优化省市区编码

This commit is contained in:
孟帅
2023-01-25 11:49:21 +08:00
parent 11fad0132d
commit 93e0fe7250
190 changed files with 35896 additions and 7208 deletions

View File

@@ -144,6 +144,11 @@ func GetPublicIP(ctx context.Context) (ip string, err error) {
g.Log().Warningf(ctx, "GetPublicIP alternatives are being tried err:%+v", err)
return GetPublicIP2()
}
if data == nil {
g.Log().Warningf(ctx, "publicIP address Parsing failure, check the network and firewall blocking.")
return "0.0.0.0", nil
}
return data.Ip, nil
}
@@ -190,5 +195,10 @@ func GetClientIp(r *ghttp.Request) string {
if ip == "" {
ip = r.GetClientIp()
}
// 如果存在多个,默认取第一个
if gstr.Contains(ip, ",") {
ip = gstr.TrimStr(ip, ",", -1)
}
return ip
}