优化签字判断&日志
This commit is contained in:
@@ -142,19 +142,22 @@ const UI7: React.FC = () => {
|
|||||||
hasFetchedRef.current = true;
|
hasFetchedRef.current = true;
|
||||||
|
|
||||||
const fetchPdfs = async () => {
|
const fetchPdfs = async () => {
|
||||||
try {
|
const examId = Number(localStorage.getItem("selectedExamId"));
|
||||||
const res = await getTongyishuPdf(
|
window.electronAPI?.log("info", `[UI7] 开始获取知情同意书PDF列表,exam_id=${examId}`);
|
||||||
Number(localStorage.getItem("selectedExamId"))
|
|
||||||
);
|
|
||||||
if (res.Status !== 200) {
|
|
||||||
// alert(`获取PDF数据失败: ${res.Message}`);
|
|
||||||
window.electronAPI?.log("error", `获取PDF数据失败: ${res.Message}`);
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res = await getTongyishuPdf(examId);
|
||||||
|
window.electronAPI?.log("info", `[UI7] 获取PDF列表响应: Status=${res.Status}, Message=${res.Message || "null"}`);
|
||||||
|
|
||||||
|
if (res.Status !== 200) {
|
||||||
|
window.electronAPI?.log("error", `[UI7] 获取PDF数据失败: ${res.Message}`);
|
||||||
setLoadMessage(res.Message || "获取PDF数据失败");
|
setLoadMessage(res.Message || "获取PDF数据失败");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const rawList = res.Data?.list_pdf_url || [];
|
const rawList = res.Data?.list_pdf_url || [];
|
||||||
|
window.electronAPI?.log("info", `[UI7] 原始PDF列表数量: ${rawList.length}`);
|
||||||
|
|
||||||
const normalizedList = rawList
|
const normalizedList = rawList
|
||||||
.map((item, idx): PdfMeta => {
|
.map((item, idx): PdfMeta => {
|
||||||
if (typeof item === "string") {
|
if (typeof item === "string") {
|
||||||
@@ -189,6 +192,14 @@ const UI7: React.FC = () => {
|
|||||||
typeof item.pdf_url === "string" && item.pdf_url.length > 0
|
typeof item.pdf_url === "string" && item.pdf_url.length > 0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
window.electronAPI?.log("info", `[UI7] 规范化后PDF列表数量: ${normalizedList.length}`);
|
||||||
|
normalizedList.forEach((item, idx) => {
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] PDF[${idx}]: name="${item.pdf_name}", combination_code=${item.combination_code || "null"}, url=${item.pdf_url.substring(0, 80)}...`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
if (!normalizedList.length) {
|
if (!normalizedList.length) {
|
||||||
throw new Error("未获取到任何 PDF 链接");
|
throw new Error("未获取到任何 PDF 链接");
|
||||||
}
|
}
|
||||||
@@ -197,23 +208,33 @@ const UI7: React.FC = () => {
|
|||||||
setError("");
|
setError("");
|
||||||
setPdfFiles([]);
|
setPdfFiles([]);
|
||||||
setPdfInfoList([]);
|
setPdfInfoList([]);
|
||||||
window.electronAPI?.log("info", "[UI7] 开始获取 PDF 文件");
|
window.electronAPI?.log("info", `[UI7] 开始下载 ${normalizedList.length} 份 PDF 文件`);
|
||||||
|
|
||||||
const files: Uint8Array[] = [];
|
const files: Uint8Array[] = [];
|
||||||
for (let idx = 0; idx < normalizedList.length; idx++) {
|
for (let idx = 0; idx < normalizedList.length; idx++) {
|
||||||
const { pdf_url: url } = normalizedList[idx];
|
const { pdf_url: url, pdf_name: name } = normalizedList[idx];
|
||||||
window.electronAPI?.log(
|
window.electronAPI?.log(
|
||||||
"info",
|
"info",
|
||||||
`[UI7] 下载第 ${idx + 1} 份 PDF: ${url}`
|
`[UI7] 下载第 ${idx + 1}/${normalizedList.length} 份 PDF: ${name}`
|
||||||
);
|
);
|
||||||
|
const startTime = Date.now();
|
||||||
const pdfBytes = await fetchPdfBytes(url);
|
const pdfBytes = await fetchPdfBytes(url);
|
||||||
|
const duration = Date.now() - startTime;
|
||||||
files.push(pdfBytes);
|
files.push(pdfBytes);
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 第 ${idx + 1} 份 PDF 下载完成,大小: ${pdfBytes.length} bytes,耗时: ${duration}ms`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
setPdfFiles(files);
|
setPdfFiles(files);
|
||||||
setPdfInfoList(normalizedList);
|
setPdfInfoList(normalizedList);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
setError("");
|
setError("");
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] PDF 获取完成,共 ${normalizedList.length} 份,总签名步骤: ${normalizedList.length + 1} (导检单 + ${normalizedList.length} 份知情同意书)`
|
||||||
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const errorMsg = `PDF获取失败: ${err}`;
|
const errorMsg = `PDF获取失败: ${err}`;
|
||||||
console.error(errorMsg);
|
console.error(errorMsg);
|
||||||
@@ -227,8 +248,10 @@ const UI7: React.FC = () => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
window.electronAPI?.log("info", "[UI7] 初始化:清理旧的签名缓存数据");
|
||||||
localStorage.removeItem("consentSignatureList");
|
localStorage.removeItem("consentSignatureList");
|
||||||
localStorage.removeItem("tongyishuSignedPdfUrls");
|
localStorage.removeItem("tongyishuSignedPdfUrls");
|
||||||
|
window.electronAPI?.log("info", "[UI7] 初始化完成:签名缓存已清理");
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -244,10 +267,26 @@ const UI7: React.FC = () => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setCurrentPdfPageCount(0);
|
setCurrentPdfPageCount(0);
|
||||||
}, [currentStep, currentPdfFile]);
|
if (currentStep > 0) {
|
||||||
|
const meta = pdfInfoList[currentStep - 1];
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 步骤切换: currentStep=${currentStep}, 当前PDF: ${meta?.pdf_name || "未知"}`
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 步骤切换: currentStep=${currentStep} (导检单说明页)`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}, [currentStep, currentPdfFile, pdfInfoList]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setHasSignature(false);
|
setHasSignature(false);
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 步骤 ${currentStep} 签名状态已重置`
|
||||||
|
);
|
||||||
}, [currentStep]);
|
}, [currentStep]);
|
||||||
|
|
||||||
// 检测标题文本是否超过一行,如果超过则应用缩小样式
|
// 检测标题文本是否超过一行,如果超过则应用缩小样式
|
||||||
@@ -446,27 +485,46 @@ const UI7: React.FC = () => {
|
|||||||
const handleConfirm = useCallback(() => {
|
const handleConfirm = useCallback(() => {
|
||||||
const execute = async () => {
|
const execute = async () => {
|
||||||
if (isSubmitting) {
|
if (isSubmitting) {
|
||||||
|
window.electronAPI?.log("warn", "[UI7] 检测到重复提交,已忽略");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const canvas = canvasRef.current;
|
const canvas = canvasRef.current;
|
||||||
if (!canvas) {
|
if (!canvas) {
|
||||||
|
window.electronAPI?.log("error", "[UI7] 画布初始化失败");
|
||||||
alert("画布初始化失败,请刷新页面");
|
alert("画布初始化失败,请刷新页面");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isCanvasBlank()) {
|
if (isCanvasBlank()) {
|
||||||
|
window.electronAPI?.log("warn", "[UI7] 画布为空,无法提交");
|
||||||
alert("请先完成签名后再继续");
|
alert("请先完成签名后再继续");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const examIdStr = localStorage.getItem("selectedExamId");
|
const examIdStr = localStorage.getItem("selectedExamId");
|
||||||
const examId = Number(examIdStr);
|
const examId = Number(examIdStr);
|
||||||
if (!examIdStr || Number.isNaN(examId)) {
|
if (!examIdStr || Number.isNaN(examId)) {
|
||||||
|
window.electronAPI?.log("error", `[UI7] 体检ID无效: ${examIdStr}`);
|
||||||
alert("未找到体检ID,请返回重试");
|
alert("未找到体检ID,请返回重试");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const totalSteps = pdfInfoList.length + 1;
|
||||||
|
const currentStepNum = currentStep + 1;
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] ========== 开始提交签名 ==========`
|
||||||
|
);
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 当前步骤: ${currentStepNum}/${totalSteps}, currentStep=${currentStep}, pdfInfoList.length=${pdfInfoList.length}`
|
||||||
|
);
|
||||||
|
|
||||||
setIsSubmitting(true);
|
setIsSubmitting(true);
|
||||||
try {
|
try {
|
||||||
const blob = await canvasToBlob(canvas);
|
const blob = await canvasToBlob(canvas);
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 签名图片生成成功,大小: ${blob.size} bytes`
|
||||||
|
);
|
||||||
|
|
||||||
// 本地缓存成列表,方便 UI8 或调试使用
|
// 本地缓存成列表,方便 UI8 或调试使用
|
||||||
try {
|
try {
|
||||||
@@ -475,6 +533,10 @@ const UI7: React.FC = () => {
|
|||||||
const storedList: string[] = storedRaw ? JSON.parse(storedRaw) : [];
|
const storedList: string[] = storedRaw ? JSON.parse(storedRaw) : [];
|
||||||
storedList[currentStep] = dataUrl;
|
storedList[currentStep] = dataUrl;
|
||||||
localStorage.setItem("consentSignatureList", JSON.stringify(storedList));
|
localStorage.setItem("consentSignatureList", JSON.stringify(storedList));
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 签名已缓存到 localStorage[${currentStep}]`
|
||||||
|
);
|
||||||
} catch (cacheErr) {
|
} catch (cacheErr) {
|
||||||
window.electronAPI?.log(
|
window.electronAPI?.log(
|
||||||
"warn",
|
"warn",
|
||||||
@@ -485,30 +547,68 @@ const UI7: React.FC = () => {
|
|||||||
if (currentStep === 0) {
|
if (currentStep === 0) {
|
||||||
window.electronAPI?.log(
|
window.electronAPI?.log(
|
||||||
"info",
|
"info",
|
||||||
`[UI7] 提交导检单签名(第 1 次),exam_id=${examId}`
|
`[UI7] >>> 提交导检单签名(步骤 ${currentStepNum}/${totalSteps}),exam_id=${examId}`
|
||||||
);
|
);
|
||||||
|
const startTime = Date.now();
|
||||||
const daojiandanRes = await submitDaojiandanSign(examId, blob);
|
const daojiandanRes = await submitDaojiandanSign(examId, blob);
|
||||||
|
const duration = Date.now() - startTime;
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 导检单签名响应: Status=${daojiandanRes.Status}, Message=${daojiandanRes.Message || "null"}, 耗时: ${duration}ms`
|
||||||
|
);
|
||||||
|
|
||||||
if (daojiandanRes.Status !== 200) {
|
if (daojiandanRes.Status !== 200) {
|
||||||
throw new Error(daojiandanRes.Message || "提交导检单签名失败");
|
throw new Error(daojiandanRes.Message || "提交导检单签名失败");
|
||||||
}
|
}
|
||||||
localStorage.setItem("consentSignature", daojiandanRes.Data.pdf_url || "");
|
|
||||||
} else {
|
const pdfUrl = daojiandanRes.Data.pdf_url || "";
|
||||||
const meta = pdfInfoList[currentStep - 1];
|
localStorage.setItem("consentSignature", pdfUrl);
|
||||||
if (!meta || meta.combination_code == null) {
|
|
||||||
throw new Error("当前知情同意书缺少组合代码,无法提交签名");
|
|
||||||
}
|
|
||||||
window.electronAPI?.log(
|
window.electronAPI?.log(
|
||||||
"info",
|
"info",
|
||||||
`[UI7] 提交知情同意书签名,exam_id=${examId}, combination_code=${meta.combination_code}`
|
`[UI7] 导检单签名成功,PDF URL已保存: ${pdfUrl.substring(0, 80)}...`
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
const meta = pdfInfoList[currentStep - 1];
|
||||||
|
if (!meta) {
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"error",
|
||||||
|
`[UI7] 无法找到当前PDF元信息,currentStep=${currentStep}, pdfInfoList.length=${pdfInfoList.length}`
|
||||||
|
);
|
||||||
|
throw new Error("当前PDF信息缺失,无法提交签名");
|
||||||
|
}
|
||||||
|
if (meta.combination_code == null) {
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"error",
|
||||||
|
`[UI7] 当前知情同意书缺少组合代码: pdf_name="${meta.pdf_name}", pdf_url=${meta.pdf_url.substring(0, 80)}...`
|
||||||
|
);
|
||||||
|
throw new Error("当前知情同意书缺少组合代码,无法提交签名");
|
||||||
|
}
|
||||||
|
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] >>> 提交知情同意书签名(步骤 ${currentStepNum}/${totalSteps})`
|
||||||
|
);
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] PDF信息: name="${meta.pdf_name}", combination_code=${meta.combination_code}, exam_id=${examId}`
|
||||||
|
);
|
||||||
|
|
||||||
|
const startTime = Date.now();
|
||||||
const tongyishuRes = await submitTongyishuSign(
|
const tongyishuRes = await submitTongyishuSign(
|
||||||
examId,
|
examId,
|
||||||
meta.combination_code,
|
meta.combination_code,
|
||||||
blob
|
blob
|
||||||
);
|
);
|
||||||
|
const duration = Date.now() - startTime;
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 知情同意书签名响应: Status=${tongyishuRes.Status}, Message=${tongyishuRes.Message || "null"}, 耗时: ${duration}ms`
|
||||||
|
);
|
||||||
|
|
||||||
if (tongyishuRes.Status !== 200) {
|
if (tongyishuRes.Status !== 200) {
|
||||||
throw new Error(tongyishuRes.Message || "提交知情同意书签名失败");
|
throw new Error(tongyishuRes.Message || "提交知情同意书签名失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 保存签名后的知情同意书 PDF URL(可能返回多个)
|
// 保存签名后的知情同意书 PDF URL(可能返回多个)
|
||||||
try {
|
try {
|
||||||
const returnedList = Array.isArray(
|
const returnedList = Array.isArray(
|
||||||
@@ -516,51 +616,96 @@ const UI7: React.FC = () => {
|
|||||||
)
|
)
|
||||||
? tongyishuRes.Data.list_pdf_url
|
? tongyishuRes.Data.list_pdf_url
|
||||||
: [];
|
: [];
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 返回的PDF URL列表数量: ${returnedList.length}`
|
||||||
|
);
|
||||||
|
|
||||||
const urls = returnedList
|
const urls = returnedList
|
||||||
.map((item) =>
|
.map((item) =>
|
||||||
typeof item === "string" ? item : item?.pdf_url || ""
|
typeof item === "string" ? item : item?.pdf_url || ""
|
||||||
)
|
)
|
||||||
.filter((url): url is string => Boolean(url));
|
.filter((url): url is string => Boolean(url));
|
||||||
|
|
||||||
|
urls.forEach((url, idx) => {
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 返回的PDF URL[${idx}]: ${url.substring(0, 80)}...`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
const storedRaw = localStorage.getItem("tongyishuSignedPdfUrls");
|
const storedRaw = localStorage.getItem("tongyishuSignedPdfUrls");
|
||||||
const storedList: string[] = storedRaw ? JSON.parse(storedRaw) : [];
|
const storedList: string[] = storedRaw ? JSON.parse(storedRaw) : [];
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 原有缓存的PDF URL数量: ${storedList.length}`
|
||||||
|
);
|
||||||
|
|
||||||
const merged = [...storedList];
|
const merged = [...storedList];
|
||||||
|
let addedCount = 0;
|
||||||
urls.forEach((url) => {
|
urls.forEach((url) => {
|
||||||
if (!merged.includes(url)) {
|
if (!merged.includes(url)) {
|
||||||
merged.push(url);
|
merged.push(url);
|
||||||
|
addedCount++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
"tongyishuSignedPdfUrls",
|
"tongyishuSignedPdfUrls",
|
||||||
JSON.stringify(merged)
|
JSON.stringify(merged)
|
||||||
);
|
);
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 知情同意书PDF URL已保存,新增: ${addedCount}, 总计: ${merged.length}`
|
||||||
|
);
|
||||||
} catch (cacheErr) {
|
} catch (cacheErr) {
|
||||||
window.electronAPI?.log(
|
window.electronAPI?.log(
|
||||||
"warn",
|
"warn",
|
||||||
`[UI7] 知情同意书 PDF URL 缓存失败: ${(cacheErr as Error).message}`
|
`[UI7] 知情同意书 PDF URL 缓存失败: ${(cacheErr as Error).message}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentStep >= pdfInfoList.length) {
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 检查是否完成所有签名: currentStep=${currentStep}, pdfInfoList.length=${pdfInfoList.length}, 条件: currentStep > 0 && currentStep >= pdfInfoList.length`
|
||||||
|
);
|
||||||
|
|
||||||
|
if (currentStep > 0 && currentStep >= pdfInfoList.length) {
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] ✓ 所有签名已完成!准备跳转到UI8`
|
||||||
|
);
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 已签名: 导检单(1份) + 知情同意书(${pdfInfoList.length}份) = 共${totalSteps}份`
|
||||||
|
);
|
||||||
sign();
|
sign();
|
||||||
navigate("/UI8");
|
navigate("/UI8");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const nextStep = currentStep + 1;
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 继续下一步: 从步骤 ${currentStepNum} 进入步骤 ${nextStep + 1}/${totalSteps}`
|
||||||
|
);
|
||||||
|
|
||||||
clearCanvas();
|
clearCanvas();
|
||||||
setCurrentStep((prev) => prev + 1);
|
setCurrentStep((prev) => prev + 1);
|
||||||
resetCountdown();
|
resetCountdown();
|
||||||
window.electronAPI?.log(
|
window.electronAPI?.log(
|
||||||
"info",
|
"info",
|
||||||
`[UI7] 完成第 ${currentStep + 1} 次签名,进入下一份 PDF`
|
`[UI7] ========== 步骤 ${currentStepNum} 完成,进入步骤 ${nextStep + 1} ==========`
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const msg = (err as Error).message || "签名提交失败,请稍后重试";
|
const msg = (err as Error).message || "签名提交失败,请稍后重试";
|
||||||
window.electronAPI?.log("error", `[UI7] ${msg}`);
|
window.electronAPI?.log("error", `[UI7] 签名提交失败: ${msg}`);
|
||||||
|
window.electronAPI?.log("error", `[UI7] 错误堆栈: ${(err as Error).stack || "无"}`);
|
||||||
alert(msg);
|
alert(msg);
|
||||||
} finally {
|
} finally {
|
||||||
setIsSubmitting(false);
|
setIsSubmitting(false);
|
||||||
|
window.electronAPI?.log("info", `[UI7] 提交流程结束,isSubmitting=false`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -584,19 +729,36 @@ const UI7: React.FC = () => {
|
|||||||
const sign = async () => {
|
const sign = async () => {
|
||||||
const physical_exam_id = localStorage.getItem("selectedExamId");
|
const physical_exam_id = localStorage.getItem("selectedExamId");
|
||||||
if (!physical_exam_id) {
|
if (!physical_exam_id) {
|
||||||
|
window.electronAPI?.log("error", "[UI7] 签到失败:体检ID不存在");
|
||||||
alert("体检ID不存在");
|
alert("体检ID不存在");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 开始执行签到,exam_id=${physical_exam_id}`
|
||||||
|
);
|
||||||
|
|
||||||
|
const startTime = Date.now();
|
||||||
const res = await signIn(Number(physical_exam_id));
|
const res = await signIn(Number(physical_exam_id));
|
||||||
|
const duration = Date.now() - startTime;
|
||||||
|
|
||||||
|
window.electronAPI?.log(
|
||||||
|
"info",
|
||||||
|
`[UI7] 签到响应: Status=${res.Status}, Message=${res.Message || "null"}, is_success=${res.Data?.is_success}, 耗时: ${duration}ms`
|
||||||
|
);
|
||||||
|
|
||||||
if (res.Status === 200) {
|
if (res.Status === 200) {
|
||||||
if (res.Data.is_success === 0) {
|
if (res.Data.is_success === 0) {
|
||||||
|
window.electronAPI?.log("info", "[UI7] 签到成功");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
window.electronAPI?.log("warn", `[UI7] 签到返回异常: ${res.Message}`);
|
||||||
console.log(res.Data);
|
console.log(res.Data);
|
||||||
|
|
||||||
alert(res.Message);
|
alert(res.Message);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
window.electronAPI?.log("error", `[UI7] 签到失败: ${res.Message}`);
|
||||||
alert(res.Message);
|
alert(res.Message);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user