如何去掉呢?不想要这个应用名称
企业微信第三方应用扫码授权登录弹出的二维码下面的信息如何设置[图片]
2020-08-19我也遇到同样问题,不过我是用node实现出现这样的问题的,坐等解答:https://developers.weixin.qq.com/community/develop/doc/0002c0f2ae47e80f8f0ab4ea35b800?fromCreate=0
企业微信上传临时素材44001错误语言c++,https://qyapi.weixin.qq.com/cgi-bin/media/upload?access_token=ACCESS_TOKEN&type=TYPE上传临时素材,报错44001 代码及问题截图如下,请问我需要怎么修改 [图片] #include "stdafx.h" #include "CHttpClient.h" #include <winInet.h> #include <afxinet.h> CHttpClient::CHttpClient() { } CHttpClient::~CHttpClient() { } int CHttpClient::ExecuteRequestUpload(LPCTSTR strFileName, LPCTSTR strUrl, string &strResponse) { CString strServer; CString strObject; DWORD dwServiceType; INTERNET_PORT nPort; strResponse = ""; CHttpConnection *m_pConnection = NULL; CInternetSession pSession; CHttpFile* m_pFile = NULL; AfxParseURL(strUrl, dwServiceType, strServer, strObject, nPort); if (AFX_INET_SERVICE_HTTP != dwServiceType && AFX_INET_SERVICE_HTTPS != dwServiceType) { return 1; } CFile fTrack; if (FALSE == fTrack.Open(strFileName, CFile::shareDenyNone | CFile::modeRead)) return -1; CString strRequestHeader = L""; CString strHTTPBoundary = L""; CString strPreFileData = L""; CString strPostFileData = L""; DWORD dwTotalRequestLength = 0; DWORD dwChunkLength = 0; DWORD dwReadLength = 0; DWORD dwResponseLength = 0; LPSTR szResponse = NULL; CString strFilePath = strFileName; int startp = strFilePath.ReverseFind('\\'); int namelen = strFilePath.GetLength() - startp - 1; CString szFileName = strFilePath.Mid(startp + 1, namelen); strHTTPBoundary = L"-------------------------acebdf13572468"; strPreFileData = MakePreFileData(strHTTPBoundary, szFileName, fTrack.GetLength()).c_str(); strPostFileData = MakeRequestEnders(strHTTPBoundary).c_str(); dwTotalRequestLength = strPreFileData.GetLength() + strPostFileData.GetLength() + fTrack.GetLength(); strRequestHeader = MakeRequestHeaders(strHTTPBoundary, strServer, nPort, dwTotalRequestLength).c_str(); dwChunkLength = 64 * 1024; void* pBuffer = malloc(dwChunkLength); if (NULL == pBuffer) { return -1; } else { try { m_pConnection = pSession.GetHttpConnection(strServer, nPort, NULL, NULL); m_pFile = m_pConnection->OpenRequest(L"POST",strObject,NULL, 1, NULL, NULL, INTERNET_FLAG_EXISTING_CONNECT); m_pFile->AddRequestHeaders(strRequestHeader); m_pFile->SendRequestEx(dwTotalRequestLength, HSR_SYNC | HSR_INITIATE); #ifdef _UNICODE m_pFile->Write(strPreFileData, strPreFileData.GetLength()); #else m_pFile->Write((LPSTR)(LPCSTR)strPreFileData, strPreFileData.GetLength()); #endif dwReadLength = -1; while (0 != dwReadLength) { dwReadLength = fTrack.Read(pBuffer, dwChunkLength); if (0 != dwReadLength) { m_pFile->Write(pBuffer, dwReadLength); } } #ifdef _UNICODE m_pFile->Write(strPostFileData, strPostFileData.GetLength()); #else m_pFile->Write((LPSTR)(LPCSTR)strPostFileData, strPostFileData.GetLength()); #endif m_pFile->EndRequest(HSR_SYNC); dwResponseLength = m_pFile->GetLength(); while (0 != dwResponseLength) { szResponse = (LPSTR)malloc(dwResponseLength + 1); szResponse[dwResponseLength] = '\0'; m_pFile->Read(szResponse, dwResponseLength); strResponse += szResponse; free(szResponse); dwResponseLength = m_pFile->GetLength(); } } catch (CInternetException* e) { //Clear(); DWORD dwErrorCode = e->m_dwError; e->Delete(); DWORD dwError = GetLastError(); if (ERROR_INTERNET_TIMEOUT == dwErrorCode) { return 3; } else { return 4; } } } return SUCCESS; } string CHttpClient::MakeRequestHeaders(LPCTSTR strBoundary, LPCTSTR strServerName, const int nPort,DWORD dwTotalRequestLength) { //CHAR strFormat[1024] = ""; //static CHAR strData[1024]; //const char* str = "Content-Type: multipart/form-data;boundary=-------------------------acebdf13572468\r\n"; //strcat(strFormat, "Accept-Language: zh-cn;\r\n"); //strcat(strFormat, str); //strcat(strFormat, "Connection: keep-alive\r\n"); ////strcat(strFormat, "Host:%s;\r\n"); //sprintf(strData, strFormat, strBoundary); string len = to_string(long long(dwTotalRequestLength)); string strData = "Accept-Language: zh-cn\r\nContent-Type: multipart/form-data;boundary=-------------------------acebdf13572468\r\nConnection: keep-alive\r\nContent-Length:"; strData += len + "\r\n"; return strData; } string CHttpClient::MakePreFileData(LPCTSTR strBoundary, LPCTSTR strFileName, DWORD dsize) { //CHAR strFormat[1024] = ""; //static CHAR strData[1024]; ////const char* fileName = strFileName; //strcat(strFormat, "\r\n-------------------------acebdf13572468\r\n"); //strcat(strFormat, "Content-Disposition: form-data; name=\"media\"; filename=\"%s\";filelength=d%\r\n"); //strcat(strFormat, "Content-Type:image/bmp;image/jpeg;image/x-png;application/zip;application/octet-stream\r\n\r\n"); // // strcat(strFormat,"Content-Transfer-Encoding:binary\r\n\r\n"); //sprintf(strData, strFormat, strBoundary, strFileName, dsize); string str = CW2A(strFileName); string size = to_string(long long(dsize)); string strData = "-------------------------acebdf13572468\r\n"; strData +="Content-Disposition: form-data; name=\"media\"; filename=\""+ str +"\";filelength="+ size +"\r\n"; strData += "Content-Type:application/octet-stream\r\n"; return strData; } string CHttpClient::MakeRequestEnders(LPCTSTR strBoundary) { //CHAR strFormat[256] = ""; //static CHAR strEnd[256]; //strcat(strFormat, "\r\n%s--\r\n"); //// strcat(strFormat,"Content-Disposition: form-data;name =\"submitted\"\r\n\r\n"); //// strcat(strFormat,"submit\r\n"); //// strcat(strFormat,"--%s--\r\n"); //sprintf(strEnd, strFormat, strBoundary); string strEnd = "-------------------------acebdf13572468--\r\n"; return strEnd; }
2020-03-11部分手机的浏览器(如三星)调起微信app支付后,没有返回到redirect_url对应的地址。直接用微信的demo测试结果也是一样的
ios自带浏览器H5支付同步回调问题错误ios自带浏览器H5支付,调用微信app支付成功后,在浏览器没有调整到对应设置的回调地址
2019-10-22