fix: 状态码使用常量避免后续变更
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
import { request } from '@/plugins/http-fetch';
|
||||
import { parseObjLineToHump } from '@/utils/parse-utils';
|
||||
|
||||
@@ -31,7 +32,7 @@ export async function listNeInfo(query: Record<string, any>) {
|
||||
});
|
||||
|
||||
// 解析数据
|
||||
if (result.code === 1) {
|
||||
if (result.code === RESULT_CODE_SUCCESS) {
|
||||
const data: DataList = {
|
||||
total: 0,
|
||||
rows: [],
|
||||
@@ -68,7 +69,7 @@ export async function getNeInfo(id: string | number) {
|
||||
},
|
||||
});
|
||||
// 解析数据
|
||||
if (result.code === 1 && Array.isArray(result.data.data)) {
|
||||
if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) {
|
||||
let data = result.data.data[0];
|
||||
return Object.assign(result, {
|
||||
data: parseObjLineToHump(data['ne_info'][0]),
|
||||
|
||||
Reference in New Issue
Block a user