| | |
| | | tokenM["username"] = loginedM["username"] |
| | | tokenM["permissions"] = loginedM["permissions"] |
| | | tokenStr := (*authDriver).Login(c.Request, c.Writer, tokenM) |
| | | |
| | | |
| | | userId := loginedM["id"].(string) |
| | | auth.RemoveOutUser(userId) |
| | | |
| | | c.JSON(200,map[string]interface{}{ |
| | | "userInfo":loginedM, |
| | | "access_token":tokenStr, |
| | |
| | | } |
| | | } |
| | | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 获取当前用户信息 |
| | | // @Description 获取当前用户信息 |
| | | // @Accept json |
| | |
| | | c.JSON(http.StatusOK,"退出成功") |
| | | } |
| | | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 查找所有用户 |
| | | // @Description 查找所有用户 |
| | | // @Accept json |
| | |
| | | MenuIds []string `json:"menuIds"` |
| | | } |
| | | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 编辑此用户,返回此用户的权限菜单 |
| | | // @Description 编辑此用户,返回此用户的权限菜单 |
| | | // @Accept json |
| | |
| | | } |
| | | } |
| | | |
| | | // @Security ApiKeyAuth |
| | | // @Summary 更新用户名,密码和菜单权限 |
| | | // @Description 更新用户名,密码和菜单权限 |
| | | // @Accept json |
| | |
| | | var api dbapi.UserApi |
| | | b, d := api.SaveAuth(paramBody) |
| | | if b { |
| | | auth.SetOutUser(userEditVo.Id) |
| | | util.ResponseFormat(c,code.UpdateSuccess,d) |
| | | } else { |
| | | util.ResponseFormat(c,code.UpdateFail,"保存失败") |