|
@@ -1770,16 +1770,15 @@ ErrorCodeEnum CIDCertFSM::DeleteFileIfExisted(LPCTSTR fileName, int deleteTiming
|
|
|
strAimPath = strAimPath + SPLIT_SLASH_STR + fileName;
|
|
|
UpdateAndWarnFileFindInDepBak(strAimPath, fileName, IDCertificate_UserErrorCode_FindFile_in_DepBak);
|
|
|
|
|
|
- std::map<std::string, std::string> errInfo;
|
|
|
+ map<string, string> errInfo;
|
|
|
CSimpleStringA errMsg;
|
|
|
-
|
|
|
if (ExistsFileA((LPCTSTR)strAimPath))
|
|
|
{
|
|
|
if (deleteTiming == 1) //检测到上次读证残留图片
|
|
|
{
|
|
|
errInfo["path"] = strAimPath.GetData();
|
|
|
errInfo["hash"] = GetFileHashStr(strAimPath).GetData();
|
|
|
- errInfo["fodifytime"] = GetFileLastModifyTime(strAimPath).GetData();
|
|
|
+ errInfo["modifytime"] = GetFileLastModifyTime(strAimPath).GetData();
|
|
|
|
|
|
errMsg = generateJsonStr(errInfo).second.c_str();
|
|
|
|
|
@@ -1806,7 +1805,7 @@ ErrorCodeEnum CIDCertFSM::DeleteFileIfExisted(LPCTSTR fileName, int deleteTiming
|
|
|
|
|
|
errInfo.clear();
|
|
|
errInfo["path"] = strAimPath.GetData();
|
|
|
- errInfo["lasterror"] = GetLastError();
|
|
|
+ errInfo["lasterror"] = to_string(GetLastError());
|
|
|
errMsg = generateJsonStr(errInfo).second.c_str();
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode(rtaCode.GetData()).setAPI("DeleteFileIfExisted")
|
|
|
(errMsg.GetData());
|
|
@@ -2343,7 +2342,7 @@ void CIDCertFSM::CheckEjectCardRes(ErrorCodeEnum errRf, ErrorCodeEnum errForceID
|
|
|
CSimpleStringA CIDCertFSM::GetFileHashStr(CSimpleStringA filePath)
|
|
|
{
|
|
|
//calculate file hash value
|
|
|
- std::map<std::string, std::string> termInfo;
|
|
|
+ CSimpleStringA strHash;
|
|
|
char* strFileHash = new char[128];
|
|
|
if (ExistsFileA(filePath.GetData()))
|
|
|
{
|
|
@@ -2351,6 +2350,7 @@ CSimpleStringA CIDCertFSM::GetFileHashStr(CSimpleStringA filePath)
|
|
|
SM3File(const_cast<char*>(filePath.GetData()), fileHash);
|
|
|
ZeroMemory(strFileHash, 128);
|
|
|
SP::Module::Util::HexBuf2StrBuf(fileHash, &strFileHash, 32);
|
|
|
+ strHash = strFileHash;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2362,7 +2362,7 @@ CSimpleStringA CIDCertFSM::GetFileHashStr(CSimpleStringA filePath)
|
|
|
strFileHash = nullptr;
|
|
|
}
|
|
|
|
|
|
- return strFileHash;
|
|
|
+ return strHash;
|
|
|
}
|
|
|
|
|
|
CSimpleStringA CIDCertFSM::GetFileLastModifyTime(CSimpleStringA filePath)
|