diff --git a/dsSupport/MyModel/AccessSystem/AccessSystemDao/AccessSystemDao.go b/dsSupport/MyModel/AccessSystem/AccessSystemDao/AccessSystemDao.go index cf0fc7d6..e4997ecc 100644 --- a/dsSupport/MyModel/AccessSystem/AccessSystemDao/AccessSystemDao.go +++ b/dsSupport/MyModel/AccessSystem/AccessSystemDao/AccessSystemDao.go @@ -112,6 +112,38 @@ func UpdateSso(appId string, redirectUri string, logoutUri string) error { return err } +/** +功能:修改接入系统的状态,1:正常,-1:被禁用 +*/ +func changeAppStatus(appId string, bUse int32) error { + //1、修改数据库 + model := new(models.TAppBase) + model.BUse = bUse + _, err := db.ID(appId).Update(model) + if err != nil { + return err + } + //2、获取数据库中的完整数据 + _, err = db.Where("app_id = ?", appId).Get(&model) + if err != nil { + return err + } + + //3、清除主键Redis缓存 + var selector = SqlKit.GetBean("t_app_base") + SqlKit.DeleteCacheByIds([]string{appId}, selector) + + //4、删除SSO中的缓存数据 + if bUse <= 0 { + //删除REDIS缓存 + _ = deleteRedisCache(model.AccessKey) + } else { + //插入REDIS缓存 + _ = insertRedisCache(model.AccessKey, model.SecretKey, model.RedirectUri) + } + return nil +} + /** 功能:清空统一认证信息 */