fix: 解决清空文件后保存失败的问题 (#3965)

This commit is contained in:
zhengkunwang 2024-02-23 18:36:40 +08:00 committed by GitHub
parent 3bd6f46fe2
commit 58f58f0fac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 4 deletions

View file

@ -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 {

View file

@ -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;
};