From 4eae625b82d2360687cd2832b1da87f022a18ab4 Mon Sep 17 00:00:00 2001 From: huanghai <10402852@qq.com> Date: Mon, 24 Aug 2020 16:57:32 +0800 Subject: [PATCH] 'commit' --- .../ControllerOauth2/ControllerOauth2.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/dsSso/Controller/ControllerOauth2/ControllerOauth2.go b/dsSso/Controller/ControllerOauth2/ControllerOauth2.go index aad411f0..3b466cd4 100644 --- a/dsSso/Controller/ControllerOauth2/ControllerOauth2.go +++ b/dsSso/Controller/ControllerOauth2/ControllerOauth2.go @@ -791,13 +791,20 @@ func DelClient(context *gin.Context) { return } accessKey := context.PostForm("access_key") - RedisStorage.OAuth2RedisStorage.DeleteClient( + err := RedisStorage.OAuth2RedisStorage.DeleteClient( &osin.DefaultClient{ Id: accessKey, }, ) - context.JSON(http.StatusOK, Model.Res{ - Code: http.StatusOK, - Msg: "删除成功!", - }) + if err != nil { + context.JSON(http.StatusOK, Model.Res{ + Code: http.StatusOK, + Msg: "删除失败!" + err.Error(), + }) + } else { + context.JSON(http.StatusOK, Model.Res{ + Code: http.StatusOK, + Msg: "删除成功!", + }) + } }