From cb47d57ccdba6421dd3305189471c58beec7df45 Mon Sep 17 00:00:00 2001 From: icey-yu <1186114839@qq.com> Date: Wed, 12 Jun 2024 11:30:44 +0800 Subject: [PATCH] fix:err and name --- config/openim-push.yml | 2 +- internal/push/offlinepush/fcm/push.go | 10 +++++----- pkg/common/config/config.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/openim-push.yml b/config/openim-push.yml index abade180c..d09c664c5 100644 --- a/config/openim-push.yml +++ b/config/openim-push.yml @@ -24,7 +24,7 @@ geTui: channelName: '' fcm: serviceAccount: "x.json" - verifyUrl: "" + authUrl: "" jpns: appKey: '' masterSecret: '' diff --git a/internal/push/offlinepush/fcm/push.go b/internal/push/offlinepush/fcm/push.go index 22c1e0e28..4924cf5a9 100644 --- a/internal/push/offlinepush/fcm/push.go +++ b/internal/push/offlinepush/fcm/push.go @@ -52,16 +52,16 @@ func NewClient(pushConf *config.Push, cache cache.ThirdCache, fcmConfigPath stri // with file path credentialsFilePath := filepath.Join(fcmConfigPath, pushConf.FCM.ServiceAccount) opt = option.WithCredentialsFile(credentialsFilePath) - case len(pushConf.FCM.VerifyUrl) != 0: - // with verify url + case len(pushConf.FCM.AuthUrl) != 0: + // with authentication url client := httputil.NewHTTPClient(httputil.NewClientConfig()) - resp, err := client.Get(pushConf.FCM.VerifyUrl) + resp, err := client.Get(pushConf.FCM.AuthUrl) if err != nil { - return nil, errs.Wrap(err) + return nil, err } opt = option.WithCredentialsJSON(resp) default: - return nil, errs.New("no FCM config") + return nil, errs.New("no FCM config").Wrap() } fcmApp, err := firebase.NewApp(context.Background(), nil, opt) diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 1c52b6e7f..bd44c38f3 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -203,7 +203,7 @@ type Push struct { } `mapstructure:"geTui"` FCM struct { ServiceAccount string `mapstructure:"serviceAccount"` - VerifyUrl string `mapstructure:"verifyUrl"` + AuthUrl string `mapstructure:"authUrl"` } `mapstructure:"fcm"` JPNS struct { AppKey string `mapstructure:"appKey"`