mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-01 00:05:43 +08:00
Go: fix CLI logout command (#14672)
### What problem does this PR solve? ``` RAGFlow(user)> logout; SUCCESS ``` ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -210,10 +210,10 @@ func (c *RAGFlowClient) Logout() (ResponseIf, error) {
|
||||
if c.ServerType == "admin" {
|
||||
path = "/admin/logout"
|
||||
} else {
|
||||
path = "/user/logout"
|
||||
path = "/auth/logout"
|
||||
}
|
||||
|
||||
resp, err := c.HTTPClient.Request("GET", path, "web", nil, nil)
|
||||
resp, err := c.HTTPClient.Request("POST", path, "web", nil, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -113,27 +113,6 @@ func (p *Parser) parseListCommand() (*Command, error) {
|
||||
p.nextToken() // consume LIST
|
||||
|
||||
switch p.curToken.Type {
|
||||
case TokenServices:
|
||||
p.nextToken()
|
||||
// Semicolon is optional for SHOW TOKEN
|
||||
if p.curToken.Type == TokenSemicolon {
|
||||
p.nextToken()
|
||||
}
|
||||
return NewCommand("list_services"), nil
|
||||
case TokenUsers:
|
||||
p.nextToken()
|
||||
// Semicolon is optional for SHOW TOKEN
|
||||
if p.curToken.Type == TokenSemicolon {
|
||||
p.nextToken()
|
||||
}
|
||||
return NewCommand("list_users"), nil
|
||||
case TokenRoles:
|
||||
p.nextToken()
|
||||
// Semicolon is optional for SHOW TOKEN
|
||||
if p.curToken.Type == TokenSemicolon {
|
||||
p.nextToken()
|
||||
}
|
||||
return NewCommand("list_roles"), nil
|
||||
case TokenVars:
|
||||
p.nextToken()
|
||||
// Semicolon is optional for SHOW TOKEN
|
||||
@@ -335,9 +314,9 @@ func (p *Parser) parseShowCommand() (*Command, error) {
|
||||
p.nextToken()
|
||||
}
|
||||
return NewCommand("show_current_model"), nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("expected USER or MODEL after CURRENT")
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("expected USER or MODEL after CURRENT")
|
||||
case TokenUser:
|
||||
return p.parseShowUser()
|
||||
case TokenRole:
|
||||
|
||||
Reference in New Issue
Block a user