Pārlūkot izejas kodu

Z991239-3037 #comment [mod_upload] 上传去分行化改造(查询扫描路径和移动路径把反斜杠转换成linux格式)

Signed-Off-By: commit-hook
刘文涛80174520 3 gadi atpakaļ
vecāks
revīzija
c90f2457e9
1 mainītis faili ar 19 papildinājumiem un 0 dzēšanām
  1. 19 0
      Module/mod_upload/UploadFSM.cpp

+ 19 - 0
Module/mod_upload/UploadFSM.cpp

@@ -2070,12 +2070,31 @@ bool UploadFSM::queryPlan()
 					p->plan_type = rootRet["data"]["plan_list"][i]["plan_type"].asString();
 					p->file_type = rootRet["data"]["plan_list"][i]["file_type"].asString();
 					p->path_type = rootRet["data"]["plan_list"][i]["path_type"].asString();
+#ifdef RVC_OS_WIN
 					p->path_name = rootRet["data"]["plan_list"][i]["path_name"].asString();
+#else
+					//转义路径里面windows反斜杠'\'为'/'
+
+					//p->path_name = rootRet["data"]["plan_list"][i]["path_name"].asString();
+					string pathName = rootRet["data"]["plan_list"][i]["path_name"].asString();
+					std::replace(pathName.begin(), pathName.end(), '\\', SPLIT_SLASH);
+					p->path_name = pathName.c_str();
+#endif
+					
+
 					p->file_name = rootRet["data"]["plan_list"][i]["file_name"].asString();
 					p->file_regex = rootRet["data"]["plan_list"][i]["file_regex"].asString();
 					p->before_deal_type = rootRet["data"]["plan_list"][i]["before_deal_type"].asString();
 					p->after_deal_type = rootRet["data"]["plan_list"][i]["after_deal_type"].asString();
+#ifdef RVC_OS_WIN
 					p->after_deal_text = rootRet["data"]["plan_list"][i]["after_deal_text"].asString();
+#else
+					//转义路径里面windows反斜杠'\'为'/'
+					//p->after_deal_text = rootRet["data"]["plan_list"][i]["after_deal_text"].asString();
+					string afterDealText = rootRet["data"]["plan_list"][i]["after_deal_text"].asString();
+					std::replace(afterDealText.begin(), afterDealText.end(), '\\', SPLIT_SLASH);
+					p->after_deal_text = afterDealText.c_str();
+#endif
 					p->file_limit = rootRet["data"]["plan_list"][i]["file_limit"].asInt();
 					p->file_length_limit = rootRet["data"]["plan_list"][i]["file_length_limit"].asInt();//增加扫描文件最大长度限制
 					if(p->file_length_limit==0){