增加更新角色信息 API

This commit is contained in:
RockYang
2023-03-31 18:34:16 +08:00
parent 9d377fa131
commit a4469b23df
4 changed files with 36 additions and 35 deletions

View File

@@ -98,7 +98,8 @@ func (s *Server) Run(webRoot embed.FS, path string, debug bool) {
engine.POST("api/config/apikey/add", s.AddApiKeyHandle)
engine.POST("api/config/apikey/remove", s.RemoveApiKeyHandle)
engine.POST("api/config/apikey/list", s.ListApiKeysHandle)
engine.POST("api/config/role/set", s.UpdateChatRoleHandle)
engine.POST("api/config/role/set", s.SetChatRoleHandle)
engine.POST("api/config/role/get", s.GetChatRoleHandle)
engine.POST("api/config/proxy/add", s.AddProxyHandle)
engine.POST("api/config/proxy/remove", s.RemoveProxyHandle)
engine.POST("api/config/debug", s.SetDebugHandle)
@@ -270,7 +271,7 @@ func (s *Server) LoginHandle(c *gin.Context) {
c.JSON(http.StatusOK, types.BizVo{Code: types.Failed, Message: types.ErrorMsg})
return
}
if !utils.Containuser(GetUsers(), data.Token) {
if !utils.ContainUser(GetUsers(), data.Token) {
c.JSON(http.StatusOK, types.BizVo{Code: types.Failed, Message: "Invalid user"})
return
}