duanjianjun 2 years ago
parent
commit
a1c027b988

+ 1 - 1
MFCApplication1/BaseUtility.cpp

@@ -1217,7 +1217,7 @@ string GetImageEncodeString(string strPath)
 	string strTemp = "data:image/jpeg;base64,";
 	strTemp.append(strImg);
 	//´òÓ¡img¿´Ò»ÏÂ
-	string strEncode = UrlEncode(strTemp);
+	//string strEncode = UrlEncode(strTemp);
 
 	//ɾ³ýbuffer
 	delete[]buffer;

+ 2 - 0
MFCApplication1/Config.cpp

@@ -47,6 +47,8 @@ BOOL CConfig::LoadFromINI()
 	m_strImg = szData;
 	GetPrivateProfileString(_T("Set"), _T("Cut"), _T(""), szData, sizeof(szData), strIni);
 	m_strCut = szData;
+	GetPrivateProfileString(_T("Set"), _T("Token"), _T("24.086aba1dfaa5d4fdba74f2c62b591b35.2592000.1668825495.282335-21782130"), szData, sizeof(szData), strIni);
+	m_strToken = szData;
 	return TRUE;
 }
 

+ 2 - 0
MFCApplication1/Config.h

@@ -41,6 +41,8 @@ public:
 	CString m_strImg;
 	CString m_strCut;
 
+	CString m_strToken;
+
 };
 
 #endif // !defined(AFX_CONFIG_H__FB63E5FE_85CD_4155_B44F_37652790F1D6__INCLUDED_)

+ 1 - 1
MFCApplication1/MFCApplication1Dlg.cpp

@@ -266,7 +266,7 @@ int handwriting(string strImage, std::string &json_result, const std::string &ac
 
 int IdentifyCallback(result::spinfo& pinfo, void* param)
 {
-	string strToken = "24.086aba1dfaa5d4fdba74f2c62b591b35.2592000.1668825495.282335-21782130";
+	string strToken = UnicodeToGB2312(CConfig::Instance()->m_strToken);
 	string strResult;
 	string strEncode = GetImageEncodeString("d:\\202210122100_0001.jpg");
 	handwriting(strEncode, strResult, strToken);