diff --git a/controller/oauth.go b/controller/oauth.go index 818a28f8..9951f22b 100644 --- a/controller/oauth.go +++ b/controller/oauth.go @@ -190,7 +190,9 @@ func handleOAuthBind(c *gin.Context, provider oauth.Provider) { } } - common.ApiSuccessI18n(c, i18n.MsgOAuthBindSuccess, nil) + common.ApiSuccessI18n(c, i18n.MsgOAuthBindSuccess, gin.H{ + "action": "bind", + }) } // findOrCreateOAuthUser finds existing user or creates new user diff --git a/web/src/components/auth/OAuth2Callback.jsx b/web/src/components/auth/OAuth2Callback.jsx index c0c6418a..55a85c6b 100644 --- a/web/src/components/auth/OAuth2Callback.jsx +++ b/web/src/components/auth/OAuth2Callback.jsx @@ -56,7 +56,7 @@ const OAuth2Callback = (props) => { return; } - if (message === 'bind') { + if (data?.action === 'bind') { showSuccess(t('绑定成功!')); navigate('/console/personal'); } else {