Refactor variable of front end (#13953)

### What problem does this PR solve?

api_host -> webAPI
ExternalApi -> restAPIv1

### Type of change

- [x] Refactoring


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Refactor**
* Updated internal API endpoint configuration to use consolidated base
URL constants for improved maintainability and consistency across the
application.

* **Chores**
* Updated server-side protocol validation for admin connectivity checks.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-04-07 15:08:11 +08:00
committed by GitHub
parent 38acf34724
commit 393efa9b7c
7 changed files with 251 additions and 263 deletions

View File

@@ -53,10 +53,10 @@ func (c *RAGFlowClient) LoginUserInteractive(username, password string) error {
return fmt.Errorf("server is down")
}
// Check response - admin returns JSON with message "PONG", user returns plain "pong"
// Check response - admin returns JSON with message "pong", user returns plain "pong"
resJSON, err := resp.JSON()
if err == nil {
// Admin mode returns {"code":0,"message":"PONG"}
// Admin mode returns {"code":0,"message":"pong"}
if msg, ok := resJSON["message"].(string); !ok || msg != "pong" {
fmt.Println("Server is down")
return fmt.Errorf("server is down")
@@ -120,10 +120,10 @@ func (c *RAGFlowClient) LoginUser(cmd *Command) error {
return fmt.Errorf("server is down")
}
// Check response - admin returns JSON with message "PONG", user returns plain "pong"
// Check response - admin returns JSON with message "pong", user returns plain "pong"
resJSON, err := resp.JSON()
if err == nil {
// Admin mode returns {"code":0,"message":"PONG"}
// Admin mode returns {"code":0,"message":"pong"}
if msg, ok := resJSON["message"].(string); !ok || msg != "pong" {
fmt.Println("Server is down")
return fmt.Errorf("server is down")