* add prompt audit session state.

This commit is contained in:
Chenjianyu
2023-07-14 14:06:15 +08:00
parent 23ce5c0d2a
commit 53bcf6e72d
2 changed files with 10 additions and 0 deletions
+6
View File
@@ -391,6 +391,12 @@ class ai extends control
$location = $this->ai->getTargetFormLocation($prompt, $objectId);
if(empty($location)) return $this->send(array('result' => 'fail', 'message' => $this->lang->ai->execute->fail));
if($prompt->status == 'draft')
{
$_SESSION['auditPrompt']['time'] = time();
$_SESSION['auditPrompt']['prompt'] = $prompt;
}
return $this->send(array('result' => 'success', 'message' => $this->lang->ai->execute->success, 'locate' => $location));
}
}
+4
View File
@@ -26,6 +26,10 @@
js::set('injectData', $injectData);
unset($_SESSION['aiInjectData'][$module][$method]);
$this->app->loadLang('ai');
if(isset($_SESSION['auditPrompt']))
{
if(time() - $_SESSION['auditPrompt']['time'] > 30 * 60) unset($_SESSION['auditPrompt']);
}
?>
<script>
$(function()