mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-18 02:14:32 +08:00
umi-request 替换为 axios
This commit is contained in:
Vendored
+2
-4
@@ -19,10 +19,8 @@ const EditNameModal = ({
|
||||
setLoading(true);
|
||||
try {
|
||||
const { code, data } = await request.put(`${config.apiPrefix}envs/name`, {
|
||||
data: {
|
||||
ids,
|
||||
name: values.name,
|
||||
},
|
||||
ids,
|
||||
name: values.name,
|
||||
});
|
||||
|
||||
if (code === 200) {
|
||||
|
||||
Vendored
+8
-10
@@ -248,9 +248,7 @@ const Env = () => {
|
||||
`${config.apiPrefix}envs/${
|
||||
record.status === Status.已禁用 ? 'enable' : 'disable'
|
||||
}`,
|
||||
{
|
||||
data: [record.id],
|
||||
},
|
||||
[record.id],
|
||||
)
|
||||
.then(({ code, data }) => {
|
||||
if (code === 200) {
|
||||
@@ -388,7 +386,8 @@ const Env = () => {
|
||||
const dragRow = value[dragIndex];
|
||||
request
|
||||
.put(`${config.apiPrefix}envs/${dragRow.id}/move`, {
|
||||
data: { fromIndex: dragIndex, toIndex: hoverIndex },
|
||||
fromIndex: dragIndex,
|
||||
toIndex: hoverIndex,
|
||||
})
|
||||
.then(({ code, data }) => {
|
||||
if (code === 200) {
|
||||
@@ -438,9 +437,10 @@ const Env = () => {
|
||||
content: <>确认{OperationName[operationStatus]}选中的变量吗</>,
|
||||
onOk() {
|
||||
request
|
||||
.put(`${config.apiPrefix}envs/${OperationPath[operationStatus]}`, {
|
||||
data: selectedRowIds,
|
||||
})
|
||||
.put(
|
||||
`${config.apiPrefix}envs/${OperationPath[operationStatus]}`,
|
||||
selectedRowIds,
|
||||
)
|
||||
.then(({ code, data }) => {
|
||||
if (code === 200) {
|
||||
getEnvs();
|
||||
@@ -477,9 +477,7 @@ const Env = () => {
|
||||
try {
|
||||
const { code, data } = await request.post(
|
||||
`${config.apiPrefix}envs/upload`,
|
||||
{
|
||||
data: formData,
|
||||
},
|
||||
formData,
|
||||
);
|
||||
|
||||
if (code === 200) {
|
||||
|
||||
Vendored
+4
-3
@@ -37,9 +37,10 @@ const EnvModal = ({
|
||||
payload = { ...values, id: env.id };
|
||||
}
|
||||
try {
|
||||
const { code, data } = await request[method](`${config.apiPrefix}envs`, {
|
||||
data: payload,
|
||||
});
|
||||
const { code, data } = await request[method](
|
||||
`${config.apiPrefix}envs`,
|
||||
payload,
|
||||
);
|
||||
|
||||
if (code === 200) {
|
||||
message.success(env ? '更新变量成功' : '新建变量成功');
|
||||
|
||||
Reference in New Issue
Block a user