zhangzengfei
2019-10-31 2bd2068c999cda5bda8c0787ed0dcaac6cb7afdb
controllers/user.go
@@ -47,6 +47,11 @@
      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,
@@ -60,6 +65,7 @@
   }
}
// @Security ApiKeyAuth
// @Summary 获取当前用户信息
// @Description 获取当前用户信息
// @Accept json
@@ -87,6 +93,7 @@
   c.JSON(http.StatusOK,"退出成功")
}
// @Security ApiKeyAuth
// @Summary 查找所有用户
// @Description 查找所有用户
// @Accept json
@@ -117,6 +124,7 @@
   MenuIds []string `json:"menuIds"`
}
// @Security ApiKeyAuth
// @Summary 编辑此用户,返回此用户的权限菜单
// @Description 编辑此用户,返回此用户的权限菜单
// @Accept json
@@ -141,6 +149,7 @@
   }
}
// @Security ApiKeyAuth
// @Summary 更新用户名,密码和菜单权限
// @Description 更新用户名,密码和菜单权限
// @Accept json
@@ -161,6 +170,7 @@
   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,"保存失败")