umi-request 替换为 axios

This commit is contained in:
whyour
2023-07-17 23:13:06 +08:00
parent bd166ee794
commit efd4f1d5ab
32 changed files with 215 additions and 214 deletions
+6 -10
View File
@@ -86,11 +86,9 @@ const EditModal = ({
const content = editorRef.current.getValue().replace(/\r\n/g, '\n');
request
.put(`${config.apiPrefix}scripts/run`, {
data: {
filename: cNode.title,
path: cNode.parent || '',
content,
},
filename: cNode.title,
path: cNode.parent || '',
content,
})
.then(({ code, data }) => {
if (code === 200) {
@@ -106,11 +104,9 @@ const EditModal = ({
}
request
.put(`${config.apiPrefix}scripts/stop`, {
data: {
filename: cNode.title,
path: cNode.parent || '',
pid: currentPid,
},
filename: cNode.title,
path: cNode.parent || '',
pid: currentPid,
})
.then(({ code, data }) => {
if (code === 200) {