feat: verify-asset 接口返回当前生效的公众号和小程序 AppID
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m51s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m51s
This commit is contained in:
@@ -11,8 +11,10 @@ type VerifyAssetRequest struct {
|
||||
|
||||
// VerifyAssetResponse A1 资产验证响应
|
||||
type VerifyAssetResponse struct {
|
||||
AssetToken string `json:"asset_token" description:"资产令牌(5分钟有效)"`
|
||||
ExpiresIn int `json:"expires_in" description:"过期时间(秒)"`
|
||||
AssetToken string `json:"asset_token" description:"资产令牌(5分钟有效)"`
|
||||
ExpiresIn int `json:"expires_in" description:"过期时间(秒)"`
|
||||
OaAppID string `json:"oa_app_id" description:"当前生效的公众号 AppID"`
|
||||
MiniappAppID string `json:"miniapp_app_id" description:"当前生效的小程序 AppID"`
|
||||
}
|
||||
|
||||
// ========================================
|
||||
|
||||
@@ -112,10 +112,17 @@ func (s *Service) VerifyAsset(ctx context.Context, req *dto.VerifyAssetRequest,
|
||||
return nil, errors.Wrap(errors.CodeInternalError, err, "签发资产令牌失败")
|
||||
}
|
||||
|
||||
return &dto.VerifyAssetResponse{
|
||||
resp := &dto.VerifyAssetResponse{
|
||||
AssetToken: assetToken,
|
||||
ExpiresIn: assetTokenExpireSeconds,
|
||||
}, nil
|
||||
}
|
||||
|
||||
if wechatConfig, err := s.wechatConfigService.GetActiveConfig(ctx); err == nil && wechatConfig != nil {
|
||||
resp.OaAppID = wechatConfig.OaAppID
|
||||
resp.MiniappAppID = wechatConfig.MiniappAppID
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
// WechatLogin A2 公众号登录
|
||||
|
||||
Reference in New Issue
Block a user