Skip to content

Commit

Permalink
Update GetPhoneNumber.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
tooclian committed Mar 23, 2024
1 parent 9a487ba commit 3f23571
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/WeChat.Applet/Requests/GetPhoneNumber.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Microsoft.Extensions.DependencyInjection;

namespace WeChat.Applet;
namespace WeChat.Applet;

/// <summary>
/// 【微信小程序】获取手机号
Expand Down Expand Up @@ -68,7 +66,7 @@ public class Request(string code, string? openid = default) : WeChatAppletHttpRe
{
protected override async Task InitializeRequestMessageAsync(IHttpRequestContext context)
{
var token = await context.RequestServices.GetRequiredService<IWeChatAppletAccessTokenStore>().GetAsync();
var token = await GetAccessTokenAsync();

var url = $"{WeChatAppletProperties.Domain}{Endpoint}"
.Replace("{access_token}", token)
Expand Down

0 comments on commit 3f23571

Please sign in to comment.