Fix auto-reply duplication, message parsing and console stability
- dedupe by buyer message fingerprint and pending-message detection - stop treating platform auto-reply and order/product cards as chat messages - reply to buyer-sent product cards, inject card price and goods id - add optional human-intervention fallback to debug mode - configurable personal-order cache, block WebView2 new windows - capture crash dumps, bump version to 1.1.2
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
namespace pddai {
|
||||
|
||||
// 版本检测与自动更新:走验证平台的 /check-update,下载完整包后替换自身并重启
|
||||
struct UpdateInfo {
|
||||
bool available = false;
|
||||
bool forced = false;
|
||||
std::string currentVersion;
|
||||
std::string latestVersion;
|
||||
std::string notes;
|
||||
std::string downloadUrl;
|
||||
std::string fileHash;
|
||||
std::string entryFile;
|
||||
long long fileSize = 0;
|
||||
std::string error;
|
||||
};
|
||||
|
||||
class Update {
|
||||
public:
|
||||
// 当前 exe 的文件版本,格式化为 a.b.c
|
||||
static std::string CurrentVersion();
|
||||
|
||||
// 查询服务端最新版本;网络错误或服务端异常时 available=false 并填 error
|
||||
static UpdateInfo Check();
|
||||
|
||||
// 下载 → 校验 SHA256 → 解压(zip 包)→ 替换 exe → 启动新进程并退出。
|
||||
// progress 回调传入 0~100 的进度,可能在工作线程中被调用。
|
||||
static bool Apply(const UpdateInfo& info, const std::function<void(int)>& progress,
|
||||
std::string& error);
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user