|
|
|
@ -5,6 +5,7 @@ import (
|
|
|
|
|
"dsSso/Const/DefaultConst"
|
|
|
|
|
"dsSso/Controller/ControllerRecaptcha"
|
|
|
|
|
"dsSso/Dao/DaoBaseGlobal"
|
|
|
|
|
"dsSso/Dao/DaoSysLoginPerson"
|
|
|
|
|
"dsSso/Model"
|
|
|
|
|
"dsSso/Service/ServiceJoinApp"
|
|
|
|
|
"dsSso/Service/ServiceLoginPerson"
|
|
|
|
@ -268,11 +269,19 @@ func accessToken(context *gin.Context) {
|
|
|
|
|
k := ConfigUtil.OAuth2RedisKeyPrefix + ":refresh_token_vs_person:" + refreshToken
|
|
|
|
|
RedisUtil.SET(k, personStr, time.Hour*24*30) //30天的有效期
|
|
|
|
|
|
|
|
|
|
personName, err := DaoSysLoginPerson.GetPersonName(identityId, personId)
|
|
|
|
|
if err != nil {
|
|
|
|
|
context.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Code: http.StatusNotImplemented,
|
|
|
|
|
Msg: "获取人员姓名信息失败!",
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
//返回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, "code": 200})
|
|
|
|
|
"token_type": tokenType, "identity_id": identityIdInt, "person_id": personId, "person_name": personName, "code": 200})
|
|
|
|
|
return
|
|
|
|
|
} else {
|
|
|
|
|
//刷新token
|
|
|
|
|