25/09/24 10:00~11:30 停机维护
This commit is contained in:
@@ -262,6 +262,12 @@ function loadFileContent(item) {
|
||||
}
|
||||
|
||||
|
||||
function createAndWriteNewFile(path, content){
|
||||
fetch(`/vsc-like/create-file`, { method: 'POST', body: JSON.stringify({ path: path, parent: '.' }) , headers: { 'Content-Type': 'application/json' } })
|
||||
.then(() => {
|
||||
postSaveFile('./'+path, content)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 新建文件
|
||||
@@ -303,6 +309,12 @@ function createNewFolder(event) {
|
||||
}
|
||||
}
|
||||
|
||||
function postSaveFile(path, content){
|
||||
|
||||
fetch(`/vsc-like/save-file`, { method: 'POST', body: JSON.stringify({ path: path, content: content }) , headers: { 'Content-Type': 'application/json' } })
|
||||
.then(() => loadFileTree());
|
||||
}
|
||||
|
||||
// 保存文件
|
||||
function saveFile(event) {
|
||||
event.stopPropagation();
|
||||
@@ -311,8 +323,7 @@ function saveFile(event) {
|
||||
if (selectedItem.path==undefined){
|
||||
selectedItem.path='.';
|
||||
}
|
||||
fetch(`/vsc-like/save-file`, { method: 'POST', body: JSON.stringify({ path: selectedItem.path+'/'+selectedItem.name, content: content }) , headers: { 'Content-Type': 'application/json' } })
|
||||
.then(() => loadFileTree());
|
||||
postSaveFile(selectedItem.path+'/'+selectedItem.name, content)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user