feat(app): update
This commit is contained in:
@ -101,7 +101,7 @@ func (client *AppleClient) VerifyAppleAuthCode(authCode string) (appleUserId str
|
||||
resultErr = err
|
||||
return
|
||||
}
|
||||
token, _ := jwt.ParseWithClaims(resultDTO.IdToken, &Claims{}, func(token *jwt.Token) (interface{}, error) {
|
||||
token, _ := jwt.ParseWithClaims(resultDTO.IdToken, &Claims{}, func(token *jwt.Token) (any, error) {
|
||||
// Don't forget to validate the alg is what you expect:
|
||||
if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok {
|
||||
return nil, fmt.Errorf("Unexpected signing method: %v ", token.Header["alg"])
|
||||
@ -120,7 +120,7 @@ func (client *AppleClient) VerifyAppleAuthCode(authCode string) (appleUserId str
|
||||
func (client *AppleClient) GenerateClientSecret() (secret string) {
|
||||
|
||||
token := &jwt.Token{
|
||||
Header: map[string]interface{}{
|
||||
Header: map[string]any{
|
||||
"alg": "ES256",
|
||||
"kid": viper.GetString("apple.KeyId"),
|
||||
},
|
||||
@ -152,7 +152,7 @@ func AuthKeyFromBytes(key []byte) (*ecdsa.PrivateKey, error) {
|
||||
}
|
||||
|
||||
// Parse the key
|
||||
var parsedKey interface{}
|
||||
var parsedKey any
|
||||
if parsedKey, err = x509.ParsePKCS8PrivateKey(block.Bytes); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@ -280,7 +280,7 @@ func (client *WxPayClient) CheckRefundNotifySign(request *http.Request) (*WxRefu
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
content := new(map[string]interface{})
|
||||
content := new(map[string]any)
|
||||
notifyReq, err := handler.ParseNotifyRequest(context.Background(), request, &content)
|
||||
// 如果验签未通过,或者解密失败
|
||||
if err != nil {
|
||||
|
||||
@ -94,9 +94,9 @@ func (client *YiDunClient) OneClickApi(params map[string]string) (mobile string,
|
||||
//{"code":200,"msg":"ok","data":{"phone":"13079217909","resultCode":"0"}}
|
||||
|
||||
var resultDTO struct {
|
||||
Code int64 `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Data map[string]interface{} `json:"data"`
|
||||
Code int64 `json:"code"`
|
||||
Msg string `json:"msg"`
|
||||
Data map[string]any `json:"data"`
|
||||
}
|
||||
|
||||
err2 := json.Unmarshal([]byte(result), &resultDTO)
|
||||
|
||||
@ -7,10 +7,10 @@ import (
|
||||
// 事件
|
||||
type EventMessage struct {
|
||||
Message
|
||||
Tag EventTag // 消息标签:EventTagUser=用户
|
||||
Flag EventFlag // 消息标签:EventFlagCreate=创建 EventFlagUpdate=更新 EventFlagSave=创建或更新 EventFlagDelete=删除
|
||||
EventId string // 事件ID
|
||||
EventContent interface{} // 事件内容
|
||||
Tag EventTag // 消息标签:EventTagUser=用户
|
||||
Flag EventFlag // 消息标签:EventFlagCreate=创建 EventFlagUpdate=更新 EventFlagSave=创建或更新 EventFlagDelete=删除
|
||||
EventId string // 事件ID
|
||||
EventContent any // 事件内容
|
||||
}
|
||||
|
||||
type EventTag string
|
||||
|
||||
@ -586,7 +586,7 @@ func (*MessageClient) PushActiveMessage(userId, deviceId, time, platform, device
|
||||
}
|
||||
|
||||
// PushErrorMessage 发布错误消息
|
||||
func (*MessageClient) PushErrorMessage(code string, content interface{}, tag message2.ErrorTag) (e error) {
|
||||
func (*MessageClient) PushErrorMessage(code string, content any, tag message2.ErrorTag) (e error) {
|
||||
b, e := json.Marshal(content)
|
||||
if nil != e {
|
||||
return
|
||||
@ -601,7 +601,7 @@ func (*MessageClient) PushErrorMessage(code string, content interface{}, tag mes
|
||||
}
|
||||
|
||||
// PushEventMessage 发布事件消息
|
||||
func (*MessageClient) PushEventMessage(tag message2.EventTag, flag message2.EventFlag, eventId string, content interface{}) (e error) {
|
||||
func (*MessageClient) PushEventMessage(tag message2.EventTag, flag message2.EventFlag, eventId string, content any) (e error) {
|
||||
message := message2.EventMessage{
|
||||
Tag: tag,
|
||||
Flag: flag,
|
||||
|
||||
@ -498,7 +498,7 @@ func NewApiException(statusCode int, header http.Header, body []byte) error {
|
||||
body: body,
|
||||
}
|
||||
|
||||
bodyObject := map[string]interface{}{}
|
||||
bodyObject := map[string]any{}
|
||||
if err := json.Unmarshal(body, &bodyObject); err == nil {
|
||||
if val, ok := bodyObject["code"]; ok {
|
||||
ret.errorCode = val.(string)
|
||||
|
||||
Reference in New Issue
Block a user