mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-26 16:46:14 +08:00
Upgrade all libs and cleanup code
This commit is contained in:
@@ -111,14 +111,19 @@ func loadPermissions(ctx context.Context) {
|
||||
}
|
||||
|
||||
func Clear(ctx context.Context) (err error) {
|
||||
_, err = Enforcer.RemovePolicies(Enforcer.GetPolicy())
|
||||
policy, err := Enforcer.GetPolicy()
|
||||
if err != nil {
|
||||
g.Log().Warningf(ctx, "Enforcer RemovePolicies err:%+v", err)
|
||||
return
|
||||
}
|
||||
_, err = Enforcer.RemovePolicies(policy)
|
||||
if err != nil {
|
||||
g.Log().Warningf(ctx, "Enforcer RemovePolicies err:%+v", err)
|
||||
return
|
||||
}
|
||||
|
||||
// 检查是否清理干净
|
||||
if len(Enforcer.GetPolicy()) > 0 {
|
||||
if len(policy) > 0 {
|
||||
return Clear(ctx)
|
||||
}
|
||||
return
|
||||
|
@@ -8,8 +8,8 @@ package wxpay
|
||||
import (
|
||||
"context"
|
||||
"crypto/rsa"
|
||||
"github.com/go-pay/crypto/xpem"
|
||||
"github.com/go-pay/gopay"
|
||||
"github.com/go-pay/gopay/pkg/xpem"
|
||||
"github.com/go-pay/gopay/wechat/v3"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
@@ -88,7 +88,7 @@ func (h *wxPay) Notify(ctx context.Context, in payin.NotifyInp) (res *payin.Noti
|
||||
return
|
||||
}
|
||||
|
||||
notify, err := notifyReq.DecryptCipherText(h.config.WxPayAPIv3Key)
|
||||
notify, err := notifyReq.DecryptPayCipherText(h.config.WxPayAPIv3Key)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ package queue
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/Shopify/sarama"
|
||||
"github.com/IBM/sarama"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"hotgo/internal/consts"
|
||||
|
Reference in New Issue
Block a user