欢迎来到你的新工作空间。 diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/SlashPresets/AddPresetModal.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/SlashPresets/AddPresetModal.jsx index 2cabfda..4ea7a06 100644 --- a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/SlashPresets/AddPresetModal.jsx +++ b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/SlashPresets/AddPresetModal.jsx @@ -9,17 +9,22 @@ export default function AddPresetModal({ isOpen, onClose, onSave }) { const handleSubmit = async (e) => { e.preventDefault(); const form = new FormData(e.target); - const sanitizedCommand = command.replace(CMD_REGEX, ""); + // 修改默认输入框英文设置 + // const sanitizedCommand = command.replace(CMD_REGEX, ""); + const sanitizedCommand = command const saved = await onSave({ - command: `/${sanitizedCommand}`, + // command: `/${sanitizedCommand}`, + command:sanitizedCommand, prompt: form.get("prompt"), description: form.get("description"), }); if (saved) setCommand(""); + window.location.reload() }; const handleCommandChange = (e) => { - const value = e.target.value.replace(CMD_REGEX, ""); + // const value = e.target.value.replace(CMD_REGEX, ""); + const value = e.target.value setCommand(value); }; @@ -29,7 +34,7 @@ export default function AddPresetModal({ isOpen, onClose, onSave }) {