master
wubin 5 years ago
parent 296aaf8057
commit 5242f0ee0c

@ -27,6 +27,8 @@ func Routers(r *gin.RouterGroup) {
rr.GET("/RemoveCookie", RemoveCookie)
rr.POST("/UpdateLoginPassWordInfo", UpdateLoginPassWordInfo)
rr.GET("/GetBindAuthorizationInfo", GetBindAuthorizationInfo)
return
}
@ -439,3 +441,36 @@ 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.ConvertJsonStringToMapArray(r.List),
})
}

@ -53,3 +53,8 @@ func UpdateLoginPassWordInfo(personId string, identityId int32, oldPassWord stri
Reply, err := UpdateLoginPassWord(SysLoginpersonProto.UpdateLoginPassWordArg{PersonId: personId, IdentityId: identityId, OldPassWord: oldPassWord, NewPassWord: newPassWord, ActionPersonId: actionPersonId, ActionIpAddress: actionIpAddress})
return Reply, err
}
func GetBindAuthorizationInfo(personId string) (*SysLoginpersonProto.Reply, error) {
Reply, err := GetBindAuthorization(SysLoginpersonProto.GetBindAuthorizationArg{PersonId: personId})
return Reply, err
}

@ -183,5 +183,26 @@ func UpdateLoginPassWord(updateLoginPassWordArg SysLoginpersonProto.UpdateLoginP
LogUtil.Error("修改登录密码错误: ", err.Error())
}
return Reply, err
}
/**
2020-09-09 11:30:20
*/
func GetBindAuthorization(arg SysLoginpersonProto.GetBindAuthorizationArg) (*SysLoginpersonProto.Reply, error) {
//1、准备动作连接服务器
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := SysLoginpersonProto.NewSysLoginpersonManageClient(conn)
Reply, err := c.GetBindAuthorization(ctx, &arg)
if err != nil {
LogUtil.Error("获取已绑定的第三方授权错误: ", err.Error())
}
return Reply, err
}

Loading…
Cancel
Save