mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-08 19:40:24 +08:00
创建Web配置时自动设置访客IP获取方式为“直接获取”
This commit is contained in:
@@ -550,7 +550,20 @@ func (this *HTTPWebDAO) CreateWeb(tx *dbs.Tx, adminId int64, userId int64, rootJ
|
|||||||
if len(rootJSON) > 0 {
|
if len(rootJSON) > 0 {
|
||||||
op.Root = JSONBytes(rootJSON)
|
op.Root = JSONBytes(rootJSON)
|
||||||
}
|
}
|
||||||
err := this.Save(tx, op)
|
|
||||||
|
// 设置默认的remote-addr
|
||||||
|
// set default remote-addr config
|
||||||
|
var remoteAddrConfig = &serverconfigs.HTTPRemoteAddrConfig{
|
||||||
|
IsOn: true,
|
||||||
|
Value: "${rawRemoteAddr}",
|
||||||
|
}
|
||||||
|
remoteAddrConfigJSON, err := json.Marshal(remoteAddrConfig)
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
op.RemoteAddr = remoteAddrConfigJSON
|
||||||
|
|
||||||
|
err = this.Save(tx, op)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user