From 80fbcb0af4fbbfafab2ac98e9e1cdd3258793055 Mon Sep 17 00:00:00 2001 From: huanghai <10402852@qq.com> Date: Thu, 9 Jul 2020 08:08:04 +0800 Subject: [PATCH] 'commit' --- .../ControllerOauth2/ControllerOauth2.go | 13 ++---------- .../DaoSysLoginPerson/DaoSysLoginPerson.go | 15 ------------- .../ServiceLoginPerson/ServiceLoginPerson.go | 21 ------------------- 3 files changed, 2 insertions(+), 47 deletions(-) diff --git a/dsSso/Controller/ControllerOauth2/ControllerOauth2.go b/dsSso/Controller/ControllerOauth2/ControllerOauth2.go index 8658c0cd..4f28deac 100644 --- a/dsSso/Controller/ControllerOauth2/ControllerOauth2.go +++ b/dsSso/Controller/ControllerOauth2/ControllerOauth2.go @@ -81,8 +81,6 @@ func getCaptcha(c *gin.Context) { // @X-LengthLimit [{"captchaId":"20,20"}] func getCaptchaPng(c *gin.Context) { ControllerRecaptcha.ServeHTTP(c.Writer, c.Request) - var captchaId=c.Query("captchaId") - ControllerRecaptcha.Serve(c.Writer,c.Request,captchaId,400,200) } /** @@ -210,15 +208,11 @@ func accessToken(context *gin.Context) { k := ConfigUtil.OAuth2RedisKeyPrefix + ":refresh_token_vs_person:" + refreshToken RedisUtil.SET(k, personStr, time.Hour*24*30) //30天的有效期 - //扩展一下bureau_id(旧版本专用) - var bureauId =ServiceLoginPerson.GetPersonBureauById(identityId, personId) - //返回json数据 context.JSON(http.StatusOK, gin.H{ "access_token": accessToken, "expires_in": expiresIn, "refresh_token": refreshToken, - "token_type": tokenType, "identity_id": identityIdInt, "person_id": personId, "bureau_id": bureauId, - }) + "token_type": tokenType, "identity_id": identityIdInt, "person_id": personId}) return } else { //刷新token @@ -257,14 +251,11 @@ func accessToken(context *gin.Context) { personIdInt, _ := strconv.Atoi(personId) //删除旧的refresh_token RedisUtil.DEL(key) - //扩展一下bureau_id(旧版本专用) - var bureauId =ServiceLoginPerson.GetPersonBureauById(identityId, personId) //返回json数据 context.JSON(http.StatusOK, gin.H{ "access_token": accessToken, "expires_in": expiresIn, "refresh_token": refreshToken, - "token_type": tokenType, "identity_id": identityIdInt, "person_id": personIdInt, "bureau_id": bureauId, - }) + "token_type": tokenType, "identity_id": identityIdInt, "person_id": personIdInt}) return } } diff --git a/dsSso/Dao/DaoSysLoginPerson/DaoSysLoginPerson.go b/dsSso/Dao/DaoSysLoginPerson/DaoSysLoginPerson.go index fee1bbbf..f8212f48 100644 --- a/dsSso/Dao/DaoSysLoginPerson/DaoSysLoginPerson.go +++ b/dsSso/Dao/DaoSysLoginPerson/DaoSysLoginPerson.go @@ -88,18 +88,3 @@ func WriteLoginLog(identityId string, personId string, ip string, loginState int db.SQL(sql, identityId, personId, ip, list[0]["province_code"].(string), list[0]["city_code"].(string), list[0]["district_code"].(string), list[0]["bureau_id"].(string), loginState, loginName).Execute() } - -/** -功能:根据人员ID获取人员信息 -作者:黄海 -时间:2020-04-27 -*/ -func GetPersonInfoById(identityId string, personId string) map[string]interface{} { - sql := "select bureau_id from t_sys_loginperson where identity_id=? and person_id=?" - list, _ := db.SQL(sql, identityId, personId).Query().List() - if len(list) > 0 { - return list[0] - } else { - return nil - } -} diff --git a/dsSso/Service/ServiceLoginPerson/ServiceLoginPerson.go b/dsSso/Service/ServiceLoginPerson/ServiceLoginPerson.go index d658b68c..aae8450d 100644 --- a/dsSso/Service/ServiceLoginPerson/ServiceLoginPerson.go +++ b/dsSso/Service/ServiceLoginPerson/ServiceLoginPerson.go @@ -15,25 +15,4 @@ func Login(username string, password string,ip string) (bool, string, string, st return result, identityId, personId, personName } -/** -功能:根据人员ID获取人员信息 -作者:黄海 -时间:2020-04-27 -*/ -func GetPersonInfoById(identityId string, personId string) map[string]interface{} { - return DaoSysLoginPerson.GetPersonInfoById(identityId, personId) -} -/** -功能:获取单位号 -作者:黄海 -时间:2020-02-05 -*/ -func GetPersonBureauById(identityId string, personId string) string{ - var bureauId = "0" - p := DaoSysLoginPerson.GetPersonInfoById(identityId, personId) - if p != nil { - bureauId = p["bureau_id"].(string) - } - return bureauId -}