mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-04 05:00:25 +08:00
优化安全设置中“自定义客户端IP报头”中默认报头交互
This commit is contained in:
@@ -61,7 +61,7 @@
|
|||||||
<td>自定义客户端IP报头</td>
|
<td>自定义客户端IP报头</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="clientIPHeaderNames" v-model="config.clientIPHeaderNames"/>
|
<input type="text" name="clientIPHeaderNames" v-model="config.clientIPHeaderNames"/>
|
||||||
<p class="comment">可以通过此报头获取客户端IP,类似于<code-label>X-Forwarded-For</code-label>、<code-label>Client-IP</code-label>,用于使用反向代理访问管理系统的情形;如果有多个报头可以使用空格隔开。</p>
|
<p class="comment">可以通过此报头获取客户端IP,类似于<code-label>X-Forwarded-For X-Real-IP Client-IP</code-label> <a href=""><span class="small" @click.prevent="addDefaultClientIPHeaderNames('X-Forwarded-For X-Real-IP Client-IP')">[填入]</span></a>,用于使用反向代理访问管理系统的情形;如果有多个报头可以使用空格隔开。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
Tea.context(function () {
|
Tea.context(function () {
|
||||||
this.success = NotifyReloadSuccess("保存成功")
|
this.success = NotifyReloadSuccess("保存成功")
|
||||||
|
|
||||||
|
this.addDefaultClientIPHeaderNames = function (headerNames) {
|
||||||
|
if (this.config.clientIPHeaderNames == null || this.config.clientIPHeaderNames.length == 0) {
|
||||||
|
this.config.clientIPHeaderNames = headerNames
|
||||||
|
} else {
|
||||||
|
this.config.clientIPHeaderNames += " " + headerNames
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
Reference in New Issue
Block a user