mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-31 13:03:49 +08:00
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user