如果是列表的话,尽量固定他的高度。给他一个准确的值,尤其是图片,固定了高度,这样就是正确的结果
boundingClientRect获取的高度不准确有个需要是判断当前滚动到什么位置,然后高亮顶部对应的菜单。因为元素的内容是从接口获取的,需要获取在获取数据并页面渲染完成之后的元素高度,在setdata的callback里使用 [代码] wx.createSelectorQuery().select('#the-id').boundingClientRect(function(rect){ rect.id // 节点的ID rect.dataset // 节点的dataset rect.left // 节点的左边界坐标 rect.right // 节点的右边界坐标 rect.top // 节点的上边界坐标 rect.bottom // 节点的下边界坐标 rect.width // 节点的宽度 rect.height // 节点的高度 }).exec()[代码]获取高度发现不一定是页面渲染之后的高度。 怎么样才能获取到元素的渲染后高度或者有什么其他的方法可以实现这个需求?
2023-06-25我想到个办法,失败的话再次调用接口,就可以了。
.net core 3.1 服务器端获取用户信息经常出现Authentication failed?.net core 3.1 服务器端获取用户信息经常出现 System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream. at System.Net.Security.SslStream.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslStream.PartialFrameCallback(AsyncProtocolRequest asyncRequest) --- End of stack trace from previous location where exception was thrown --- at System.Net.Security.SslStream.EndProcessAuthentication(IAsyncResult result) at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) 不是必然,是经常出现 ,请问是什么问题啊 请求代码 var hander = new HttpClientHandler(); hander.ServerCertificateCustomValidationCallback = (message, certificate2, arg3, arg4) => true; HttpClient webClient = new HttpClient(hander); var jsonString = await (await webClient.GetAsync( $"https://api.weixin.qq.com/sns/jscode2session?appid={SystemSetting.WeClientMiniAppID}&secret={SystemSetting.WeClientMiniAppSecret}&js_code={request.WeCode}&grant_type=authorization_code" )).Content.ReadAsStringAsync();
2021-09-02 services.AddHttpClient("HttpClientWithSSLUntrusted").ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler { ClientCertificateOptions = ClientCertificateOption.Manual, ServerCertificateCustomValidationCallback = (httpRequestMessage, cert, cetChain, policyErrors) => { return true; } }); var client = _clientFactory.CreateClient("HttpClientWithSSLUntrusted"); var response = await client.GetAsync(url); var result = await response.Content.ReadAsStringAsync();
net core 3.1 通过code换取网页授权access_token和openid 报错?net core 3.1 通过code换取网页授权access_token和openid 时候报错了 var url = $"https://api.weixin.qq.com/sns/jscode2session?appid={ _wechatConfigOptions.Value.ProcessAppId}&secret={ _wechatConfigOptions.Value.ProcessSecret}&js_code={code}&grant_type=authorization_code"; public async Task<string> GetHttpAsync(string urladdress) { using (WebClient MyWebClient = new WebClient()) { MyWebClient.Credentials = CredentialCache.DefaultCredentials;//获取或设置用于向Internet资源的请求进行身份验证的网络凭据 Byte[] pageData = await MyWebClient.DownloadDataTaskAsync(new Uri(urladdress)); //从指定网站下载数据 return Encoding.UTF8.GetString(pageData); //如果获取网站页面采用的是UTF-8,则使用这句 } } 下面是错误 "System.Net.WebException: The SSL connection could not be established, see inner exception. Authentication failed because the remote party has closed the transport stream. ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception. ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream. at System.Net.Security.SslStream.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslStream.PartialFrameCallback(AsyncProtocolRequest asyncRequest) --- End of stack trace from previous location where exception was thrown --- at System.Net.Security.SslStream.EndProcessAuthentication(IAsyncResult result) at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken) --- End of inner exception stack trace --- at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage request, Uri authUri, ICredentials credentials, Boolean preAuthenticate, Boolean isProxyAuth, Boolean doRequestAuth, HttpConnectionPool pool, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) at System.Net.HttpWebRequest.SendRequest() at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result) at System.Net.WebClient.GetWebResponseTaskAsync(WebRequest request) at System.Net.WebClient.DownloadBitsAsync(WebRequest request, Stream writeStream, AsyncOperation asyncOp, Action`3 completionDelegate) at Sxl.Client.Web.Service.HttpService.GetHttpAsync(String urladdress) in C:\Users\Administrator\Desktop\Sxl.Client.Web\Sxl.Client.Web\Service\HttpService.cs:line 41 at Sxl.Client.Web.Controllers.WeChatController.LoginMiniProcessAsync(String code) in
2021-08-11亲亲,你的V3 密钥 不对哇。我就是搞错了。才报的这个错
回调报文解密解密失败?mac check in GCM failed报错信息:mac check in GCM failed,请问如何解决 [图片]
2021-08-05