فهرست منبع

把支付请求的默认超时时间改为10秒

zhangyang 3 سال پیش
والد
کامیت
0703561ea4

BIN
bin/Win32/Release/setup/zhipuzi_pos_windows_setup_1.0.0.8.exe


+ 1 - 1
bin/Win32/Release/setup/智铺子收银系统安装脚本.nsi

@@ -2,7 +2,7 @@
 
 ; HM NIS Edit Wizard helper defines
 !define PRODUCT_NAME "智铺子收银系统"
-!define PRODUCT_VERSION "1.0.0.8"
+!define PRODUCT_VERSION "1.0.0.9"
 !define PRODUCT_PUBLISHER "深圳市迅享智慧云科技有限公司"
 !define PRODUCT_WEB_SITE "https://www.zhipuzi.com"
 !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_NAME}.exe"

+ 6 - 0
zhipuzi_pos_windows/helper/CLewaimaiTime.cpp

@@ -194,6 +194,12 @@ time_t CLewaimaiTime::SystemTimeToTime_t(const SYSTEMTIME& st)
 	return mktime(&temptm);
 }
 
+long long CLewaimaiTime::GetCurrentTimerMS()
+{
+	auto c_time = duration_cast<milliseconds>(system_clock::now().time_since_epoch());
+	return c_time.count();
+}
+
 #ifdef _WIN32
 std::chrono::steady_clock::time_point CLewaimaiTime::getTimeStamp()
 {

+ 6 - 0
zhipuzi_pos_windows/helper/CLewaimaiTime.h

@@ -2,6 +2,9 @@
 
 #include <ctime>
 
+#include<chrono>
+using namespace std::chrono;
+
 class CLewaimaiTime
 {
 public:
@@ -20,6 +23,9 @@ public:
 	static SYSTEMTIME Time_tToSystemTime(time_t t);
 	static time_t SystemTimeToTime_t(const SYSTEMTIME& st);
 
+	//返回毫秒级时间戳
+	static long long GetCurrentTimerMS();
+
 #ifdef _WIN32
 	static std::chrono::steady_clock::time_point getTimeStamp();
 	static float getTimeDiff(std::chrono::steady_clock::time_point start, std::chrono::steady_clock::time_point end);

+ 4 - 4
zhipuzi_pos_windows/network/CHttpClient.h

@@ -16,7 +16,7 @@ public:
 	* @param strResponse 输出参数,返回的内容
 	* @return 返回是否Post成功
 	*/
-	int Post(const std::string & strUrl, const std::string & strPost, std::string & strResponse, CZhipuziHttpProxy proxy = CZhipuziHttpProxy(), int timeout = 5);
+	int Post(const std::string & strUrl, const std::string & strPost, std::string & strResponse, CZhipuziHttpProxy proxy = CZhipuziHttpProxy(), int timeout = 10);
 
 	/**
 	* @brief HTTP GET请求
@@ -24,7 +24,7 @@ public:
 	* @param strResponse 输出参数,返回的内容
 	* @return 返回是否Post成功
 	*/
-	int Get(const std::string & strUrl, std::string & strResponse, CZhipuziHttpProxy proxy = CZhipuziHttpProxy(), int timeout = 5);
+	int Get(const std::string & strUrl, std::string & strResponse, CZhipuziHttpProxy proxy = CZhipuziHttpProxy(), int timeout = 10);
 
 	/**
 	* @brief HTTPS POST请求,无证书版本
@@ -34,7 +34,7 @@ public:
 	* @param pCaPath 输入参数,为CA证书的路径.如果输入为NULL,则不验证服务器端证书的有效性.
 	* @return 返回是否Post成功
 	*/
-	int Posts(const std::string & strUrl, const std::string & strPost, std::string & strResponse, const char * pCaPath = NULL, CZhipuziHttpProxy proxy = CZhipuziHttpProxy(), int timeout = 5);
+	int Posts(const std::string & strUrl, const std::string & strPost, std::string & strResponse, const char * pCaPath = NULL, CZhipuziHttpProxy proxy = CZhipuziHttpProxy(), int timeout = 10);
 
 	/**
 	* @brief HTTPS GET请求,无证书版本
@@ -43,7 +43,7 @@ public:
 	* @param pCaPath 输入参数,为CA证书的路径.如果输入为NULL,则不验证服务器端证书的有效性.
 	* @return 返回是否Post成功
 	*/
-	int Gets(const std::string & strUrl, std::string & strResponse, const char * pCaPath = NULL, CZhipuziHttpProxy proxy = CZhipuziHttpProxy(), int timeout = 5);
+	int Gets(const std::string & strUrl, std::string & strResponse, const char * pCaPath = NULL, CZhipuziHttpProxy proxy = CZhipuziHttpProxy(), int timeout = 10);
 
 public:
 	void SetDebug(bool bDebug);

+ 1 - 1
zhipuzi_pos_windows/network/CZhipuziHttpClient.cpp

@@ -212,7 +212,7 @@ bool CZhipuziHttpClient::Request(std::string url, std::map<string, string> param
 
 	//LOG_INFO("postString:" << postString.c_str());
 
-	int timeout = 5;
+	int timeout = 10;
 	
 	if (url == "/goods/getallgoods")
 	{

BIN
zhipuzi_pos_windows/resource/zhipuzi_pos_windows.aps


BIN
zhipuzi_pos_windows/resource/zhipuzi_pos_windows.rc