fix: 请求结果msg取多语言
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
RESULT_MSG_ERROR,
|
||||
RESULT_MSG_SUCCESS,
|
||||
} from '@/constants/result-constants';
|
||||
import { request } from '@/plugins/http-fetch';
|
||||
import { language, request } from '@/plugins/http-fetch';
|
||||
import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
|
||||
/**
|
||||
@@ -53,7 +53,7 @@ export async function getLogSet() {
|
||||
}
|
||||
}
|
||||
if (Object.keys(resultData).length === 0) {
|
||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR, data: {} };
|
||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR[language], data: {} };
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -100,7 +100,7 @@ export async function updateLogSet(data: Record<string, any>) {
|
||||
}
|
||||
// 无变更时
|
||||
if (resultNum === 0) {
|
||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR, data: 0 };
|
||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR[language], data: 0 };
|
||||
}
|
||||
return {
|
||||
code: RESULT_CODE_SUCCESS,
|
||||
@@ -161,7 +161,7 @@ export async function updateFtpLogSet(data: Record<string, any>) {
|
||||
delete result.data;
|
||||
return result;
|
||||
} else {
|
||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR };
|
||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR[language] };
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -216,7 +216,7 @@ export async function updateRemoteOut(data: Record<string, any>) {
|
||||
delete result.data;
|
||||
return result;
|
||||
} else {
|
||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR };
|
||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR[language] };
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -249,7 +249,7 @@ export async function exportLog(query: Record<string, any>) {
|
||||
order begin_time,end_time`;
|
||||
}
|
||||
if (!querySQL) {
|
||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR, data: [] };
|
||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR[language], data: [] };
|
||||
}
|
||||
// 发起请求
|
||||
const result = await request({
|
||||
@@ -286,7 +286,7 @@ export async function backupLog(logType: string) {
|
||||
result.data = v;
|
||||
return result;
|
||||
} else {
|
||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR, data: 0 };
|
||||
return { code: RESULT_CODE_ERROR, msg: RESULT_MSG_ERROR[language], data: 0 };
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user