perf: 导出任务统计 - 下载地址换成按钮

This commit is contained in:
weifashi 2023-12-26 16:58:12 +08:00
parent da131746be
commit a7e5bd0b80

View File

@ -1352,6 +1352,7 @@ class ProjectController extends AbstractController
$base64 = base64_encode(Base::array2string([
'file' => $zipFile,
]));
$fileUrl = Base::fillUrl('api/project/task/down?key=' . urlencode($base64));
Session::put('task::export:userid', $user->userid);
$botUser = User::botGetOrCreate('system-msg');
if (empty($botUser)) {
@ -1364,7 +1365,7 @@ class ProjectController extends AbstractController
$text .= "\n";
$text .= "文件大小:".Base::twoFloat(filesize($zipPath) / 1024, true)."KB";
$text .= "\n";
$text .= "下载地址:".Base::fillUrl('api/project/task/down?key=' . urlencode($base64));
$text .= '<button class="ivu-btn" style="margin-top: 10px;"><a href="'.$fileUrl.'" target="_blank">立即下载</a></button>';
WebSocketDialogMsg::sendMsg(null, $dialog->id, 'text', ['text' => $text], $botUser->userid, false, false, true);
}
}