mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-22 04:54:32 +08:00
重构前端错误提示
This commit is contained in:
@@ -67,8 +67,10 @@ const EditModal = ({
|
||||
const getDetail = (node: any) => {
|
||||
request
|
||||
.get(`${config.apiPrefix}scripts/${node.title}?path=${node.parent || ''}`)
|
||||
.then((data) => {
|
||||
setValue(data.data);
|
||||
.then(({ code, data }) => {
|
||||
if (code === 200) {
|
||||
setValue(data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -83,8 +85,10 @@ const EditModal = ({
|
||||
content,
|
||||
},
|
||||
})
|
||||
.then((data) => {
|
||||
setIsRunning(true);
|
||||
.then(({ code, data }) => {
|
||||
if (code === 200) {
|
||||
setIsRunning(true);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -101,8 +105,10 @@ const EditModal = ({
|
||||
content,
|
||||
},
|
||||
})
|
||||
.then((data) => {
|
||||
setIsRunning(false);
|
||||
.then(({ code, data }) => {
|
||||
if (code === 200) {
|
||||
setIsRunning(false);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user