исправил работу с SecretWebPath

This commit is contained in:
Дмитрий Саенко 2025-10-22 14:21:22 +03:00
parent 0faf959c49
commit 971513464e
2 changed files with 9 additions and 2 deletions

View file

@ -38,6 +38,7 @@
<th>Name</th>
<th>Address</th>
<th>Port</th>
<th>Status</th>
<th>Enabled</th>
<th>Actions</th>
</tr>
@ -212,7 +213,13 @@
if (this.modal.server.id) {
url = `/panel/api/servers/update/${this.modal.server.id}`;
}
let secretWebPath = this.modal.server.secretWebPath;
if (!secretWebPath.startsWith('/')) {
secretWebPath = '/' + secretWebPath.slice(1);
}
if (!secretWebPath.endsWith('/')) {
secretWebPath = secretWebPath.slice(0, -1) + '/';
}
console.log(this.modal.server);
axios
.post(url, this.modal.server)

View file

@ -2411,7 +2411,7 @@ func (s *InboundService) syncWithSlaves(method string, path string, contentType
continue
}
urlStr := fmt.Sprintf("http://%s:%d%s", server.Address, server.Port, path)
urlStr := fmt.Sprintf("http://%s:%d/%s%s", server.Address, server.Port, server.SecretWebPath, path)
if len(params) > 0 {
urlStr = fmt.Sprintf("%s/%s", urlStr, strings.Join(params, "/"))