diff --git a/backend/app/dto/request/file.go b/backend/app/dto/request/file.go index abda45b67..31a088be1 100644 --- a/backend/app/dto/request/file.go +++ b/backend/app/dto/request/file.go @@ -64,7 +64,7 @@ type FileDeCompress struct { type FileEdit struct { Path string `json:"path" validate:"required"` - Content string `json:"content" validate:"required"` + Content string `json:"content"` } type FileRename struct { diff --git a/frontend/src/views/host/file-management/code-editor/index.vue b/frontend/src/views/host/file-management/code-editor/index.vue index ee9a0c2c6..ac1e58bf0 100644 --- a/frontend/src/views/host/file-management/code-editor/index.vue +++ b/frontend/src/views/host/file-management/code-editor/index.vue @@ -197,7 +197,7 @@ const quickSave = () => { const saveContent = (closePage: boolean) => { loading.value = true; - SaveFileContent(form.value).finally(() => { + SaveFileContent(form.value).then(() => { loading.value = false; open.value = !closePage; MsgSuccess(i18n.global.t('commons.msg.updateSuccess')); @@ -212,8 +212,6 @@ const acceptParams = (props: EditProps) => { form.value.path = props.path; config.language = props.language; fileName.value = props.name; - // TODO Now,1panel only support liunux,so we can use LF. - // better,We should rely on the actual line feed character of the file returned from the background config.eol = monaco.editor.EndOfLineSequence.LF; open.value = true; };