refactor: move GetServerHost to bizpkg/env package (#2258)
This commit is contained in:
@ -26,7 +26,7 @@ import (
|
||||
"github.com/coze-dev/coze-studio/backend/application/plugin"
|
||||
"github.com/coze-dev/coze-studio/backend/application/singleagent"
|
||||
"github.com/coze-dev/coze-studio/backend/application/upload"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/plugin/conf"
|
||||
"github.com/coze-dev/coze-studio/backend/bizpkg/env"
|
||||
|
||||
"github.com/cloudwego/hertz/pkg/app"
|
||||
"github.com/cloudwego/hertz/pkg/protocol/consts"
|
||||
@ -60,11 +60,9 @@ func OauthAuthorizationCode(ctx context.Context, c *app.RequestContext) {
|
||||
return
|
||||
}
|
||||
|
||||
redirectURL := fmt.Sprintf("%s/information/auth/success", conf.GetServerHost())
|
||||
redirectURL := fmt.Sprintf("%s/information/auth/success", env.GetServerHost())
|
||||
c.Redirect(consts.StatusFound, []byte(redirectURL))
|
||||
c.Abort()
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadFileOpen .
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package conf
|
||||
package env
|
||||
|
||||
import (
|
||||
"os"
|
||||
@ -28,9 +28,9 @@ import (
|
||||
"golang.org/x/oauth2"
|
||||
|
||||
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop/common"
|
||||
"github.com/coze-dev/coze-studio/backend/bizpkg/env"
|
||||
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/consts"
|
||||
"github.com/coze-dev/coze-studio/backend/crossdomain/contract/plugin/model"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/plugin/conf"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/plugin/dto"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/plugin/encrypt"
|
||||
"github.com/coze-dev/coze-studio/backend/domain/plugin/entity"
|
||||
@ -475,7 +475,7 @@ func getStanderOAuthConfig(config *model.OAuthAuthorizationCodeConfig) *oauth2.C
|
||||
TokenURL: config.AuthorizationURL,
|
||||
AuthURL: config.ClientURL,
|
||||
},
|
||||
RedirectURL: fmt.Sprintf("%s/api/oauth/authorization_code", conf.GetServerHost()),
|
||||
RedirectURL: fmt.Sprintf("%s/api/oauth/authorization_code", env.GetServerHost()),
|
||||
Scopes: strings.Split(config.Scope, " "),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user