|
|
|
@ -27,6 +27,9 @@ func Routers(r *gin.RouterGroup) {
|
|
|
|
|
rr.GET("/RemoveCookie", RemoveCookie)
|
|
|
|
|
rr.POST("/UpdateLoginPassWordInfo", UpdateLoginPassWordInfo)
|
|
|
|
|
|
|
|
|
|
rr.GET("/GetBindAuthorizationInfo", GetBindAuthorizationInfo)
|
|
|
|
|
rr.POST("/UnbindAuthorizationInfo", UnbindAuthorizationInfo)
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -439,3 +442,69 @@ func UpdateLoginPassWordInfo(c *gin.Context) {
|
|
|
|
|
Message: r.Message,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Summary 获取已绑定的第三方授权
|
|
|
|
|
// @Description 获取已绑定的第三方授权
|
|
|
|
|
// @Tags 登录信息
|
|
|
|
|
// @Accept application/x-www-form-urlencoded
|
|
|
|
|
// @Produce json
|
|
|
|
|
// @Success 200 {object} Model.Res
|
|
|
|
|
// @Router /base/loginperson/GetBindAuthorizationInfo [get]
|
|
|
|
|
// @X-Sort [12]
|
|
|
|
|
func GetBindAuthorizationInfo(c *gin.Context) {
|
|
|
|
|
personId, err := c.Cookie("person_id")
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: "未获取到Cookie中的人员编码!",
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
r, err := SysLoginpersonService.GetBindAuthorizationInfo(personId)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: "调用RPC服务失败!",
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: r.Success,
|
|
|
|
|
Message: r.Message,
|
|
|
|
|
List: CommonUtil.ConvertStringArrayToArray(r.List),
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Summary 解除绑定第三方授权
|
|
|
|
|
// @Description 解除绑定第三方授权
|
|
|
|
|
// @Tags 登录信息
|
|
|
|
|
// @Accept application/x-www-form-urlencoded
|
|
|
|
|
// @Produce json
|
|
|
|
|
// @Param typeName formData string true "第三方授权类型名 qq:QQ wx:微信"
|
|
|
|
|
// @Success 200 {object} Model.Res
|
|
|
|
|
// @Router /base/loginperson/UnbindAuthorizationInfo [post]
|
|
|
|
|
// @X-Sort [13]
|
|
|
|
|
func UnbindAuthorizationInfo(c *gin.Context) {
|
|
|
|
|
typeName := c.PostForm("typeName")
|
|
|
|
|
|
|
|
|
|
personId, err := c.Cookie("person_id")
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: "未获取到Cookie中的人员编码!",
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
r, err := SysLoginpersonService.UnbindAuthorizationInfo(personId, typeName)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: "调用RPC服务失败!",
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: r.Success,
|
|
|
|
|
Message: r.Message,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|